### Basic AdaptiveApp Setup Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app.md Demonstrates a basic AdaptiveApp setup without router integration. This example shows how to configure titles and themes for both Material and Cupertino platforms. ```dart void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return AdaptiveApp( title: 'My App', themeMode: ThemeMode.system, materialLightTheme: ThemeData( colorScheme: ColorScheme.fromSeed( seedColor: Colors.blue, ), ), materialDarkTheme: ThemeData.dark(), cupertinoLightTheme: const CupertinoThemeData( brightness: Brightness.light, ), cupertinoDarkTheme: const CupertinoThemeData( brightness: Brightness.dark, ), home: const HomePage(), ); } } ``` -------------------------------- ### Run Example App Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Navigate to the example directory and execute this command to run the example application showcasing the package's features. ```bash cd example flutter run ``` -------------------------------- ### Getting Platform Description Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Demonstrates how to retrieve and print a human-readable description of the current platform. ```dart String description = PlatformInfo.platformDescription; // Returns: "iOS 26", "Android", "macOS", etc. print('Running on: $description'); ``` -------------------------------- ### AdaptiveApp Setup with GoRouter Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app.md Illustrates how to initialize AdaptiveApp with router support using GoRouter. This example configures the router and basic theming for Material and Cupertino. ```dart void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return AdaptiveApp.router( routerConfig: GoRouter( routes: [ GoRoute( path: '/', builder: (context, state) => const HomePage(), ), ], ), title: 'My App', themeMode: ThemeMode.system, materialLightTheme: ThemeData.light(), materialDarkTheme: ThemeData.dark(), cupertinoLightTheme: const CupertinoThemeData( brightness: Brightness.light, ), cupertinoDarkTheme: const CupertinoThemeData( brightness: Brightness.dark, ), ); } } ``` -------------------------------- ### AdaptiveApp Localization Setup Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Demonstrates the required setup for localization delegates and supported locales when using AdaptiveApp. ```dart AdaptiveApp( localizationsDelegates: [ GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ], supportedLocales: [ Locale('en', ''), Locale('de', ''), ], ) ``` -------------------------------- ### Adding New Widget Test Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/test/README.md Example demonstrating how to create a new test file and write tests for a new widget, including property testing and callback interaction. ```dart import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:adaptive_platform_ui/adaptive_platform_ui.dart'; void main() { group('AdaptiveNewWidget', () { testWidgets('creates widget with properties', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Scaffold( body: AdaptiveNewWidget( property: 'value', ), ), ), ); expect(find.text('value'), findsOneWidget); }); testWidgets('calls callback when interacted', (WidgetTester tester) async { bool called = false; await tester.pumpWidget( MaterialApp( home: Scaffold( body: AdaptiveNewWidget( onAction: () { called = true; }, ), ), ), ); await tester.tap(find.byType(AdaptiveNewWidget)); await tester.pump(); expect(called, isTrue); }); }); } ``` -------------------------------- ### Platform Detection Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Demonstrates how to import and use PlatformInfo to check the current operating system. ```dart import 'package:adaptive_platform_ui/adaptive_platform_ui.dart'; // Check platform if (PlatformInfo.isIOS) { print('Running on iOS'); } if (PlatformInfo.isAndroid) { print('Running on Android'); } ``` -------------------------------- ### AdaptiveTabBarView Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Shows an example of using AdaptiveTabBarView with multiple tabs and their corresponding child widgets, including a tab change callback. ```dart AdaptiveTabBarView( tabs: ['Latest', 'Popular', 'Trending'], children: [ LatestPage(), PopularPage(), TrendingPage(), ], onTabChanged: (index) { setState(() => _selectedTab = index); }, ) ``` -------------------------------- ### AdaptivePopupMenuButton Text Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Provides a usage example for AdaptivePopupMenuButton.text, including defining items and handling selection. The generic type parameter `` must match item values. ```dart AdaptivePopupMenuButton.text( label: 'Options', items: [ AdaptivePopupMenuItem(label: 'Edit', value: 'edit'), AdaptivePopupMenuItem(label: 'Delete', value: 'delete'), AdaptivePopupMenuDivider(), AdaptivePopupMenuItem(label: 'Share', value: 'share'), ], onSelected: (index, item) { print('Selected: ${item.value}'); }, ) ``` -------------------------------- ### AdaptiveNavigationDestination Configurations Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/configuration.md Provides examples of configuring AdaptiveNavigationDestination with SF Symbols, IconData, badges, search functionality, and spacers. ```dart // With SF Symbol (iOS 26+) AdaptiveNavigationDestination( icon: 'house.fill', // SF Symbol name label: 'Home', ) ``` ```dart // With IconData AdaptiveNavigationDestination( icon: Icons.home, selectedIcon: Icons.home_filled, label: 'Home', ) ``` ```dart // With badge AdaptiveNavigationDestination( icon: 'bell.fill', label: 'Notifications', badgeCount: 5, ) ``` ```dart // Search tab (iOS 26+) AdaptiveNavigationDestination( icon: 'magnifyingglass', label: 'Search', isSearch: true, ) ``` ```dart // With spacer after (iOS 26+) AdaptiveNavigationDestination( icon: 'ellipsis', label: 'More', addSpacerAfter: true, ) ``` -------------------------------- ### Adaptive Date Picker Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-input-widgets.md Example of how to use AdaptiveDatePicker.show to display a platform-specific date selection dialog. Handles the selected date or cancellation. ```dart final selectedDate = await AdaptiveDatePicker.show( context: context, initialDate: DateTime.now(), firstDate: DateTime(2020), lastDate: DateTime(2025), ); if (selectedDate != null) { print('Selected: ${selectedDate.toString()}'); } ``` -------------------------------- ### Adaptive Time Picker Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-input-widgets.md Example of how to use AdaptiveTimePicker.show to display a platform-specific time selection dialog. Handles the selected time or cancellation. ```dart final selectedTime = await AdaptiveTimePicker.show( context: context, initialTime: TimeOfDay.now(), use24HourFormat: false, ); if (selectedTime != null) { print('Selected: ${selectedTime.format(context)}'); } ``` -------------------------------- ### Basic AdaptiveScaffold Setup Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/configuration.md Set up a basic AdaptiveScaffold with an app bar, bottom navigation bar, and body content. This provides the fundamental structure for a screen. ```dart AdaptiveScaffold( appBar: AdaptiveAppBar( title: 'Home', ), bottomNavigationBar: AdaptiveBottomNavigationBar( items: [ AdaptiveNavigationDestination( icon: 'house.fill', label: 'Home', ), ], selectedIndex: 0, onTap: (index) {}, ), body: const Center(child: Text('Content')), ) ``` -------------------------------- ### Adaptive Form Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Shows how to create a form with AdaptiveTextFormField and an AdaptiveButton for submission, including basic validation. ```dart Form( key: _formKey, child: Column( children: [ AdaptiveTextFormField( placeholder: 'Email', keyboardType: TextInputType.emailAddress, validator: (value) { if (value?.isEmpty ?? true) return 'Required'; return null; }, ), AdaptiveButton( onPressed: () { if (_formKey.currentState!.validate()) { // Submit } }, label: 'Submit', ), ], ), ) ``` -------------------------------- ### Localization Setup for AdaptiveApp Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/configuration.md Illustrates the necessary configuration for localization delegates and supported locales within an AdaptiveApp to enable automatic translations. ```dart AdaptiveApp( localizationsDelegates: [ GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ], supportedLocales: [ Locale('en', ''), Locale('de', ''), Locale('tr', ''), ], // ... rest of configuration ) ``` -------------------------------- ### AdaptiveFloatingActionButton Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Provides an example of how to implement an AdaptiveFloatingActionButton with an onPressed action and an icon child. ```dart AdaptiveFloatingActionButton( onPressed: () { // Add action }, child: Icon(Icons.add), ) ``` -------------------------------- ### AdaptiveExpansionTile Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Demonstrates how to use the AdaptiveExpansionTile widget with a title and a list of children widgets. ```dart AdaptiveExpansionTile( title: Text('Settings'), initiallyExpanded: false, children: [ ListTile(title: Text('Option 1')), ListTile(title: Text('Option 2')), ListTile(title: Text('Option 3')), ], ) ``` -------------------------------- ### Flutter Build and Development Commands Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/CLAUDE.md Common commands for managing dependencies, analysis, testing, formatting, running the example app, and publishing the plugin. ```bash flutter pub get ``` ```bash flutter analyze --fatal-infos ``` ```bash flutter test ``` ```bash flutter test test/adaptive_button_test.dart ``` ```bash flutter test --coverage ``` ```bash dart format . ``` ```bash cd example && flutter pub get && flutter run ``` ```bash flutter pub publish --dry-run ``` -------------------------------- ### Basic Alert Dialog Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-alert-dialog.md Demonstrates how to display a basic adaptive alert dialog with 'Cancel' and 'Confirm' actions. The 'Confirm' action has an associated callback. ```dart AdaptiveAlertDialog.show( context: context, title: 'Confirm', message: 'Are you sure?', actions: [ AlertAction( title: 'Cancel', style: AlertActionStyle.cancel, ), AlertAction( title: 'Confirm', style: AlertActionStyle.primary, onPressed: () { // Do something }, ), ], ); ``` -------------------------------- ### Basic App Setup with AdaptiveApp Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Sets up the root of your Flutter application using AdaptiveApp, configuring themes for Material and Cupertino platforms, and enabling system theme mode. ```dart import 'package:adaptive_platform_ui/adaptive_platform_ui.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return AdaptiveApp( title: 'My App', themeMode: ThemeMode.system, materialLightTheme: ThemeData.light(), materialDarkTheme: ThemeData.dark(), cupertinoLightTheme: const CupertinoThemeData(brightness: Brightness.light), cupertinoDarkTheme: const CupertinoThemeData(brightness: Brightness.dark), home: const HomePage(), ); } } ``` -------------------------------- ### iOS Version Detection Examples Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Shows various ways to check iOS versions, including specific numbers, ranges, and version-dependent features. ```dart // Check iOS version number int version = PlatformInfo.iOSVersion; // e.g., 26 if (version >= 26) { print('Using iOS 26+ features'); } // Check version ranges if (PlatformInfo.isIOSVersionInRange(24, 26)) { print('iOS version is between 24 and 26'); } // Specific version checks if (PlatformInfo.isIOS26OrHigher()) { print('Using iOS 26+ native features'); } if (PlatformInfo.isIOS18OrLower()) { print('Using legacy iOS features'); } ``` -------------------------------- ### Icon Selection Based on Platform Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Shows how to select appropriate icons (e.g., Cupertino for iOS, Material for others) based on the detected platform. ```dart IconData getIcon() { if (PlatformInfo.isIOS) { return CupertinoIcons.heart; } return Icons.favorite; } ``` -------------------------------- ### Platform-Specific Rendering Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Illustrates how to conditionally render different widgets based on the detected platform and iOS version. ```dart Widget build(BuildContext context) { if (PlatformInfo.isIOS26OrHigher()) { return iOS26SpecificWidget(); } else if (PlatformInfo.isIOS) { return LegacyIOSWidget(); } else if (PlatformInfo.isAndroid) { return AndroidWidget(); } return DefaultWidget(); } ``` -------------------------------- ### Basic AdaptiveApp Theme Setup Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/configuration.md Configure distinct Material (Android) and Cupertino (iOS) themes for your application. This allows for platform-specific visual styling. ```dart AdaptiveApp( title: 'My App', themeMode: ThemeMode.system, // Material (Android) themes materialLightTheme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), ), materialDarkTheme: ThemeData.dark( useMaterial3: true, ), // Cupertino (iOS) themes cupertinoLightTheme: const CupertinoThemeData( brightness: Brightness.light, primaryColor: CupertinoColors.systemBlue, ), cupertinoDarkTheme: const CupertinoThemeData( brightness: Brightness.dark, primaryColor: CupertinoColors.systemBlue, ), home: const HomePage(), ) ``` -------------------------------- ### Adaptive Alert Dialog Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Illustrates how to display a confirmation dialog using AdaptiveAlertDialog with cancel and confirm actions. ```dart AdaptiveAlertDialog.show( context: context, title: 'Confirm', message: 'Are you sure?', actions: [ AlertAction( title: 'Cancel', style: AlertActionStyle.cancel, ), AlertAction( title: 'Confirm', style: AlertActionStyle.primary, onPressed: () => Navigator.pop(context), ), ], ); ``` -------------------------------- ### AdaptiveFormSection Examples Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Illustrates AdaptiveFormSection for grouping form elements, with examples for basic sections and inset grouped styles. Use for organizing related input fields. ```dart // Basic form section AdaptiveFormSection( header: Text('Personal Information'), footer: Text('Please provide accurate information'), children: [ CupertinoFormRow( prefix: Text('Name'), child: AdaptiveTextField(placeholder: 'Enter name'), ), CupertinoFormRow( prefix: Text('Email'), child: AdaptiveTextField(placeholder: 'Enter email'), ), ], ) ``` ```dart // Inset grouped style AdaptiveFormSection.insetGrouped( header: Text('Settings'), children: [ CupertinoFormRow( prefix: Text('Notifications'), child: AdaptiveSwitch(value: true, onChanged: (v) {}), ), ], ) ``` -------------------------------- ### Basic AdaptiveAppBar Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app-bar.md A simple AdaptiveAppBar with a title. Use this for a basic app bar setup. ```dart AdaptiveAppBar( title: 'Home', ) ``` -------------------------------- ### Feature Availability Checks Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Illustrates how to conditionally use platform-specific UI elements or features based on iOS version. ```dart // Use native iOS 26 button only on iOS 26+ if (PlatformInfo.isIOS26OrHigher()) { button = AdaptiveButton( onPressed: () {}, label: 'Native iOS 26 Button', ); } else { button = AdaptiveButton( onPressed: () {}, label: 'Fallback Button', useNative: false, ); } ``` -------------------------------- ### AdaptiveRadio Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-controls.md Demonstrates how to use AdaptiveRadio within a StatefulWidget to manage selected options. The state is updated via the onChanged callback. ```dart enum Options { option1, option2, option3 } class MyWidget extends StatefulWidget { @override State createState() => _MyWidgetState(); } class _MyWidgetState extends State { Options? _selectedOption = Options.option1; @override Widget build(BuildContext context) { return Column( children: [ AdaptiveRadio( value: Options.option1, groupValue: _selectedOption, onChanged: (Options? value) { setState(() => _selectedOption = value); }, ), AdaptiveRadio( value: Options.option2, groupValue: _selectedOption, onChanged: (Options? value) { setState(() => _selectedOption = value); }, ), AdaptiveRadio( value: Options.option3, groupValue: _selectedOption, onChanged: (Options? value) { setState(() => _selectedOption = value); }, ), ], ); } } ``` -------------------------------- ### AdaptiveTooltip Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Illustrates how to use AdaptiveTooltip to add a tooltip message to an icon. The tooltip is configured to be displayed below the widget. ```dart AdaptiveTooltip( message: 'This is helpful information', preferBelow: true, child: Icon(Icons.info), ) ``` -------------------------------- ### Initialize and Get Singleton Instance Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Ensures a singleton instance of a class is created and returned. Used for global state management like `Bf` and `jf`. ```javascript function qf(){W=this} function Bf(){return null==W&&new qf,W} ``` ```javascript function xf(){K=this} function jf(){return null==K&&new xf,K} ``` -------------------------------- ### AdaptiveFloatingActionButton Examples Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Shows different configurations of AdaptiveFloatingActionButton, including basic, mini, and custom-colored variants. Suitable for primary actions on a screen. ```dart // Basic floating action button AdaptiveFloatingActionButton( onPressed: () {}, child: Icon(Icons.add), ) ``` ```dart // Mini FAB AdaptiveFloatingActionButton( onPressed: () {}, mini: true, child: Icon(Icons.edit), ) ``` ```dart // Custom colors AdaptiveFloatingActionButton( onPressed: () {}, backgroundColor: Colors.red, foregroundColor: Colors.white, child: Icon(Icons.favorite), ) ``` -------------------------------- ### AdaptiveExpansionTile Examples Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Demonstrates AdaptiveExpansionTile for collapsible content sections, showing basic, leading/subtitle, and custom color variations. Useful for FAQs or expandable menus. ```dart // Basic expansion tile AdaptiveExpansionTile( title: Text('Settings'), children: [ ListTile(title: Text('Option 1')), ListTile(title: Text('Option 2')), ], ) ``` ```dart // With leading and subtitle AdaptiveExpansionTile( leading: Icon(Icons.settings), title: Text('Advanced Settings'), subtitle: Text('Configure advanced options'), initiallyExpanded: true, children: [ ListTile(title: Text('Option 1')), ListTile(title: Text('Option 2')), ], ) ``` ```dart // With custom colors AdaptiveExpansionTile( title: Text('Premium Features'), backgroundColor: Colors.amber.withValues(alpha: 0.1), iconColor: Colors.amber, onExpansionChanged: (expanded) { print('Expanded: $expanded'); }, children: [ ListTile(title: Text('Feature 1')), ListTile(title: Text('Feature 2')), ], ) ``` -------------------------------- ### Run flutter pub get Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Execute this command in your project's root directory after updating pubspec.yaml to fetch the new dependency. ```bash flutter pub get ``` -------------------------------- ### Enabling iOS 26 Features in Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/ios26-specific.md Shows how to conditionally use native iOS 26 widgets based on the platform version. Includes a fallback to AdaptiveButton for older iOS versions or other platforms. ```dart // Check platform if (PlatformInfo.isIOS26OrHigher()) { // Use native iOS 26 widgets return AdaptiveButton( onPressed: () {}, label: 'Native iOS 26', useNative: true, ); } // Fallback return AdaptiveButton( onPressed: () {}, label: 'Fallback', useNative: false, ); ``` -------------------------------- ### Platform Detection Logic Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Provides examples of using PlatformInfo to conditionally execute code based on the operating system and version. ```dart if (PlatformInfo.isIOS26OrHigher()) { // iOS 26+ features } else if (PlatformInfo.isIOS) { // Legacy iOS features } else if (PlatformInfo.isAndroid) { // Android features } ``` -------------------------------- ### Platform Detection with Adaptive Platform UI Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/errors-and-warnings.md Provides code examples for checking platform-specific information like iOS version and general platform description using the PlatformInfo class. ```dart import 'package:adaptive_platform_ui/adaptive_platform_ui.dart'; // In your app, verify platform detection print('Is iOS: ${PlatformInfo.isIOS}'); print('Is iOS 26+: ${PlatformInfo.isIOS26OrHigher()}'); print('iOS Version: ${PlatformInfo.iOSVersion}'); print('Platform: ${PlatformInfo.platformDescription}'); ``` -------------------------------- ### AdaptiveApp Localization Setup Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Configure localization delegates for AdaptiveApp to ensure proper internationalization of widgets like date/time pickers. Include GlobalCupertinoLocalizations.delegate for iOS-specific translations. ```dart import 'package:flutter_localizations/flutter_localizations.dart'; AdaptiveApp( localizationsDelegates: [ GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, // Important! GlobalWidgetsLocalizations.delegate, ], supportedLocales: [ Locale('en', ''), // English Locale('de', ''), // German Locale('tr', ''), // Turkish // Add more locales as needed ], // ... rest of your app configuration ) ``` -------------------------------- ### Get human-readable platform description Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/platform-info.md Returns a string describing the current platform, such as 'iOS 26', 'Android', or 'macOS'. Useful for logging or displaying platform information. ```dart static String get platformDescription ``` ```dart String description = PlatformInfo.platformDescription; // Returns: "iOS 26", "Android", "macOS", etc. print('Running on: $description'); ``` -------------------------------- ### AdaptiveListTile Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Demonstrates the usage of AdaptiveListTile to create a list item with an icon, title, subtitle, and a trailing icon, including an onTap callback for navigation. ```dart AdaptiveListTile( leading: Icon(Icons.person), title: Text('John Doe'), subtitle: Text('john@example.com'), trailing: Icon(Icons.chevron_right), onTap: () => Navigator.push(context, ...), ) ``` -------------------------------- ### Adaptive Button Examples Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Demonstrates various styles of AdaptiveButton, including filled, glass effect, icon-only, and SF Symbol variants for iOS 26+. ```dart // Filled button AdaptiveButton( onPressed: () {}, label: 'Press Me', style: AdaptiveButtonStyle.filled, ) ``` ```dart // Glass effect (iOS 26+) AdaptiveButton( onPressed: () {}, label: 'Glass Button', style: AdaptiveButtonStyle.glass, ) ``` ```dart // Icon button AdaptiveButton.icon( onPressed: () {}, icon: Icons.favorite, ) ``` ```dart // SF Symbol (iOS 26+) AdaptiveButton.sfSymbol( onPressed: () {}, sfSymbol: SFSymbol('star.fill', color: Colors.orange), ) ``` -------------------------------- ### AdaptiveCard Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Demonstrates how to use the AdaptiveCard widget to create a card with custom padding and content. The child widget is a Column containing a title and text. ```dart AdaptiveCard( padding: EdgeInsets.all(16), child: Column( children: [ Text('Card Title'), SizedBox(height: 8), Text('Card content goes here'), ], ), ) ``` -------------------------------- ### Basic AdaptiveScaffold Usage Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-scaffold.md A basic implementation of AdaptiveScaffold with a title in the app bar and a bottom navigation bar. This example demonstrates setting up navigation destinations and handling user taps. ```dart AdaptiveScaffold( appBar: AdaptiveAppBar( title: 'Home', ), bottomNavigationBar: AdaptiveBottomNavigationBar( items: [ AdaptiveNavigationDestination( icon: 'house.fill', label: 'Home', ), AdaptiveNavigationDestination( icon: 'person.fill', label: 'Profile', ), ], selectedIndex: _selectedIndex, onTap: (index) { setState(() => _selectedIndex = index); }, ), body: Center( child: Text('Page ${_selectedIndex}') ), ) ``` -------------------------------- ### Alert Dialog with Icon Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-alert-dialog.md Shows how to display an adaptive alert dialog with a success icon. The icon type adapts based on the platform (SF Symbol for iOS 26+, IconData for others). ```dart AdaptiveAlertDialog.show( context: context, title: 'Success', message: 'Operation completed', icon: PlatformInfo.isIOS26OrHigher() ? 'checkmark.circle.fill' // SF Symbol for iOS 26+ : Icons.check_circle, // IconData for others iconSize: 48, iconColor: Colors.green, actions: [ AlertAction( title: 'OK', style: AlertActionStyle.primary, onPressed: () => Navigator.pop(context), ), ], ); ``` -------------------------------- ### Function to Get Global Instance 'D' Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the global instance 'D', which is initialized by the 'ro' function. This instance is likely a specific utility or configuration object. ```javascript function no(n){return ro(),Ff().fb(Jf(to),n)} ``` -------------------------------- ### AdaptiveBadge Usage Examples Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Shows different ways to use AdaptiveBadge: as a count badge with an icon, as a label badge with a custom background color, and as a large badge. ```dart // Count badge AdaptiveBadge( count: 5, child: Icon(Icons.notifications), ) // Label badge AdaptiveBadge( label: 'NEW', backgroundColor: Colors.red, child: Icon(Icons.mail), ) // Large badge AdaptiveBadge( count: 99, isLarge: true, child: Icon(Icons.message), ) ``` -------------------------------- ### AdaptiveApp with Platform-Specific Themes Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app.md Configure AdaptiveApp to use different themes for Material and Cupertino platforms, including specific versions of iOS. This example demonstrates setting distinct light and dark themes for both Material and Cupertino, and conditionally applying Cupertino app data based on iOS version. ```dart AdaptiveApp( title: 'My App', themeMode: ThemeMode.system, materialLightTheme: ThemeData.light(), materialDarkTheme: ThemeData.dark(), cupertinoLightTheme: const CupertinoThemeData( brightness: Brightness.light, ), cupertinoDarkTheme: const CupertinoThemeData( brightness: Brightness.dark, ), material: (context, platform) { return MaterialAppData( debugShowCheckedModeBanner: false, color: Colors.blue, ); }, cupertino: (context, platform) { if (PlatformInfo.isIOS26OrHigher()) { return const CupertinoAppData( color: CupertinoColors.systemBlue, ); } return const CupertinoAppData(); }, home: const HomePage(), ) ``` -------------------------------- ### Get prototype of a function Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the prototype of a given function. ```javascript function se(n){return n.prototype} ``` -------------------------------- ### Layout with AdaptiveScaffold and Navigation Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Demonstrates a basic layout using AdaptiveScaffold, including an AdaptiveAppBar with actions and an AdaptiveBottomNavigationBar with navigation destinations. ```dart AdaptiveScaffold( appBar: AdaptiveAppBar( title: 'Home', actions: [ AdaptiveAppBarAction( onPressed: () {}, iosSymbol: 'gear', androidIcon: Icons.settings, ), ], ), bottomNavigationBar: AdaptiveBottomNavigationBar( items: [ AdaptiveNavigationDestination(icon: 'house.fill', label: 'Home'), AdaptiveNavigationDestination(icon: 'person.fill', label: 'Profile'), ], selectedIndex: 0, onTap: (index) {}, ), body: Center(child: Text('Content')), ) ``` -------------------------------- ### Get Long value for 16777216 Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the Long value for 16777216. ```javascript function me(){return Me(),T} ``` -------------------------------- ### Get maximum Long value Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the maximum Long value. ```javascript function we(){return Me(),I} ``` -------------------------------- ### Create Documentation Button Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Creates a documentation button with a specified link. It uses Jf and Ff for rendering and applies specific CSS classes. ```javascript function Qo(n){var t;return $f().fb(Jf((t=n,function(n){return n.t9("documentation-button"),n.bd(t.cb_1),lr()})),n.db_1)} ``` -------------------------------- ### Get minimum Long value Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the minimum Long value. ```javascript function ge(){return Me(),P} ``` -------------------------------- ### Run All Tests Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/test/README.md Execute all tests in the project. ```bash flutter test ``` -------------------------------- ### Get the negative of a Long number Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the Long number with its sign flipped. ```javascript function Ee(n){return Me(),n.e9()} ``` -------------------------------- ### Get zero Long value Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the Long value representing 0. ```javascript function pe(){return Me(),E} ``` -------------------------------- ### Get negative one Long value Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the Long value representing -1. ```javascript function be(){return Me(),S} ``` -------------------------------- ### AdaptiveScaffold with Basic AppBar and Bottom Navigation Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Demonstrates the basic usage of AdaptiveScaffold with a custom AdaptiveAppBar and AdaptiveBottomNavigationBar. ```dart AdaptiveScaffold( appBar: AdaptiveAppBar( title: 'My App', actions: [ AdaptiveAppBarAction( onPressed: () {}, iosSymbol: 'gear', icon: Icons.settings, ), ], ), bottomNavigationBar: AdaptiveBottomNavigationBar( items: [ AdaptiveNavigationDestination( icon: 'house.fill', label: 'Home', ), AdaptiveNavigationDestination( icon: 'person.fill', label: 'Profile', ), ], selectedIndex: 0, onTap: (index) {}, ), body: YourContent(), ) ``` -------------------------------- ### AdaptiveFormSection Usage Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Illustrates the usage of AdaptiveFormSection to group form fields, with a header and footer for context. ```dart AdaptiveFormSection( header: Text('Personal Information'), footer: Text('Please provide accurate information'), children: [ AdaptiveTextFormField(placeholder: 'Name'), AdaptiveTextFormField(placeholder: 'Email'), AdaptiveTextFormField(placeholder: 'Phone'), ], ) ``` -------------------------------- ### Conditional Rendering with PlatformInfo Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/configuration.md Demonstrates how to use PlatformInfo to conditionally render widgets based on the operating system and version. ```dart if (PlatformInfo.isIOS26OrHigher()) { // Use iOS 26+ native features return AdaptiveButton( onPressed: () {}, label: 'Native iOS 26', style: AdaptiveButtonStyle.glass, useNative: true, ); } else if (PlatformInfo.isIOS) { // Use legacy iOS features return AdaptiveButton( onPressed: () {}, label: 'Legacy iOS', useNative: false, ); } else if (PlatformInfo.isAndroid) { // Use Android Material return AdaptiveButton( onPressed: () {}, label: 'Material', ); } ``` -------------------------------- ### Get DOM Element by ID Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Retrieves a DOM element by its ID. Throws an error if the element is not found. ```javascript function Ef(n){var t=document.getElementById(n);if(null==t)throw hu("'"+n+"' element missing");return t} ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/test/README.md Execute tests and generate a coverage report. ```bash flutter test --coverage ``` -------------------------------- ### Platform-Specific App Configuration Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Illustrates how to configure Material and Cupertino app themes and settings differently for various platforms using AdaptiveApp. ```dart AdaptiveApp( material: (context, platform) { return MaterialAppData( debugShowCheckedModeBanner: false, ); }, cupertino: (context, platform) { if (platform == PlatformTarget.ios26Plus) { return const CupertinoAppData(); } return const CupertinoAppData(); }, ) ``` -------------------------------- ### Build UI Component with Styling Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Builds a UI component, likely a text element, with specified content and styling. It uses cs and of for construction and styling. ```javascript function uf(n,t){return new cs(of(n,jf().sd(t),ps()))} ``` -------------------------------- ### Flutter to Native Bridge - Dart Side Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/CLAUDE.md Example of creating a UiKitView on the Dart side to embed native iOS components. ```dart Creates a `UiKitView` with `viewType: 'adaptive_platform_ui/ios26_{component}'`, passes configuration as `creationParams`, and sets up a `MethodChannel` with pattern `adaptive_platform_ui/{component}_{instanceId}` for callbacks. ``` -------------------------------- ### Basic Widget Test Structure Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/test/README.md A standard structure for writing widget tests in Flutter. It includes setup, interaction, and assertion phases. ```dart import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:adaptive_platform_ui/adaptive_platform_ui.dart'; void main() { group('WidgetName', () { testWidgets('test description', (WidgetTester tester) async { // Arrange await tester.pumpWidget( MaterialApp( home: Scaffold( body: WidgetUnderTest(), ), ), ); // Act await tester.tap(find.text('Button')); await tester.pump(); // Assert expect(result, expectedValue); }); }); } ``` -------------------------------- ### AdaptiveApp Theme Configuration Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/README.md Shows how to provide distinct light and dark themes for Material and Cupertino platforms within AdaptiveApp. ```dart AdaptiveApp( materialLightTheme: /* Material theme */, materialDarkTheme: /* Material dark theme */, cupertinoLightTheme: /* Cupertino theme */, cupertinoDarkTheme: /* Cupertino dark theme */, ) ``` -------------------------------- ### Manage Collapsible Sections Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Manages the state of collapsible sections, allowing them to be expanded or collapsed. Provides functions to get the current state. ```javascript function ds(n){bs.call(this),this.ve_1=n} ``` ```javascript function gs(n,t,r){bs.call(this),this.se_1=n,this.te_1=t,this.ue_1=r} ``` ```javascript function ws(n,t){Di.call(this,n,t)} ``` ```javascript function ks(n,t,r){t=t===A?pt():t,r=r===A?ps():r,this.ub_1=n,this.vb_1=t,this.wb_1=r} ``` ```javascript function ps(){return vs(),vn} ``` ```javascript function ms(){return vs(),dn} ``` -------------------------------- ### AdaptiveButton Small Size Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Example of a small AdaptiveButton, which has a reduced height suitable for compact UIs. This size is often used for auxiliary actions. ```dart // Small button (28pt height on iOS) AdaptiveButton( onPressed: () {}, size: AdaptiveButtonSize.small, label: 'Small', ) ``` -------------------------------- ### AdaptiveButton Bordered Style Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Example of a bordered AdaptiveButton. This style can be used for actions that require a clear visual boundary without being overly prominent. ```dart // Bordered button AdaptiveButton( onPressed: () {}, style: AdaptiveButtonStyle.bordered, label: 'Bordered', ) ``` -------------------------------- ### AdaptiveApp: Enabling Performance Overlay Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/errors-and-warnings.md Shows how to enable the performance overlay (FPS counter) by setting showPerformanceOverlay to true within MaterialAppData or CupertinoAppData. ```dart AdaptiveApp( // ... theme config material: (context, platform) => MaterialAppData( showPerformanceOverlay: true, // Enable FPS counter ), cupertino: (context, platform) => CupertinoAppData( showPerformanceOverlay: true, ), home: const HomePage(), ) ``` -------------------------------- ### AdaptiveButton Filled Style Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Example of a filled AdaptiveButton, typically used for primary actions. Ensure the 'label' property is set for the button text. ```dart // Filled button (primary action) AdaptiveButton( onPressed: () {}, style: AdaptiveButtonStyle.filled, label: 'Filled', ) ``` -------------------------------- ### Create and Configure Class List Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Creates a configuration for a list of CSS classes to be applied to a DOM element. Used for styling elements. ```javascript function rs(n){es.call(this),this.he_1=n} ``` -------------------------------- ### AdaptivePopupMenuButton Static Factory Methods Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Shows the static factory methods available for creating AdaptivePopupMenuButton instances with different configurations. ```dart // Static factory methods: AdaptivePopupMenuButton.text ({ required String label, required List items, required Function(int, AdaptivePopupMenuItem) onSelected, Color? tint, double height = 32.0, }) AdaptivePopupMenuButton.icon ({ required String icon, required List items, required Function(int, AdaptivePopupMenuItem) onSelected, Color? tint, }) AdaptivePopupMenuButton.widget ({ required List items, required Function(int, AdaptivePopupMenuItem) onSelected, required Widget child, }) ``` -------------------------------- ### Create Documentation Link Object Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Creates a documentation link object with a URL and an empty label. Used for associating documentation with specific elements. ```javascript function ef(n){var t=n.documentationLink;return null==t?null:new Qu(t,"")} ``` -------------------------------- ### Function to Get Global Instance 'O' Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Returns the global instance 'O', initialized by the 'ro' function. This instance is likely a specific utility or configuration object. ```javascript function to(n){return ro(),n.gb(["invisible-text","text-for-copy"]),lr()} ``` -------------------------------- ### Provide Material and Cupertino Themes Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/errors-and-warnings.md To apply custom themes correctly, provide both Material and Cupertino theme data to your `AdaptiveApp`. This prevents fallback to default system colors. ```dart AdaptiveApp( materialLightTheme: ThemeData.light(), materialDarkTheme: ThemeData.dark(), cupertinoLightTheme: const CupertinoThemeData(brightness: Brightness.light), cupertinoDarkTheme: const CupertinoThemeData(brightness: Brightness.dark), // ... rest of config ) ``` -------------------------------- ### Create and Configure Component Element Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/example/android/build/reports/problems/problems-report.html Creates a component element with a specified tag name and configuration. Used for building reusable UI components. ```javascript function Wf(n,t,r,i){t=t===A?pt():t,r=r===A?null:r,i=i===A?pt():i,Xf.call(this),this.be_1=n,this.ce_1=t,this.de_1=r,this.ee_1=i} ``` -------------------------------- ### AdaptiveAppBar Constructor Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app-bar.md Configuration for platform-adaptive app bars. It allows customization of title, actions, leading widget, and platform-specific toolbar rendering. ```APIDOC ## AdaptiveAppBar ### Description Creates a platform-adaptive app bar that works seamlessly with AdaptiveScaffold. It can render as a native toolbar on iOS 26+ or as a standard Material AppBar on Android, with options for custom navigation bars. ### Constructor ```dart const AdaptiveAppBar({ String? title, List? actions, Widget? leading, bool useNativeToolbar = true, Color? tintColor, PreferredSizeWidget? cupertinoNavigationBar, PreferredSizeWidget? appBar, }) ``` ### Parameters #### Widget Parameters - **title** (String?) - Optional - The title to display in the app bar. - **actions** (List?) - Optional - A list of actions to display at the end of the app bar. - **leading** (Widget?) - Optional - A widget to display before the title, typically a back button or menu icon. - **cupertinoNavigationBar** (PreferredSizeWidget?) - Optional - A custom CupertinoNavigationBar to use for iOS. - **appBar** (PreferredSizeWidget?) - Optional - A custom Material AppBar to use for Android. #### Behavior Parameters - **useNativeToolbar** (bool) - Optional - Defaults to `true`. If true, uses the native iOS 26+ UIToolbar for a native look and feel. If false, uses a standard Material AppBar or CupertinoNavigationBar. - **tintColor** (Color?) - Optional - Defaults to `null`. The tint color for buttons in the native iOS 26+ UIToolbar. This parameter is ignored on Android. ### Related Classes #### AdaptiveAppBarAction Configuration for app bar action buttons. ```dart class AdaptiveAppBarAction { const AdaptiveAppBarAction({ required VoidCallback? onPressed, required dynamic icon, String? iosSymbol, IconData? androidIcon, String? tooltip, }); } ``` - **onPressed** (VoidCallback?) - Required - Callback when the action button is pressed. - **icon** (dynamic) - Required - The icon to display. Can be an IconData, an SF Symbol string, or a widget. - **iosSymbol** (String?) - Optional - The SF Symbol name for iOS. Overrides the `icon` parameter on iOS. - **androidIcon** (IconData?) - Optional - The IconData for Android. Overrides the `icon` parameter on Android. - **tooltip** (String?) - Optional - Tooltip text to display when the action button is long-pressed. #### ToolbarSpacerType Spacer types for toolbar spacing. ```dart enum ToolbarSpacerType { flexible, fixed, } ``` - **flexible**: A flexible space that expands to fill available space. - **fixed**: A fixed-width space. ``` -------------------------------- ### AdaptiveTooltip Constructor Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-display-widgets.md Defines the constructor for AdaptiveTooltip, a platform-specific tooltip widget. It requires a child widget and a message, with options for display duration and positioning. ```dart const AdaptiveTooltip({ required Widget child, required String message, Duration showDuration = const Duration(seconds: 3), Duration waitDuration = const Duration(milliseconds: 0), double verticalOffset = 24.0, bool preferBelow = true, }) ``` -------------------------------- ### AdaptiveButton Large Size Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Example of a large AdaptiveButton, providing a larger touch target and visual prominence. Ideal for critical actions or when a larger button is desired. ```dart // Large button (44pt height on iOS) AdaptiveButton( onPressed: () {}, size: AdaptiveButtonSize.large, label: 'Large', ) ``` -------------------------------- ### AdaptiveTabBarView Example Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/README.md Shows a horizontal swipeable tab view with tabs at the top, suitable for navigating between different sections of content. Use when you have distinct content categories. ```dart // Tab bar view at the top AdaptiveTabBarView( tabs: ['Latest', 'Popular', 'Trending'], children: [ LatestPage(), PopularPage(), TrendingPage(), ], onTabChanged: (index) { print('Tab changed to: $index'); }, ) ``` -------------------------------- ### AdaptiveApp.router Constructor Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app.md Creates an AdaptiveApp instance with built-in support for routing frameworks such as GoRouter. This constructor allows for detailed configuration of routing, route information handling, and back button behavior. ```APIDOC ## AdaptiveApp.router (Router Support) Creates an AdaptiveApp with router support (e.g., GoRouter). ### Parameters #### Constructor Parameters - **routerConfig** (RouterConfig?) - Optional - Router configuration (GoRouter) - **routeInformationProvider** (RouteInformationProvider?) - Optional - Route information provider - **routeInformationParser** (RouteInformationParser?) - Optional - Route information parser - **routerDelegate** (RouterDelegate?) - Optional - Router delegate - **backButtonDispatcher** (BackButtonDispatcher?) - Optional - Android back button dispatcher - **builder** (TransitionBuilder?) - Optional - Builder to wrap router - **title** (String) - Optional - App title, defaults to '' - **onGenerateTitle** (GenerateAppTitle?) - Optional - Dynamic title generator - **themeMode** (ThemeMode?) - Optional - Theme mode (light, dark, system) - **materialLightTheme** (ThemeData?) - Optional - Material light theme - **materialDarkTheme** (ThemeData?) - Optional - Material dark theme - **cupertinoLightTheme** (CupertinoThemeData?) - Optional - Cupertino light theme - **cupertinoDarkTheme** (CupertinoThemeData?) - Optional - Cupertino dark theme - **locale** (Locale?) - Optional - App locale - **localizationsDelegates** (Iterable>?) - Optional - Localization delegates - **localeListResolutionCallback** (LocaleListResolutionCallback?) - Optional - Locale list resolution - **localeResolutionCallback** (LocaleResolutionCallback?) - Optional - Locale resolution callback - **supportedLocales** (Iterable) - Optional - Supported locales, defaults to `[Locale('en', 'US')]` - **material** (Function(BuildContext, PlatformTarget)?) - Optional - Material-specific config callback - **cupertino** (Function(BuildContext, PlatformTarget)?) - Optional - Cupertino-specific config callback - **scaffoldMessengerKey** (GlobalKey?) - Optional - Key for ScaffoldMessenger ### Usage Example: With Router (GoRouter) ```dart void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return AdaptiveApp.router( routerConfig: GoRouter( routes: [ GoRoute( path: '/', builder: (context, state) => const HomePage(), ), ], ), title: 'My App', themeMode: ThemeMode.system, materialLightTheme: ThemeData.light(), materialDarkTheme: ThemeData.dark(), cupertinoLightTheme: const CupertinoThemeData( brightness: Brightness.light, ), cupertinoDarkTheme: const CupertinoThemeData( brightness: Brightness.dark, ), ); } } ``` ``` -------------------------------- ### AdaptiveAppBar with Actions Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/adaptive-app-bar.md Configure an AdaptiveAppBar with multiple action buttons. Each action can specify platform-specific icons and tooltips. ```dart AdaptiveAppBar( title: 'Home', actions: [ AdaptiveAppBarAction( onPressed: () { print('Search tapped'); }, iosSymbol: 'magnifyingglass', androidIcon: Icons.search, tooltip: 'Search', ), AdaptiveAppBarAction( onPressed: () { print('Settings tapped'); }, iosSymbol: 'gear', androidIcon: Icons.settings, tooltip: 'Settings', ), ], ) ``` -------------------------------- ### AdaptiveScaffold: Showing and Hiding Bottom Navigation Source: https://github.com/berkaycatak/adaptive_platform_ui/blob/main/_autodocs/errors-and-warnings.md Demonstrates how to correctly display a bottom navigation bar by providing AdaptiveBottomNavigationBar or intentionally omit it to hide the navigation. ```dart AdaptiveScaffold( appBar: AdaptiveAppBar(title: 'Home'), body: Content(), ) ``` ```dart AdaptiveScaffold( appBar: AdaptiveAppBar(title: 'Home'), bottomNavigationBar: AdaptiveBottomNavigationBar( items: [ AdaptiveNavigationDestination(icon: 'house.fill', label: 'Home'), ], selectedIndex: 0, onTap: (index) {}, ), body: Content(), ) ```