Native iOS 26+ Liquid Glass widgets for Flutter with pixel-perfect fidelity. This package renders authentic Apple UI components using native platform views, providing the genuine iOS/macOS look and feel that Flutter's built-in widgets cannot achieve.
Why is this required?
The package needs to detect your OS version to decide whether to use native Liquid Glass (iOS 26+) or fallback widgets (iOS < 26). Without initialization, PlatformVersion.shouldUseNativeGlass always returns false.
Performance Best Practices
⚠️ LiquidGlassContainer & Lists
LiquidGlassContainer uses a Platform View (UiKitView / AppKitView) under the hood. While powerful, platform views are more expensive than standard Flutter widgets.
DO NOT use LiquidGlassContainer inside long scrolling lists (ListView.builder, GridView) with many items. This will cause significant performance drops (jank).
DO use LiquidGlassContainer for static elements like Cards, Headers, Navigation Bars, or Floating Action Buttons.
Why cupertino_native_better?
Comparison with Other Packages
| Feature | cupertino_native_better | cupertino_native_plus | cupertino_native |
|---------|:-----------------------:|:---------------------:|:----------------:|
| iOS 26+ Liquid Glass | Yes | Yes | No |
| Release Build Version Detection | Fixed | Broken | N/A |
| SF Symbol Fallback (iOS < 26) | CNIcon renders natively | Placeholder icons | N/A |
| Button Label + Icon Fallback | Both render correctly | Label disappears | N/A |
| Tab Bar Icon Fallback | CNIcon renders natively | Empty circles | N/A |
| Image Asset Support (PNG/SVG) | Full support | Partial | No |
| Automatic Asset Resolution | Yes (1x-4x) | No | No |
| Dark Mode Sync | Automatic | Manual | Manual |
| Glass Effect Unioning | Yes | Yes | No |
| macOS Support | Yes | Yes | Yes |
The Problem with Other Packages
cupertino_native_plus has a critical bug: it uses platform channels to detect iOS versions, which fails with "Null check operator used on a null value" in release builds. This causes:
shouldUseNativeGlass returns false even on iOS 26+
Falls back to old Cupertino widgets incorrectly
Icons show as "..." or empty circles on iOS 18
Button labels disappear when buttons have both icon and label
Our Solution
cupertino_native_better fixes all these issues:
// We parse Platform.operatingSystemVersion directly
// Example: "Version 26.1 (Build 23B82)" -> 26
static int? _getIOSVersionManually() {
final versionString = Platform.operatingSystemVersion;
final match = RegExp(r'Version (\d+)\.').firstMatch(versionString);
return int.tryParse(match?.group(1) ?? '');
}
This approach works reliably in both debug and release builds.
Features
Widgets
| Widget | Description | Controller |
|--------|-------------|:----------:|
| CNButton | Native push button with Liquid Glass effects, SF Symbols, and image assets | - |
| CNButton.icon | Circular icon-only button variant | - |
| CNIcon | Platform-rendered SF Symbols, custom IconData, or image assets | - |
| CNTabBar | Native tab bar with split mode for scroll-aware layouts | - |
| CNSlider | Native slider with min/max range and step support | CNSliderController |
| CNSwitch | Native toggle switch with animated state changes | CNSwitchController |
| CNPopupMenuButton | Native popup menu with dividers, icons, and image assets | - |
| CNPopupMenuButton.icon | Circular icon-only popup menu variant | - |
| CNSegmentedControl | Native segmented control with SF Symbols support | - |
| CNGlassButtonGroup | Grouped buttons with unified glass blending | - |
| LiquidGlassContainer | Apply Liquid Glass effects to any Flutter widget | - |
| CNGlassCard | (Experimental) Pre-styled card with optional breathing glow animation | - |
Icon Support
All widgets support three icon types with unified priority:
// Check if Liquid Glass is available
if (PlatformVersion.shouldUseNativeGlass) {
// iOS 26+ or macOS 26+
}
// Check if SF Symbols are available (iOS 13+, macOS 11+)
if (PlatformVersion.supportsSFSymbols) {
// Use CNIcon for native rendering
}
// Get specific version
print('iOS version: ${PlatformVersion.iosVersion}');
print('macOS version: ${PlatformVersion.macOSVersion}');
Requirements
Flutter: >= 3.3.0
Dart SDK: >= 3.9.0
iOS: >= 15.0 (Liquid Glass requires iOS 26+)
macOS: >= 11.0 (Liquid Glass requires macOS 26+)
Migration from cupertino_native_plus
Update your pubspec.yaml:
# Before
cupertino_native_plus: ^x.x.x
# After
cupertino_native_better: ^1.2.0
Update imports:
// Before
import 'package:cupertino_native_plus/cupertino_native_plus.dart';
// After
import 'package:cupertino_native_better/cupertino_native_better.dart';
No other code changes needed - API is fully compatible!
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)