├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── assets ├── ReadMe Android Screenshot.png └── ReadMe iOS Screenshot.png ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── adaptiveActionSheet │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle.kts ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── .last_build_id │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── lib ├── adaptive_action_sheet.dart └── src │ ├── bottom_sheet_action.dart │ ├── bottom_sheet_alert.dart │ └── cancel_action.dart ├── pubspec.lock ├── pubspec.yaml └── test └── .gitkeep /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: e6b34c2b5c96bb95325269a29a84e83ed8909b5f 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.0.4 2 | * Replace willpopscope with popscope 3 | * Fixed inkwell shown behind card in Android 4 | * Update dependencies 5 | 6 | ## 2.0.3 7 | * Add `useRootNavigator` parameter (optional) to set useRootNavigator of `showCupertinoModalPopup` (Default true) and useRootNavigator of `showModalBottomSheet` (Default false) 8 | ```Dart 9 | showAdaptiveActionSheet( 10 | context: context, 11 | title: const Text('Title'), 12 | useRootNavigator: true, 13 | actions: [ 14 | BottomSheetAction(title: const Text('Item 1'), onPressed: (context) {}), 15 | BottomSheetAction(title: const Text('Item 2'), onPressed: (context) {}), 16 | BottomSheetAction(title: const Text('Item 3'), onPressed: (context) {}), 17 | ], 18 | cancelAction: CancelAction(title: const Text('Cancel')),// onPressed parameter is optional by default will dismiss the ActionSheet 19 | ); 20 | ``` 21 | * Wrap the content of `showMaterialBottomSheet` with a SafeArea 22 | 23 | ## 2.0.2 24 | * Add context to 'onPressed' for BottomSheetAction. 25 | ```Dart 26 | showAdaptiveActionSheet( 27 | context: context, 28 | title: const Text('Title'), 29 | actions: [ 30 | BottomSheetAction(title: const Text('Item 1'), onPressed: (context) {}), 31 | BottomSheetAction(title: const Text('Item 2'), onPressed: (context) {}), 32 | BottomSheetAction(title: const Text('Item 3'), onPressed: (context) {}), 33 | ], 34 | cancelAction: CancelAction(title: const Text('Cancel')),// onPressed parameter is optional by default will dismiss the ActionSheet 35 | ); 36 | ``` 37 | 38 | ## 2.0.1 39 | * Add `isDismissible` parameter that specifies whether the bottom sheet will be dismissed when user taps outside of the bottom sheet. 40 | ```Dart 41 | showAdaptiveActionSheet( 42 | context: context, 43 | isDismissible: false, 44 | actions: [ 45 | BottomSheetAction( 46 | title: const Text('Item 1'), 47 | onPressed: () {}, 48 | ), 49 | BottomSheetAction( 50 | title: const Text('Item 2'), 51 | onPressed: () {}, 52 | ), 53 | ], 54 | cancelAction: CancelAction(title: 'Cancel'), 55 | ); 56 | ``` 57 | 58 | ## 2.0.0 59 | 60 | * Migrated to null safety 61 | 62 | ## 1.1.0 63 | 64 | #### Breaking change: 65 | * Change `title` type from String to Widget 66 | 67 | 68 | 69 | 70 | 71 | 72 | 88 | 102 | 103 |
Version 1.1.0 or laterVersion 1.0.12 or earlier
73 | 74 | ```Dart 75 | BottomSheetAction( 76 | title: const Text( 77 | 'Title', 78 | style: TextStyle( 79 | fontSize: 18, 80 | fontWeight: FontWeight.w500, 81 | ), 82 | ), 83 | onPressed: () {}, 84 | leading: const Icon(Icons.add, size: 25), 85 | ), 86 | ``` 87 | 89 | 90 | ```Dart 91 | BottomSheetAction( 92 | title: 'Title', 93 | textStyle: TextStyle( 94 | fontSize: 18, 95 | fontWeight: FontWeight.w500, 96 | ), 97 | onPressed: () {}, 98 | leading: const Icon(Icons.add, size: 25), 99 | ), 100 | ``` 101 |
104 | 105 | ## 1.0.12 106 | 107 | * Fix issues when trailing or leading widget require a Material widget ancestor. 108 | 109 | ## 1.0.11 110 | 111 | * Add options for leading and trailing widget 112 | * Add options for text align 113 | ```Dart 114 | showAdaptiveActionSheet( 115 | context: context, 116 | actions: [ 117 | BottomSheetAction( 118 | title: 'Add', 119 | onPressed: () {}, 120 | leading: const Icon( 121 | Icons.add, 122 | size: 25, 123 | ), 124 | trailing: const Icon( 125 | Icons.delete, 126 | size: 25, 127 | color: Colors.red, 128 | ), 129 | textAlign: TextAlign.start, 130 | ), 131 | ], 132 | cancelAction: CancelAction(title: 'Cancel'), 133 | ); 134 | ``` 135 | 136 | ## 1.0.10 137 | 138 | * Support web platform 139 | 140 | ## 1.0.9 141 | 142 | * [Android] Fix default material background color. 143 | * [Android] Fix the padding on the top if title not set. 144 | * [iOS] Use showCupertinoModalPopup instead of showModalBottomSheet 145 | 146 | ## 1.0.8 147 | 148 | * Update documentation. 149 | 150 | ## 1.0.7 151 | * Add optional `textStyle` parameter for each action. 152 | ```Dart 153 | showAdaptiveActionSheet( 154 | context: context, 155 | actions: [ 156 | BottomSheetAction( 157 | title: 'Item 1', 158 | onPressed: () {}, 159 | textStyle: const TextStyle( 160 | fontSize: 25, 161 | color: Colors.blueAccent, 162 | ), 163 | ), 164 | BottomSheetAction(title: 'Item 2', onPressed: () {}), 165 | ], 166 | cancelAction: CancelAction(// onPressed parameter is optional by default will dismiss the ActionSheet 167 | title: 'Cancel', 168 | textStyle: const TextStyle( 169 | fontSize: 25, 170 | color: Colors.blueAccent, 171 | ), 172 | ), 173 | ); 174 | ``` 175 | 176 | ## 1.0.6 177 | 178 | * Add optional `title` parameter and will be displayed as title in the action sheet. 179 | ```Dart 180 | showAdaptiveActionSheet( 181 | context: context, 182 | title: const Text('Title'), 183 | actions: [ 184 | BottomSheetAction(title: 'Item 1', onPressed: () {}), 185 | BottomSheetAction(title: 'Item 2', onPressed: () {}), 186 | ], 187 | cancelAction: CancelAction(title: 'Cancel'),// onPressed parameter is optional by default will dismiss the ActionSheet 188 | ); 189 | ``` 190 | 191 | ## 1.0.5 192 | 193 | * Add option to customize colors via bottomSheetColor and barrierColor. 194 | 195 | ## 1.0.4 196 | 197 | * Add scroll at material bottom sheet 198 | * Fix overflow at android action sheet 199 | 200 | ## 1.0.3 201 | 202 | * Add required annotation for all the required parameters 203 | 204 | ## 1.0.2 205 | 206 | * Add options to customize cancel action. 207 | * UMake cancel action optional. 208 | 209 | ## 1.0.1 210 | 211 | * Update documentation. 212 | 213 | ## 1.0.0 214 | 215 | * Initial developers preview release. 216 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Daniel Ioannou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Adaptive action sheet 2 | 3 | [![pub package](https://img.shields.io/pub/v/adaptive_action_sheet.svg)](https://pub.dev/packages/adaptive_action_sheet) 4 | 5 | A action bottom sheet that adapts to the platform (Android/iOS). 6 | 7 | | iOS | Android | 8 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | 9 | | n1 | n2 | 10 | 11 | ## Getting Started 12 | 13 | Add the package to your pubspec.yaml: 14 | 15 | ```yaml 16 | adaptive_action_sheet: ^2.0.4 17 | ``` 18 | 19 | In your dart file, import the library: 20 | 21 | ```Dart 22 | import 'package:adaptive_action_sheet/adaptive_action_sheet.dart'; 23 | ``` 24 | 25 | Instead of using a `showModalBottomSheet` use `showAdaptiveActionSheet` Widget: 26 | 27 | ```Dart 28 | showAdaptiveActionSheet( 29 | context: context, 30 | title: const Text('Title'), 31 | androidBorderRadius: 30, 32 | actions: [ 33 | BottomSheetAction(title: const Text('Item 1'), onPressed: (context) {}), 34 | BottomSheetAction(title: const Text('Item 2'), onPressed: (context) {}), 35 | BottomSheetAction(title: const Text('Item 3'), onPressed: (context) {}), 36 | ], 37 | cancelAction: CancelAction(title: const Text('Cancel')),// onPressed parameter is optional by default will dismiss the ActionSheet 38 | ); 39 | ``` 40 | 41 | ### Parameters: 42 | 43 | #### showAdaptiveActionSheet: 44 | 45 | - `actions`: The Actions list that will appear on the ActionSheet. (required) 46 | - `cancelAction`: The optional cancel button that show under the actions (grouped separately on iOS). 47 | - `title`: The optional title widget that show above the actions. 48 | - `androidBorderRadius`: The android border radius (default: 30). 49 | - `isDismissible`: Specifies whether the bottom sheet will be dismissed when user taps outside of the bottom sheet. It is `true` by default and cannot be `null`. 50 | - `useRootNavigator`: Can be passed to set `useRootNavigator` of `showCupertinoModalPopup` (Default true) and `useRootNavigator` of `showModalBottomSheet` (Default false) 51 | - The optional `backgroundColor` and `barrierColor` can be passed in to customize the appearance and behavior of persistent material bottom sheets(Android only). 52 | 53 | #### BottomSheetAction: 54 | 55 | - `title`: The primary content of the action sheet item. (required) 56 | - `onPressed`: The callback that is called when the action item is tapped. (required) 57 | - `leading`: A widget to display before the title. Typically an Icon widget. (optional) 58 | - `trailing`: A widget to display after the title. Typically an Icon or a CircleAvatar widget. (optional) 59 | 60 | #### CancelAction: 61 | 62 | - `title`: The primary content of the cancel action sheet item. (required) 63 | - `onPressed`: The callback that is called when the action item is tapped. `onPressed` is optional by default will dismiss the Action Sheet. 64 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lint/analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | avoid_print: false 6 | overridden_fields: false 7 | prefer_initializing_formals: false 8 | avoid_escaping_inner_quotes: false 9 | avoid_classes_with_only_static_members: false 10 | always_use_package_imports: false 11 | 12 | 13 | analyzer: 14 | errors: 15 | missing_required_param: error -------------------------------------------------------------------------------- /assets/ReadMe Android Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/assets/ReadMe Android Screenshot.png -------------------------------------------------------------------------------- /assets/ReadMe iOS Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/assets/ReadMe iOS Screenshot.png -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .flutter-plugins-dependencies 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | /build/ 30 | 31 | # Web related 32 | lib/generated_plugin_registrant.dart 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Exceptions to above rules. 41 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 42 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 17 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 18 | - platform: android 19 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 20 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Adaptive action sheet 2 | 3 | [![pub package](https://img.shields.io/pub/v/adaptive_action_sheet.svg)](https://pub.dev/packages/adaptive_action_sheet) 4 | 5 | A action bottom sheet that adapts to the platform (Android/iOS). 6 | 7 | | iOS | Android | 8 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | 9 | | n1 | n2 | 10 | 11 | ## Getting Started 12 | 13 | Add the package to your pubspec.yaml: 14 | 15 | ```yaml 16 | adaptive_action_sheet: ^2.0.4 17 | ``` 18 | 19 | In your dart file, import the library: 20 | 21 | ```Dart 22 | import 'package:adaptive_action_sheet/adaptive_action_sheet.dart'; 23 | ``` 24 | 25 | Instead of using a `showModalBottomSheet` use `showAdaptiveActionSheet` Widget: 26 | 27 | ```Dart 28 | showAdaptiveActionSheet( 29 | context: context, 30 | title: const Text('Title'), 31 | androidBorderRadius: 30, 32 | actions: [ 33 | BottomSheetAction(title: const Text('Item 1'), onPressed: (context) {}), 34 | BottomSheetAction(title: const Text('Item 2'), onPressed: (context) {}), 35 | BottomSheetAction(title: const Text('Item 3'), onPressed: (context) {}), 36 | ], 37 | cancelAction: CancelAction(title: const Text('Cancel')),// onPressed parameter is optional by default will dismiss the ActionSheet 38 | ); 39 | ``` 40 | 41 | ### Parameters: 42 | 43 | #### showAdaptiveActionSheet: 44 | 45 | - `actions`: The Actions list that will appear on the ActionSheet. (required) 46 | - `cancelAction`: The optional cancel button that show under the actions (grouped separately on iOS). 47 | - `title`: The optional title widget that show above the actions. 48 | - `androidBorderRadius`: The android border radius (default: 30). 49 | - `isDismissible`: Specifies whether the bottom sheet will be dismissed when user taps outside of the bottom sheet. It is `true` by default and cannot be `null`. 50 | - `useRootNavigator`: Can be passed to set `useRootNavigator` of `showCupertinoModalPopup` (Default true) and `useRootNavigator` of `showModalBottomSheet` (Default false) 51 | - The optional `backgroundColor` and `barrierColor` can be passed in to customize the appearance and behavior of persistent material bottom sheets(Android only). 52 | 53 | #### BottomSheetAction: 54 | 55 | - `title`: The primary content of the action sheet item. (required) 56 | - `onPressed`: The callback that is called when the action item is tapped. (required) 57 | - `leading`: A widget to display before the title. Typically an Icon widget. (optional) 58 | - `trailing`: A widget to display after the title. Typically an Icon or a CircleAvatar widget. (optional) 59 | 60 | #### CancelAction: 61 | 62 | - `title`: The primary content of the cancel action sheet item. (required) 63 | - `onPressed`: The callback that is called when the action item is tapped. `onPressed` is optional by default will dismiss the Action Sheet. 64 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lint/analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | avoid_print: false 6 | avoid_escaping_inner_quotes: false 7 | avoid_classes_with_only_static_members: false 8 | 9 | analyzer: 10 | errors: 11 | missing_required_param: error -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | .cxx/ 9 | 10 | # Remember to never publicly share your keystore. 11 | # See https://flutter.dev/to/reference-keystore 12 | key.properties 13 | **/*.keystore 14 | **/*.jks 15 | -------------------------------------------------------------------------------- /example/android/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | id("kotlin-android") 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id("dev.flutter.flutter-gradle-plugin") 6 | } 7 | 8 | android { 9 | namespace = "com.adaptiveActionSheet.example" 10 | compileSdk = flutter.compileSdkVersion 11 | ndkVersion = flutter.ndkVersion 12 | 13 | compileOptions { 14 | sourceCompatibility = JavaVersion.VERSION_11 15 | targetCompatibility = JavaVersion.VERSION_11 16 | } 17 | 18 | kotlinOptions { 19 | jvmTarget = JavaVersion.VERSION_11.toString() 20 | } 21 | 22 | defaultConfig { 23 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 24 | applicationId = "com.adaptiveActionSheet.example" 25 | // You can update the following values to match your application needs. 26 | // For more information, see: https://flutter.dev/to/review-gradle-config. 27 | minSdk = flutter.minSdkVersion 28 | targetSdk = flutter.targetSdkVersion 29 | versionCode = flutter.versionCode 30 | versionName = flutter.versionName 31 | } 32 | 33 | buildTypes { 34 | release { 35 | // TODO: Add your own signing config for the release build. 36 | // Signing with the debug keys for now, so `flutter run --release` works. 37 | signingConfig = signingConfigs.getByName("debug") 38 | } 39 | } 40 | } 41 | 42 | flutter { 43 | source = "../.." 44 | } 45 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/adaptiveActionSheet/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.adaptiveActionSheet.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity : FlutterActivity() 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() 9 | rootProject.layout.buildDirectory.value(newBuildDir) 10 | 11 | subprojects { 12 | val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) 13 | project.layout.buildDirectory.value(newSubprojectBuildDir) 14 | } 15 | subprojects { 16 | project.evaluationDependsOn(":app") 17 | } 18 | 19 | tasks.register("clean") { 20 | delete(rootProject.layout.buildDirectory) 21 | } 22 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip 6 | -------------------------------------------------------------------------------- /example/android/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | val flutterSdkPath = run { 3 | val properties = java.util.Properties() 4 | file("local.properties").inputStream().use { properties.load(it) } 5 | val flutterSdkPath = properties.getProperty("flutter.sdk") 6 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } 7 | flutterSdkPath 8 | } 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id("dev.flutter.flutter-plugin-loader") version "1.0.0" 21 | id("com.android.application") version "8.7.0" apply false 22 | id("org.jetbrains.kotlin.android") version "1.8.22" apply false 23 | } 24 | 25 | include(":app") 26 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | e31fe0763c8fbf18d1276815f6e72267 -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 97C146F11CF9000F007C117D /* Supporting Files */, 94 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 95 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 96 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 97 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 98 | ); 99 | path = Runner; 100 | sourceTree = ""; 101 | }; 102 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | /* End PBXGroup section */ 110 | 111 | /* Begin PBXNativeTarget section */ 112 | 97C146ED1CF9000F007C117D /* Runner */ = { 113 | isa = PBXNativeTarget; 114 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 115 | buildPhases = ( 116 | 9740EEB61CF901F6004384FC /* Run Script */, 117 | 97C146EA1CF9000F007C117D /* Sources */, 118 | 97C146EB1CF9000F007C117D /* Frameworks */, 119 | 97C146EC1CF9000F007C117D /* Resources */, 120 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 121 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = Runner; 128 | productName = Runner; 129 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | 97C146E61CF9000F007C117D /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastUpgradeCheck = 1510; 139 | ORGANIZATIONNAME = ""; 140 | TargetAttributes = { 141 | 97C146ED1CF9000F007C117D = { 142 | CreatedOnToolsVersion = 7.3.1; 143 | LastSwiftMigration = 1100; 144 | }; 145 | }; 146 | }; 147 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 148 | compatibilityVersion = "Xcode 9.3"; 149 | developmentRegion = en; 150 | hasScannedForEncodings = 0; 151 | knownRegions = ( 152 | en, 153 | Base, 154 | ); 155 | mainGroup = 97C146E51CF9000F007C117D; 156 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 157 | projectDirPath = ""; 158 | projectRoot = ""; 159 | targets = ( 160 | 97C146ED1CF9000F007C117D /* Runner */, 161 | ); 162 | }; 163 | /* End PBXProject section */ 164 | 165 | /* Begin PBXResourcesBuildPhase section */ 166 | 97C146EC1CF9000F007C117D /* Resources */ = { 167 | isa = PBXResourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 171 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 172 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 173 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXResourcesBuildPhase section */ 178 | 179 | /* Begin PBXShellScriptBuildPhase section */ 180 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 181 | isa = PBXShellScriptBuildPhase; 182 | alwaysOutOfDate = 1; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | ); 186 | inputPaths = ( 187 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 188 | ); 189 | name = "Thin Binary"; 190 | outputPaths = ( 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | shellPath = /bin/sh; 194 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 195 | }; 196 | 9740EEB61CF901F6004384FC /* Run Script */ = { 197 | isa = PBXShellScriptBuildPhase; 198 | alwaysOutOfDate = 1; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Run Script"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 210 | }; 211 | /* End PBXShellScriptBuildPhase section */ 212 | 213 | /* Begin PBXSourcesBuildPhase section */ 214 | 97C146EA1CF9000F007C117D /* Sources */ = { 215 | isa = PBXSourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 219 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXSourcesBuildPhase section */ 224 | 225 | /* Begin PBXVariantGroup section */ 226 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 227 | isa = PBXVariantGroup; 228 | children = ( 229 | 97C146FB1CF9000F007C117D /* Base */, 230 | ); 231 | name = Main.storyboard; 232 | sourceTree = ""; 233 | }; 234 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 235 | isa = PBXVariantGroup; 236 | children = ( 237 | 97C147001CF9000F007C117D /* Base */, 238 | ); 239 | name = LaunchScreen.storyboard; 240 | sourceTree = ""; 241 | }; 242 | /* End PBXVariantGroup section */ 243 | 244 | /* Begin XCBuildConfiguration section */ 245 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_ANALYZER_NONNULL = YES; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 255 | CLANG_WARN_BOOL_CONVERSION = YES; 256 | CLANG_WARN_COMMA = YES; 257 | CLANG_WARN_CONSTANT_CONVERSION = YES; 258 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 259 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INFINITE_RECURSION = YES; 263 | CLANG_WARN_INT_CONVERSION = YES; 264 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 265 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 266 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 268 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 269 | CLANG_WARN_STRICT_PROTOTYPES = YES; 270 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 271 | CLANG_WARN_UNREACHABLE_CODE = YES; 272 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 273 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 274 | COPY_PHASE_STRIP = NO; 275 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 276 | ENABLE_NS_ASSERTIONS = NO; 277 | ENABLE_STRICT_OBJC_MSGSEND = YES; 278 | GCC_C_LANGUAGE_STANDARD = gnu99; 279 | GCC_NO_COMMON_BLOCKS = YES; 280 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 281 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 282 | GCC_WARN_UNDECLARED_SELECTOR = YES; 283 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 284 | GCC_WARN_UNUSED_FUNCTION = YES; 285 | GCC_WARN_UNUSED_VARIABLE = YES; 286 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 287 | MTL_ENABLE_DEBUG_INFO = NO; 288 | SDKROOT = iphoneos; 289 | SUPPORTED_PLATFORMS = iphoneos; 290 | TARGETED_DEVICE_FAMILY = "1,2"; 291 | VALIDATE_PRODUCT = YES; 292 | }; 293 | name = Profile; 294 | }; 295 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 296 | isa = XCBuildConfiguration; 297 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 298 | buildSettings = { 299 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 300 | CLANG_ENABLE_MODULES = YES; 301 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 302 | ENABLE_BITCODE = NO; 303 | FRAMEWORK_SEARCH_PATHS = ( 304 | "$(inherited)", 305 | "$(PROJECT_DIR)/Flutter", 306 | ); 307 | INFOPLIST_FILE = Runner/Info.plist; 308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 309 | LIBRARY_SEARCH_PATHS = ( 310 | "$(inherited)", 311 | "$(PROJECT_DIR)/Flutter", 312 | ); 313 | PRODUCT_BUNDLE_IDENTIFIER = com.adaptiveActionSheet.example; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 316 | SWIFT_VERSION = 5.0; 317 | VERSIONING_SYSTEM = "apple-generic"; 318 | }; 319 | name = Profile; 320 | }; 321 | 97C147031CF9000F007C117D /* Debug */ = { 322 | isa = XCBuildConfiguration; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 335 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 336 | CLANG_WARN_EMPTY_BODY = YES; 337 | CLANG_WARN_ENUM_CONVERSION = YES; 338 | CLANG_WARN_INFINITE_RECURSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 342 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 345 | CLANG_WARN_STRICT_PROTOTYPES = YES; 346 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 350 | COPY_PHASE_STRIP = NO; 351 | DEBUG_INFORMATION_FORMAT = dwarf; 352 | ENABLE_STRICT_OBJC_MSGSEND = YES; 353 | ENABLE_TESTABILITY = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_DYNAMIC_NO_PIC = NO; 356 | GCC_NO_COMMON_BLOCKS = YES; 357 | GCC_OPTIMIZATION_LEVEL = 0; 358 | GCC_PREPROCESSOR_DEFINITIONS = ( 359 | "DEBUG=1", 360 | "$(inherited)", 361 | ); 362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | GCC_WARN_UNUSED_VARIABLE = YES; 368 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 369 | MTL_ENABLE_DEBUG_INFO = YES; 370 | ONLY_ACTIVE_ARCH = YES; 371 | SDKROOT = iphoneos; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | 97C147041CF9000F007C117D /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 382 | CLANG_CXX_LIBRARY = "libc++"; 383 | CLANG_ENABLE_MODULES = YES; 384 | CLANG_ENABLE_OBJC_ARC = YES; 385 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_COMMA = YES; 388 | CLANG_WARN_CONSTANT_CONVERSION = YES; 389 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 391 | CLANG_WARN_EMPTY_BODY = YES; 392 | CLANG_WARN_ENUM_CONVERSION = YES; 393 | CLANG_WARN_INFINITE_RECURSION = YES; 394 | CLANG_WARN_INT_CONVERSION = YES; 395 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 400 | CLANG_WARN_STRICT_PROTOTYPES = YES; 401 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = NO; 406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 407 | ENABLE_NS_ASSERTIONS = NO; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_NO_COMMON_BLOCKS = YES; 411 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 412 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 413 | GCC_WARN_UNDECLARED_SELECTOR = YES; 414 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 415 | GCC_WARN_UNUSED_FUNCTION = YES; 416 | GCC_WARN_UNUSED_VARIABLE = YES; 417 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 418 | MTL_ENABLE_DEBUG_INFO = NO; 419 | SDKROOT = iphoneos; 420 | SUPPORTED_PLATFORMS = iphoneos; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 422 | TARGETED_DEVICE_FAMILY = "1,2"; 423 | VALIDATE_PRODUCT = YES; 424 | }; 425 | name = Release; 426 | }; 427 | 97C147061CF9000F007C117D /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | FRAMEWORK_SEARCH_PATHS = ( 436 | "$(inherited)", 437 | "$(PROJECT_DIR)/Flutter", 438 | ); 439 | INFOPLIST_FILE = Runner/Info.plist; 440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 441 | LIBRARY_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | PRODUCT_BUNDLE_IDENTIFIER = com.adaptiveActionSheet.example; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 448 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 449 | SWIFT_VERSION = 5.0; 450 | VERSIONING_SYSTEM = "apple-generic"; 451 | }; 452 | name = Debug; 453 | }; 454 | 97C147071CF9000F007C117D /* Release */ = { 455 | isa = XCBuildConfiguration; 456 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 457 | buildSettings = { 458 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 459 | CLANG_ENABLE_MODULES = YES; 460 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 461 | ENABLE_BITCODE = NO; 462 | FRAMEWORK_SEARCH_PATHS = ( 463 | "$(inherited)", 464 | "$(PROJECT_DIR)/Flutter", 465 | ); 466 | INFOPLIST_FILE = Runner/Info.plist; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 468 | LIBRARY_SEARCH_PATHS = ( 469 | "$(inherited)", 470 | "$(PROJECT_DIR)/Flutter", 471 | ); 472 | PRODUCT_BUNDLE_IDENTIFIER = com.adaptiveActionSheet.example; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 475 | SWIFT_VERSION = 5.0; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 55 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 74 | 76 | 82 | 83 | 84 | 85 | 87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @main 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "size": "20x20", 5 | "idiom": "iphone", 6 | "filename": "Icon-App-20x20@2x.png", 7 | "scale": "2x" 8 | }, 9 | { 10 | "size": "20x20", 11 | "idiom": "iphone", 12 | "filename": "Icon-App-20x20@3x.png", 13 | "scale": "3x" 14 | }, 15 | { 16 | "size": "29x29", 17 | "idiom": "iphone", 18 | "filename": "Icon-App-29x29@1x.png", 19 | "scale": "1x" 20 | }, 21 | { 22 | "size": "29x29", 23 | "idiom": "iphone", 24 | "filename": "Icon-App-29x29@2x.png", 25 | "scale": "2x" 26 | }, 27 | { 28 | "size": "29x29", 29 | "idiom": "iphone", 30 | "filename": "Icon-App-29x29@3x.png", 31 | "scale": "3x" 32 | }, 33 | { 34 | "size": "40x40", 35 | "idiom": "iphone", 36 | "filename": "Icon-App-40x40@2x.png", 37 | "scale": "2x" 38 | }, 39 | { 40 | "size": "40x40", 41 | "idiom": "iphone", 42 | "filename": "Icon-App-40x40@3x.png", 43 | "scale": "3x" 44 | }, 45 | { 46 | "size": "60x60", 47 | "idiom": "iphone", 48 | "filename": "Icon-App-60x60@2x.png", 49 | "scale": "2x" 50 | }, 51 | { 52 | "size": "60x60", 53 | "idiom": "iphone", 54 | "filename": "Icon-App-60x60@3x.png", 55 | "scale": "3x" 56 | }, 57 | { 58 | "size": "20x20", 59 | "idiom": "ipad", 60 | "filename": "Icon-App-20x20@1x.png", 61 | "scale": "1x" 62 | }, 63 | { 64 | "size": "20x20", 65 | "idiom": "ipad", 66 | "filename": "Icon-App-20x20@2x.png", 67 | "scale": "2x" 68 | }, 69 | { 70 | "size": "29x29", 71 | "idiom": "ipad", 72 | "filename": "Icon-App-29x29@1x.png", 73 | "scale": "1x" 74 | }, 75 | { 76 | "size": "29x29", 77 | "idiom": "ipad", 78 | "filename": "Icon-App-29x29@2x.png", 79 | "scale": "2x" 80 | }, 81 | { 82 | "size": "40x40", 83 | "idiom": "ipad", 84 | "filename": "Icon-App-40x40@1x.png", 85 | "scale": "1x" 86 | }, 87 | { 88 | "size": "40x40", 89 | "idiom": "ipad", 90 | "filename": "Icon-App-40x40@2x.png", 91 | "scale": "2x" 92 | }, 93 | { 94 | "size": "76x76", 95 | "idiom": "ipad", 96 | "filename": "Icon-App-76x76@1x.png", 97 | "scale": "1x" 98 | }, 99 | { 100 | "size": "76x76", 101 | "idiom": "ipad", 102 | "filename": "Icon-App-76x76@2x.png", 103 | "scale": "2x" 104 | }, 105 | { 106 | "size": "83.5x83.5", 107 | "idiom": "ipad", 108 | "filename": "Icon-App-83.5x83.5@2x.png", 109 | "scale": "2x" 110 | }, 111 | { 112 | "size": "1024x1024", 113 | "idiom": "ios-marketing", 114 | "filename": "Icon-App-1024x1024@1x.png", 115 | "scale": "1x" 116 | } 117 | ], 118 | "info": { 119 | "version": 1, 120 | "author": "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "LaunchImage.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "filename": "LaunchImage@2x.png", 11 | "scale": "2x" 12 | }, 13 | { 14 | "idiom": "universal", 15 | "filename": "LaunchImage@3x.png", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "version": 1, 21 | "author": "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:adaptive_action_sheet/adaptive_action_sheet.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | void main() { 5 | runApp(MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | title: 'Adaptive action sheet Demo', 13 | theme: ThemeData( 14 | primarySwatch: Colors.blue, 15 | visualDensity: VisualDensity.adaptivePlatformDensity, 16 | ), 17 | home: const MyHomePage(), 18 | ); 19 | } 20 | } 21 | 22 | class MyHomePage extends StatefulWidget { 23 | const MyHomePage({Key? key}) : super(key: key); 24 | 25 | @override 26 | _MyHomePageState createState() => _MyHomePageState(); 27 | } 28 | 29 | class _MyHomePageState extends State { 30 | @override 31 | Widget build(BuildContext context) { 32 | return Scaffold( 33 | appBar: AppBar( 34 | title: const Text('Adaptive action sheet example'), 35 | ), 36 | body: Center( 37 | child: Column( 38 | mainAxisAlignment: MainAxisAlignment.center, 39 | children: [ 40 | ElevatedButton( 41 | onPressed: () { 42 | showAdaptiveActionSheet( 43 | context: context, 44 | actions: [ 45 | BottomSheetAction( 46 | title: const Text('Item 1'), 47 | onPressed: (_) {}, 48 | ), 49 | BottomSheetAction( 50 | title: const Text('Item 2'), 51 | onPressed: (_) {}, 52 | ), 53 | BottomSheetAction( 54 | title: const Text('Item 3'), 55 | onPressed: (_) {}, 56 | ), 57 | ], 58 | cancelAction: CancelAction(title: const Text('Cancel')), 59 | ); 60 | }, 61 | child: const Text('Show action sheet'), 62 | ), 63 | ElevatedButton( 64 | onPressed: () { 65 | showAdaptiveActionSheet( 66 | context: context, 67 | title: const Text('This is the title'), 68 | actions: [ 69 | BottomSheetAction( 70 | title: const Text('Item 1'), 71 | onPressed: (_) {}, 72 | ), 73 | BottomSheetAction( 74 | title: const Text('Item 2'), 75 | onPressed: (_) {}, 76 | ), 77 | BottomSheetAction( 78 | title: const Text('Item 3'), 79 | onPressed: (_) {}, 80 | ), 81 | ], 82 | cancelAction: CancelAction(title: const Text('Cancel')), 83 | ); 84 | }, 85 | child: const Text('Show action sheet with title'), 86 | ), 87 | ElevatedButton( 88 | onPressed: () { 89 | showAdaptiveActionSheet( 90 | context: context, 91 | actions: [ 92 | BottomSheetAction( 93 | title: const Text( 94 | 'Add', 95 | style: TextStyle( 96 | fontSize: 18, 97 | fontWeight: FontWeight.w500, 98 | ), 99 | ), 100 | onPressed: (_) {}, 101 | leading: const Icon(Icons.add, size: 25), 102 | ), 103 | BottomSheetAction( 104 | title: const Text( 105 | 'Delete', 106 | style: TextStyle( 107 | fontSize: 18, 108 | fontWeight: FontWeight.w500, 109 | color: Colors.red, 110 | ), 111 | ), 112 | onPressed: (_) {}, 113 | leading: const Icon( 114 | Icons.delete, 115 | size: 25, 116 | color: Colors.red, 117 | ), 118 | ), 119 | ], 120 | cancelAction: CancelAction(title: const Text('Cancel')), 121 | ); 122 | }, 123 | child: const Text('Show action sheet with icons'), 124 | ), 125 | ], 126 | ), 127 | ), 128 | ); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | adaptive_action_sheet: 5 | dependency: "direct main" 6 | description: 7 | path: ".." 8 | relative: true 9 | source: path 10 | version: "2.0.4" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 16 | url: "https://pub.dev" 17 | source: hosted 18 | version: "2.12.0" 19 | boolean_selector: 20 | dependency: transitive 21 | description: 22 | name: boolean_selector 23 | sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" 24 | url: "https://pub.dev" 25 | source: hosted 26 | version: "2.1.2" 27 | characters: 28 | dependency: transitive 29 | description: 30 | name: characters 31 | sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 32 | url: "https://pub.dev" 33 | source: hosted 34 | version: "1.4.0" 35 | clock: 36 | dependency: transitive 37 | description: 38 | name: clock 39 | sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b 40 | url: "https://pub.dev" 41 | source: hosted 42 | version: "1.1.2" 43 | collection: 44 | dependency: transitive 45 | description: 46 | name: collection 47 | sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" 48 | url: "https://pub.dev" 49 | source: hosted 50 | version: "1.19.1" 51 | fake_async: 52 | dependency: transitive 53 | description: 54 | name: fake_async 55 | sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" 56 | url: "https://pub.dev" 57 | source: hosted 58 | version: "1.3.2" 59 | flutter: 60 | dependency: "direct main" 61 | description: flutter 62 | source: sdk 63 | version: "0.0.0" 64 | flutter_test: 65 | dependency: "direct dev" 66 | description: flutter 67 | source: sdk 68 | version: "0.0.0" 69 | leak_tracker: 70 | dependency: transitive 71 | description: 72 | name: leak_tracker 73 | sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec 74 | url: "https://pub.dev" 75 | source: hosted 76 | version: "10.0.8" 77 | leak_tracker_flutter_testing: 78 | dependency: transitive 79 | description: 80 | name: leak_tracker_flutter_testing 81 | sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 82 | url: "https://pub.dev" 83 | source: hosted 84 | version: "3.0.9" 85 | leak_tracker_testing: 86 | dependency: transitive 87 | description: 88 | name: leak_tracker_testing 89 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "3.0.1" 93 | lint: 94 | dependency: "direct dev" 95 | description: 96 | name: lint 97 | sha256: be34dd7a16e94506dc786be82358e33162f4feba17a976431d36663df3feebe2 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "1.5.3" 101 | matcher: 102 | dependency: transitive 103 | description: 104 | name: matcher 105 | sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "0.12.17" 109 | material_color_utilities: 110 | dependency: transitive 111 | description: 112 | name: material_color_utilities 113 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "0.11.1" 117 | meta: 118 | dependency: transitive 119 | description: 120 | name: meta 121 | sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c 122 | url: "https://pub.dev" 123 | source: hosted 124 | version: "1.16.0" 125 | path: 126 | dependency: transitive 127 | description: 128 | name: path 129 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" 130 | url: "https://pub.dev" 131 | source: hosted 132 | version: "1.9.1" 133 | sky_engine: 134 | dependency: transitive 135 | description: flutter 136 | source: sdk 137 | version: "0.0.0" 138 | source_span: 139 | dependency: transitive 140 | description: 141 | name: source_span 142 | sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "1.10.1" 146 | stack_trace: 147 | dependency: transitive 148 | description: 149 | name: stack_trace 150 | sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.12.1" 154 | stream_channel: 155 | dependency: transitive 156 | description: 157 | name: stream_channel 158 | sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "2.1.4" 162 | string_scanner: 163 | dependency: transitive 164 | description: 165 | name: string_scanner 166 | sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.4.1" 170 | term_glyph: 171 | dependency: transitive 172 | description: 173 | name: term_glyph 174 | sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "1.2.2" 178 | test_api: 179 | dependency: transitive 180 | description: 181 | name: test_api 182 | sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "0.7.4" 186 | vector_math: 187 | dependency: transitive 188 | description: 189 | name: vector_math 190 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "2.1.4" 194 | vm_service: 195 | dependency: transitive 196 | description: 197 | name: vm_service 198 | sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "14.3.1" 202 | sdks: 203 | dart: ">=3.7.0-0 <4.0.0" 204 | flutter: ">=3.18.0-18.0.pre.54" 205 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A example application for adaptive action sheet. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | version: 1.0.0+1 9 | 10 | environment: 11 | sdk: '>=2.12.0 <3.0.0' 12 | 13 | dependencies: 14 | adaptive_action_sheet: 15 | path: ../ 16 | flutter: 17 | sdk: flutter 18 | 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | lint: ^1.5.3 24 | 25 | flutter: 26 | uses-material-design: true -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:example/main.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_test/flutter_test.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(MyApp()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /lib/adaptive_action_sheet.dart: -------------------------------------------------------------------------------- 1 | library adaptive_action_sheet; 2 | 3 | export 'src/bottom_sheet_action.dart'; 4 | export 'src/bottom_sheet_alert.dart'; 5 | export 'src/cancel_action.dart'; 6 | -------------------------------------------------------------------------------- /lib/src/bottom_sheet_action.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// The Actions model that will use on the ActionSheet. 4 | class BottomSheetAction { 5 | /// The primary content of the action sheet. 6 | /// 7 | /// Typically a [Text] widget. 8 | /// 9 | /// This should not wrap. To enforce the single line limit, use 10 | /// [Text.maxLines]. 11 | final Widget title; 12 | 13 | /// The callback that is called when the action item is tapped. (required) 14 | final void Function(BuildContext context) onPressed; 15 | 16 | /// A widget to display after the title. 17 | /// 18 | /// Typically an [Icon] widget. 19 | final Widget? trailing; 20 | 21 | /// A widget to display before the title. 22 | /// 23 | /// Typically an [Icon] or a [CircleAvatar] widget. 24 | final Widget? leading; 25 | 26 | BottomSheetAction({ 27 | required this.title, 28 | required this.onPressed, 29 | this.trailing, 30 | this.leading, 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/bottom_sheet_alert.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io' show Platform; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import 'bottom_sheet_action.dart'; 7 | import 'cancel_action.dart'; 8 | 9 | /// A action bottom sheet that adapts to the platform (Android/iOS). 10 | /// 11 | /// [actions] The Actions list that will appear on the ActionSheet. (required) 12 | /// 13 | /// [cancelAction] The optional cancel button that show under the 14 | /// actions (grouped separately on iOS). 15 | /// 16 | /// [title] The optional title widget that show above the actions. 17 | /// 18 | /// [androidBorderRadius] The android border radius. 19 | /// 20 | /// The optional [backgroundColor] and [barrierColor] can be passed in to 21 | /// customize the appearance and behavior of persistent bottom sheets. 22 | /// 23 | /// The optional [isDismissible] can be passed to set barrierDismissible of showCupertinoModalPopup 24 | /// and isDismissible of showModalBottomSheet (Default true as for both implementations) 25 | /// 26 | /// The optional [useRootNavigator] can be passed to set useRootNavigator of showCupertinoModalPopup 27 | /// (Default true) and useRootNavigator of showModalBottomSheet (Default false) 28 | Future showAdaptiveActionSheet({ 29 | required BuildContext context, 30 | Widget? title, 31 | required List actions, 32 | CancelAction? cancelAction, 33 | Color? barrierColor, 34 | Color? bottomSheetColor, 35 | double? androidBorderRadius, 36 | bool isDismissible = true, 37 | bool? useRootNavigator, 38 | }) async { 39 | assert( 40 | barrierColor != Colors.transparent, 41 | 'The barrier color cannot be transparent.', 42 | ); 43 | 44 | return _show( 45 | context, 46 | title, 47 | actions, 48 | cancelAction, 49 | barrierColor, 50 | bottomSheetColor, 51 | androidBorderRadius, 52 | isDismissible: isDismissible, 53 | useRootNavigator: useRootNavigator, 54 | ); 55 | } 56 | 57 | Future _show( 58 | BuildContext context, 59 | Widget? title, 60 | List actions, 61 | CancelAction? cancelAction, 62 | Color? barrierColor, 63 | Color? bottomSheetColor, 64 | double? androidBorderRadius, { 65 | bool isDismissible = true, 66 | bool? useRootNavigator, 67 | }) { 68 | if (Platform.isIOS) { 69 | return _showCupertinoBottomSheet( 70 | context, 71 | title, 72 | actions, 73 | cancelAction, 74 | isDismissible: isDismissible, 75 | useRootNavigator: useRootNavigator, 76 | ); 77 | } else { 78 | return _showMaterialBottomSheet( 79 | context, 80 | title, 81 | actions, 82 | cancelAction, 83 | barrierColor, 84 | bottomSheetColor, 85 | androidBorderRadius, 86 | isDismissible: isDismissible, 87 | useRootNavigator: useRootNavigator, 88 | ); 89 | } 90 | } 91 | 92 | Future _showCupertinoBottomSheet( 93 | BuildContext context, 94 | Widget? title, 95 | List actions, 96 | CancelAction? cancelAction, { 97 | bool isDismissible = true, 98 | bool? useRootNavigator, 99 | }) { 100 | final defaultTextStyle = 101 | Theme.of(context).textTheme.titleLarge ?? const TextStyle(fontSize: 20); 102 | return showCupertinoModalPopup( 103 | context: context, 104 | barrierDismissible: isDismissible, 105 | useRootNavigator: useRootNavigator ?? true, 106 | builder: (BuildContext coxt) { 107 | return CupertinoActionSheet( 108 | title: title, 109 | actions: actions.map((action) { 110 | /// Modal Popup doesn't inherited material widget 111 | /// so need to provide one in case trailing or 112 | /// leading widget require a Material widget ancestor. 113 | return Material( 114 | color: Colors.transparent, 115 | child: CupertinoActionSheetAction( 116 | onPressed: () => action.onPressed(coxt), 117 | child: Row( 118 | children: [ 119 | if (action.leading != null) ...[ 120 | action.leading!, 121 | const SizedBox(width: 15), 122 | ], 123 | Expanded( 124 | child: DefaultTextStyle( 125 | style: defaultTextStyle, 126 | textAlign: action.leading != null 127 | ? TextAlign.start 128 | : TextAlign.center, 129 | child: action.title, 130 | ), 131 | ), 132 | if (action.trailing != null) ...[ 133 | const SizedBox(width: 10), 134 | action.trailing!, 135 | ], 136 | ], 137 | ), 138 | ), 139 | ); 140 | }).toList(), 141 | cancelButton: cancelAction != null 142 | ? CupertinoActionSheetAction( 143 | onPressed: () { 144 | if (cancelAction.onPressed != null) { 145 | cancelAction.onPressed!(coxt); 146 | } else { 147 | Navigator.of(coxt).pop(); 148 | } 149 | }, 150 | child: DefaultTextStyle( 151 | style: defaultTextStyle.copyWith(color: Colors.lightBlue), 152 | textAlign: TextAlign.center, 153 | child: cancelAction.title, 154 | ), 155 | ) 156 | : null, 157 | ); 158 | }, 159 | ); 160 | } 161 | 162 | Future _showMaterialBottomSheet( 163 | BuildContext context, 164 | Widget? title, 165 | List actions, 166 | CancelAction? cancelAction, 167 | Color? barrierColor, 168 | Color? bottomSheetColor, 169 | double? androidBorderRadius, { 170 | bool isDismissible = true, 171 | bool? useRootNavigator, 172 | }) { 173 | final defaultTextStyle = 174 | Theme.of(context).textTheme.titleLarge ?? const TextStyle(fontSize: 20); 175 | final BottomSheetThemeData sheetTheme = Theme.of(context).bottomSheetTheme; 176 | return showModalBottomSheet( 177 | context: context, 178 | elevation: 0, 179 | clipBehavior: Clip.antiAliasWithSaveLayer, 180 | isDismissible: isDismissible, 181 | enableDrag: isDismissible, 182 | isScrollControlled: true, 183 | backgroundColor: bottomSheetColor ?? 184 | sheetTheme.modalBackgroundColor ?? 185 | sheetTheme.backgroundColor, 186 | barrierColor: barrierColor, 187 | shape: RoundedRectangleBorder( 188 | borderRadius: BorderRadius.only( 189 | topLeft: Radius.circular(androidBorderRadius ?? 30), 190 | topRight: Radius.circular(androidBorderRadius ?? 30), 191 | ), 192 | ), 193 | useRootNavigator: useRootNavigator ?? false, 194 | builder: (BuildContext coxt) { 195 | final double screenHeight = MediaQuery.of(context).size.height; 196 | return SafeArea( 197 | child: PopScope( 198 | canPop: isDismissible, 199 | child: ConstrainedBox( 200 | constraints: BoxConstraints( 201 | maxHeight: screenHeight - (screenHeight / 10), 202 | ), 203 | child: SingleChildScrollView( 204 | child: Column( 205 | crossAxisAlignment: CrossAxisAlignment.stretch, 206 | mainAxisSize: MainAxisSize.min, 207 | children: [ 208 | if (title != null) ...[ 209 | Padding( 210 | padding: const EdgeInsets.all(16.0), 211 | child: Center(child: title), 212 | ), 213 | ], 214 | ...actions.map((action) { 215 | return InkWell( 216 | onTap: () => action.onPressed(coxt), 217 | child: Padding( 218 | padding: const EdgeInsets.all(16.0), 219 | child: Row( 220 | children: [ 221 | if (action.leading != null) ...[ 222 | action.leading!, 223 | const SizedBox(width: 15), 224 | ], 225 | Expanded( 226 | child: DefaultTextStyle( 227 | style: defaultTextStyle, 228 | textAlign: action.leading != null 229 | ? TextAlign.start 230 | : TextAlign.center, 231 | child: action.title, 232 | ), 233 | ), 234 | if (action.trailing != null) ...[ 235 | const SizedBox(width: 10), 236 | action.trailing!, 237 | ], 238 | ], 239 | ), 240 | ), 241 | ); 242 | }), 243 | if (cancelAction != null) 244 | InkWell( 245 | onTap: () { 246 | if (cancelAction.onPressed != null) { 247 | cancelAction.onPressed!(coxt); 248 | } else { 249 | Navigator.of(coxt).pop(); 250 | } 251 | }, 252 | child: Center( 253 | child: Padding( 254 | padding: const EdgeInsets.all(16.0), 255 | child: DefaultTextStyle( 256 | style: defaultTextStyle.copyWith( 257 | color: Colors.lightBlue, 258 | ), 259 | textAlign: TextAlign.center, 260 | child: cancelAction.title, 261 | ), 262 | ), 263 | ), 264 | ), 265 | ], 266 | ), 267 | ), 268 | ), 269 | ), 270 | ); 271 | }, 272 | ); 273 | } 274 | -------------------------------------------------------------------------------- /lib/src/cancel_action.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// The cancel actions model that show 4 | /// under the [BottomSheetAction] (grouped separately on iOS). 5 | class CancelAction { 6 | /// The primary content of the action sheet. 7 | /// 8 | /// Typically a [Text] widget. 9 | /// 10 | /// This should not wrap. To enforce the single line limit, use 11 | /// [Text.maxLines]. 12 | final Widget title; 13 | 14 | /// The callback that is called when the action item is tapped. 15 | /// [onPressed] is optional by default will dismiss the Action Sheet. 16 | final void Function(BuildContext context)? onPressed; 17 | 18 | /// The TextStyle to use for the title text. (optional) 19 | final TextStyle? textStyle; 20 | 21 | CancelAction({ 22 | required this.title, 23 | this.onPressed, 24 | this.textStyle, 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.12.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.2" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.4.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.2" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.19.1" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.2" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_test: 58 | dependency: "direct dev" 59 | description: flutter 60 | source: sdk 61 | version: "0.0.0" 62 | leak_tracker: 63 | dependency: transitive 64 | description: 65 | name: leak_tracker 66 | sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec 67 | url: "https://pub.dev" 68 | source: hosted 69 | version: "10.0.8" 70 | leak_tracker_flutter_testing: 71 | dependency: transitive 72 | description: 73 | name: leak_tracker_flutter_testing 74 | sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "3.0.9" 78 | leak_tracker_testing: 79 | dependency: transitive 80 | description: 81 | name: leak_tracker_testing 82 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "3.0.1" 86 | lint: 87 | dependency: "direct dev" 88 | description: 89 | name: lint 90 | sha256: "68d71111816dc7c1de358281e506efe574bb5072eae4a19f8a57484bf96825f5" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "2.6.1" 94 | matcher: 95 | dependency: transitive 96 | description: 97 | name: matcher 98 | sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "0.12.17" 102 | material_color_utilities: 103 | dependency: transitive 104 | description: 105 | name: material_color_utilities 106 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "0.11.1" 110 | meta: 111 | dependency: transitive 112 | description: 113 | name: meta 114 | sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "1.16.0" 118 | path: 119 | dependency: transitive 120 | description: 121 | name: path 122 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "1.9.1" 126 | sky_engine: 127 | dependency: transitive 128 | description: flutter 129 | source: sdk 130 | version: "0.0.0" 131 | source_span: 132 | dependency: transitive 133 | description: 134 | name: source_span 135 | sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "1.10.1" 139 | stack_trace: 140 | dependency: transitive 141 | description: 142 | name: stack_trace 143 | sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "1.12.1" 147 | stream_channel: 148 | dependency: transitive 149 | description: 150 | name: stream_channel 151 | sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "2.1.4" 155 | string_scanner: 156 | dependency: transitive 157 | description: 158 | name: string_scanner 159 | sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "1.4.1" 163 | term_glyph: 164 | dependency: transitive 165 | description: 166 | name: term_glyph 167 | sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "1.2.2" 171 | test_api: 172 | dependency: transitive 173 | description: 174 | name: test_api 175 | sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "0.7.4" 179 | vector_math: 180 | dependency: transitive 181 | description: 182 | name: vector_math 183 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "2.1.4" 187 | vm_service: 188 | dependency: transitive 189 | description: 190 | name: vm_service 191 | sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "14.3.1" 195 | sdks: 196 | dart: ">=3.7.0-0 <4.0.0" 197 | flutter: ">=3.18.0-18.0.pre.54" 198 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: adaptive_action_sheet 2 | description: A Flutter package for action bottom sheet that adapts to the platform (Android/iOS). 3 | 4 | version: 2.0.4 5 | homepage: https://github.com/Daniel-Ioannou 6 | repository: https://github.com/Daniel-Ioannou/flutter_adaptive_action_sheet 7 | 8 | environment: 9 | sdk: '>=2.12.0 <4.0.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | lint: ^2.6.1 19 | 20 | flutter: 21 | uses-material-design: true 22 | -------------------------------------------------------------------------------- /test/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daniel-Ioannou/flutter_adaptive_action_sheet/29a3082601250e3b1d22be82948b12950f061b31/test/.gitkeep --------------------------------------------------------------------------------