├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── iotecksolutions │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── 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 │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── 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 │ │ └── main.m ├── lib │ ├── main.dart │ └── ui │ │ └── demo │ │ ├── dialog_action.dart │ │ ├── dialog_demo.dart │ │ └── dialog_item.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── lib ├── material_dialog.dart └── widgets │ ├── button_bar.dart │ └── dialog.dart ├── pubspec.lock ├── pubspec.yaml └── screenshots ├── Screenshot_20191204-153700.jpg ├── Screenshot_20191204-153705.jpg ├── Screenshot_20191204-153710.jpg ├── Screenshot_20191204-153716.jpg └── Screenshot_20191204-153721.jpg /.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 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/ServiceDefinitions.json 65 | **/ios/Runner/GeneratedPluginRegistrant.* 66 | 67 | # Exceptions to above rules. 68 | !**/ios/**/default.mode1v3 69 | !**/ios/**/default.mode2v3 70 | !**/ios/**/default.pbxuser 71 | !**/ios/**/default.perspectivev3 72 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 73 | -------------------------------------------------------------------------------- /.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: 20e59316b8b8474554b38493b8ca888794b0234a 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - 11-Sep-2019. 2 | * Released package. 3 | 4 | ## [0.0.2] - 11-Sep-2019. 5 | * added custom layout 6 | * added header color 7 | * added back button and listener 8 | * added close button and listener 9 | * added border radius 10 | * added enable/disable back and close button 11 | 12 | ## [0.0.3] - 12-Sep-2019. 13 | 14 | * added divider for actions 15 | ## [0.0.4] - 12-Sep-2019. 16 | 17 | * added readme.md file 18 | 19 | ## [0.0.5] - 12-Sep-2019. 20 | * updated onBackClick -> onBackButtonClicked 21 | * updated onCloseClick -> onCloseButtonClicked 22 | * added check for empty space in portrait mode 23 | 24 | ## [0.0.6] - 16-Sep-2019. 25 | * fixed title padding 26 | 27 | ## [0.0.7] - 26-Sep-2019. 28 | * added support for background color 29 | 30 | ## [0.0.8] - 04-Dec-2019. 31 | * fixed minor UI issues 32 | * refactored examples 33 | 34 | ## [0.0.9] - 04-Dec-2019. 35 | * updated readme.md file 36 | 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Zubair Rehman 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 | # material_dialog 2 | 3 | A wrapper on top of alert dialog provided by flutter. 4 | 5 | ## Demo 6 | 7 |

8 | 9 | 10 | 11 | 12 | 13 |

14 | 15 | Use this package as a library 16 | ----------------------------- 17 | 18 | **1. Depend on it** 19 | 20 | Add this to your package's pubspec.yaml file: 21 | 22 | ``` 23 | dependencies: 24 | material_dialog: ^0.0.x 25 | ``` 26 | 27 | **2. Install it** 28 | 29 | You can install packages from the command line: 30 | 31 | with Flutter 32 | 33 | ``` 34 | $ flutter packages get 35 | ``` 36 | 37 | Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more. 38 | 39 | **3. Import it** 40 | 41 | Now in your Dart code, you can use: 42 | 43 | ``` 44 | import 'package:material_dialog/material_dialog.dart'; 45 | ``` 46 | 47 | How to use 48 | ---------- 49 | 50 | Using Material Dialog is quite easy, all you need to do is 51 | 52 | ```dart 53 | MaterialDialog( 54 | content: Text(_alertText), 55 | actions: [ 56 | FlatButton( 57 | child: Text( 58 | 'CANCEL', 59 | style: Theme.of(context).textTheme.button.copyWith( 60 | fontSize: 12.0, color: Theme.of(context).primaryColor), 61 | ), 62 | onPressed: () { 63 | Navigator.pop(context, DialogDemoAction.agree); 64 | }, 65 | ), 66 | FlatButton( 67 | child: Text( 68 | 'OK', 69 | style: Theme.of(context).textTheme.button.copyWith( 70 | fontSize: 12.0, color: Theme.of(context).primaryColor), 71 | ), 72 | onPressed: () { 73 | Navigator.pop(context, DialogDemoAction.cancel); 74 | }, 75 | ), 76 | ], 77 | ); 78 | ``` 79 | 80 | Use below method to show dialog 81 | 82 | ```dart 83 | void showDemoDialog({BuildContext context, Widget child}) { 84 | showDialog( 85 | context: context, 86 | builder: (BuildContext context) => child, 87 | ).then((T value) { 88 | // The value passed to Navigator.pop() or null. 89 | if (value != null) { 90 | _scaffoldKey.currentState.showSnackBar(SnackBar( 91 | content: Text('You selected: $value'), 92 | )); 93 | } 94 | }); 95 | } 96 | ``` 97 | 98 | ## Simple Alert Dialog 99 | ```dart 100 | Widget _buildAlertDialog(ThemeData theme, BuildContext context) { 101 | return MaterialDialog( 102 | content: Text(_alertText), 103 | actions: [ 104 | FlatButton( 105 | child: Text( 106 | 'CANCEL', 107 | style: Theme.of(context).textTheme.button.copyWith( 108 | fontSize: 12.0, color: Theme.of(context).primaryColor), 109 | ), 110 | onPressed: () { 111 | Navigator.pop(context, DialogDemoAction.agree); 112 | }, 113 | ), 114 | FlatButton( 115 | child: Text( 116 | 'OK', 117 | style: Theme.of(context).textTheme.button.copyWith( 118 | fontSize: 12.0, color: Theme.of(context).primaryColor), 119 | ), 120 | onPressed: () { 121 | Navigator.pop(context, DialogDemoAction.cancel); 122 | }, 123 | ), 124 | ], 125 | ); 126 | } 127 | ``` 128 | 129 | ## Alert Dialog With Title 130 | ```dart 131 | Widget _buildAlertDialogWithTitle(ThemeData theme, BuildContext context) { 132 | return MaterialDialog( 133 | title: Text(_alertTitle), 134 | subTitle: Text('Subtitle'), 135 | content: Text(_alertText), 136 | actions: [ 137 | FlatButton( 138 | child: Text( 139 | 'CANCEL', 140 | style: Theme.of(context).textTheme.button.copyWith( 141 | fontSize: 12.0, color: Theme.of(context).primaryColor), 142 | ), 143 | onPressed: () { 144 | Navigator.pop(context, DialogDemoAction.agree); 145 | }, 146 | ), 147 | FlatButton( 148 | child: Text( 149 | 'OK', 150 | style: Theme.of(context).textTheme.button.copyWith( 151 | fontSize: 12.0, color: Theme.of(context).primaryColor), 152 | ), 153 | onPressed: () { 154 | Navigator.pop(context, DialogDemoAction.cancel); 155 | }, 156 | ), 157 | ], 158 | ); 159 | } 160 | ``` 161 | 162 | ## Alert Dialog With Close & Back Button 163 | ```dart 164 | Widget _buildAlertDialogWithCloseAndBackButton( 165 | ThemeData theme, BuildContext context) { 166 | return MaterialDialog( 167 | title: Text(_alertTitle), 168 | subTitle: Text('Subtitle'), 169 | content: Text(_alertText), 170 | enableBackButton: true, 171 | enableCloseButton: true, 172 | onBackButtonClicked: () { 173 | Navigator.pop(context, DialogDemoAction.agree); 174 | }, 175 | onCloseButtonClicked: () { 176 | Navigator.pop(context, DialogDemoAction.cancel); 177 | }, 178 | actions: [ 179 | FlatButton( 180 | child: Text( 181 | 'CANCEL', 182 | style: Theme.of(context).textTheme.button.copyWith( 183 | fontSize: 12.0, color: Theme.of(context).primaryColor), 184 | ), 185 | onPressed: () { 186 | Navigator.pop(context, DialogDemoAction.agree); 187 | }, 188 | ), 189 | FlatButton( 190 | child: Text( 191 | 'OK', 192 | style: Theme.of(context).textTheme.button.copyWith( 193 | fontSize: 12.0, color: Theme.of(context).primaryColor), 194 | ), 195 | onPressed: () { 196 | Navigator.pop(context, DialogDemoAction.cancel); 197 | }, 198 | ), 199 | ], 200 | ); 201 | } 202 | ``` 203 | 204 | ## Alert Dialog With Children 205 | ```dart 206 | Widget _buildAlertDialogWithChildren( 207 | ThemeData theme, BuildContext context, bool isFullScreen) { 208 | return MaterialDialog( 209 | borderRadius: 8.0, 210 | enableFullHeight: isFullScreen, 211 | enableFullWidth: isFullScreen, 212 | enableCloseButton: true, 213 | closeButtonColor: Colors.white, 214 | headerColor: Theme.of(context).primaryColor, 215 | title: Text( 216 | _alertTitle, 217 | style: TextStyle( 218 | color: Colors.white, 219 | fontSize: 18.0, 220 | ), 221 | ), 222 | subTitle: Text( 223 | 'Subtitle', 224 | style: TextStyle( 225 | color: Colors.white70, 226 | fontSize: 12.0, 227 | ), 228 | ), 229 | onCloseButtonClicked: () { 230 | Navigator.pop(context, DialogDemoAction.cancel.toString()); 231 | }, 232 | children: [ 233 | Text( 234 | _alertTitle, 235 | style: TextStyle( 236 | fontSize: 18.0, 237 | ), 238 | ), 239 | SizedBox(height: 8.0), 240 | Text( 241 | _alertText, 242 | style: TextStyle( 243 | fontSize: 12.0, 244 | ), 245 | ), 246 | SizedBox(height: 16.0), 247 | TextField( 248 | decoration: InputDecoration(hintText: 'Enter Username'), 249 | ), 250 | ], 251 | actions: [ 252 | FlatButton( 253 | child: Text( 254 | 'CANCEL', 255 | style: Theme.of(context).textTheme.button.copyWith( 256 | fontSize: 12.0, color: Theme.of(context).primaryColor), 257 | ), 258 | onPressed: () { 259 | Navigator.pop(context, DialogDemoAction.cancel.toString()); 260 | }, 261 | ), 262 | FlatButton( 263 | child: Text( 264 | 'OK', 265 | style: Theme.of(context).textTheme.button.copyWith( 266 | fontSize: 12.0, color: Theme.of(context).primaryColor), 267 | ), 268 | onPressed: () { 269 | Navigator.pop(context, DialogDemoAction.agree.toString()); 270 | }, 271 | ) 272 | ], 273 | ); 274 | } 275 | ``` 276 | 277 | List of params 278 | -------------- 279 | 280 | | Property | Type | Default Value | Description | 281 | |-----------------------|--------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------| 282 | | title | Widget | null | The (optional) title of the dialog is displayed in a large font at the top of the dialog. | 283 | | subTitle | Widget | null | The (optional) subtitle of the dialog is displayed below title of the dialog. | 284 | | content | Widget | null | The (optional) content of the dialog is displayed in the center of the dialog in a lighter font. | 285 | | actions | List | null | The (optional) set of actions that are displayed at the bottom of the dialog. | 286 | | children | List | null | The (optional) content of the dialog is displayed in a [SingleChildScrollView] underneath the title. | 287 | | headerColor | Color | null | The (optional) header color is displayed in the header background. | 288 | | backButtonColor | Color | Colors.white | The (optional) back button color. By default its set to white. | 289 | | closeButtonColor | Color | Colors.white | The (optional) close button color. By default its set to white. | 290 | | onBackButtonClicked | VoidCallback | null | A callback function to get back button event from dialog. If back button is enabled this callback has to be provided in-order to get callbacks. | 291 | | onCloseButtonClicked | VoidCallback | null | A callback function to get close button event from dialog. If close button is enabled this callback has to be provided in-order to get callbacks. | 292 | | enableBackButton | bool | false | The (optional) value to enable/disable back button for a dialog. | 293 | | enableCloseButton | bool | false | The (optional) value to enable/disable close button for a dialog. | 294 | | enableFullWidth | bool | true | The (optional) value to stretch dialog to its max width. | 295 | | enableFullHeight | bool | false | The (optional) value to stretch dialog to its max height. | 296 | | borderRadius | double | 10.0 | The (optional) border radius of a dialog. by default its 10.0. | 297 | 298 | Thanks 299 | ------ 300 | If you liked my work, don’t forget to ⭐ star the repo to show your support. 301 | -------------------------------------------------------------------------------- /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 | # 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 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/ServiceDefinitions.json 65 | **/ios/Runner/GeneratedPluginRegistrant.* 66 | 67 | # Exceptions to above rules. 68 | !**/ios/**/default.mode1v3 69 | !**/ios/**/default.mode2v3 70 | !**/ios/**/default.pbxuser 71 | !**/ios/**/default.perspectivev3 72 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 73 | -------------------------------------------------------------------------------- /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: 20e59316b8b8474554b38493b8ca888794b0234a 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter application. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.iotecksolutions.example" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.1.1' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/iotecksolutions/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.iotecksolutions.example; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | android.enableR8=true 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /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 | 8.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 = 46; 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 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 1020; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = en; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_EMPTY_BODY = YES; 277 | CLANG_WARN_ENUM_CONVERSION = YES; 278 | CLANG_WARN_INFINITE_RECURSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 282 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 284 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 285 | CLANG_WARN_STRICT_PROTOTYPES = YES; 286 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 287 | CLANG_WARN_UNREACHABLE_CODE = YES; 288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 289 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 290 | COPY_PHASE_STRIP = NO; 291 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 292 | ENABLE_NS_ASSERTIONS = NO; 293 | ENABLE_STRICT_OBJC_MSGSEND = YES; 294 | GCC_C_LANGUAGE_STANDARD = gnu99; 295 | GCC_NO_COMMON_BLOCKS = YES; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 303 | MTL_ENABLE_DEBUG_INFO = NO; 304 | SDKROOT = iphoneos; 305 | TARGETED_DEVICE_FAMILY = "1,2"; 306 | VALIDATE_PRODUCT = YES; 307 | }; 308 | name = Profile; 309 | }; 310 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 311 | isa = XCBuildConfiguration; 312 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 313 | buildSettings = { 314 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 315 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 316 | DEVELOPMENT_TEAM = S8QB4VV633; 317 | ENABLE_BITCODE = NO; 318 | FRAMEWORK_SEARCH_PATHS = ( 319 | "$(inherited)", 320 | "$(PROJECT_DIR)/Flutter", 321 | ); 322 | INFOPLIST_FILE = Runner/Info.plist; 323 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 324 | LIBRARY_SEARCH_PATHS = ( 325 | "$(inherited)", 326 | "$(PROJECT_DIR)/Flutter", 327 | ); 328 | PRODUCT_BUNDLE_IDENTIFIER = com.iotecksolutions.example; 329 | PRODUCT_NAME = "$(TARGET_NAME)"; 330 | VERSIONING_SYSTEM = "apple-generic"; 331 | }; 332 | name = Profile; 333 | }; 334 | 97C147031CF9000F007C117D /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_ANALYZER_NONNULL = YES; 340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 341 | CLANG_CXX_LIBRARY = "libc++"; 342 | CLANG_ENABLE_MODULES = YES; 343 | CLANG_ENABLE_OBJC_ARC = YES; 344 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 345 | CLANG_WARN_BOOL_CONVERSION = YES; 346 | CLANG_WARN_COMMA = YES; 347 | CLANG_WARN_CONSTANT_CONVERSION = YES; 348 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_EMPTY_BODY = YES; 351 | CLANG_WARN_ENUM_CONVERSION = YES; 352 | CLANG_WARN_INFINITE_RECURSION = YES; 353 | CLANG_WARN_INT_CONVERSION = YES; 354 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = NO; 365 | DEBUG_INFORMATION_FORMAT = dwarf; 366 | ENABLE_STRICT_OBJC_MSGSEND = YES; 367 | ENABLE_TESTABILITY = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu99; 369 | GCC_DYNAMIC_NO_PIC = NO; 370 | GCC_NO_COMMON_BLOCKS = YES; 371 | GCC_OPTIMIZATION_LEVEL = 0; 372 | GCC_PREPROCESSOR_DEFINITIONS = ( 373 | "DEBUG=1", 374 | "$(inherited)", 375 | ); 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 383 | MTL_ENABLE_DEBUG_INFO = YES; 384 | ONLY_ACTIVE_ARCH = YES; 385 | SDKROOT = iphoneos; 386 | TARGETED_DEVICE_FAMILY = "1,2"; 387 | }; 388 | name = Debug; 389 | }; 390 | 97C147041CF9000F007C117D /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_ANALYZER_NONNULL = YES; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_COMMA = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INFINITE_RECURSION = YES; 409 | CLANG_WARN_INT_CONVERSION = YES; 410 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 412 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 414 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 415 | CLANG_WARN_STRICT_PROTOTYPES = YES; 416 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 417 | CLANG_WARN_UNREACHABLE_CODE = YES; 418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 420 | COPY_PHASE_STRIP = NO; 421 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = iphoneos; 435 | TARGETED_DEVICE_FAMILY = "1,2"; 436 | VALIDATE_PRODUCT = YES; 437 | }; 438 | name = Release; 439 | }; 440 | 97C147061CF9000F007C117D /* Debug */ = { 441 | isa = XCBuildConfiguration; 442 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.iotecksolutions.example; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | VERSIONING_SYSTEM = "apple-generic"; 460 | }; 461 | name = Debug; 462 | }; 463 | 97C147071CF9000F007C117D /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 466 | buildSettings = { 467 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 468 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 469 | ENABLE_BITCODE = NO; 470 | FRAMEWORK_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | INFOPLIST_FILE = Runner/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 476 | LIBRARY_SEARCH_PATHS = ( 477 | "$(inherited)", 478 | "$(PROJECT_DIR)/Flutter", 479 | ); 480 | PRODUCT_BUNDLE_IDENTIFIER = com.iotecksolutions.example; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | VERSIONING_SYSTEM = "apple-generic"; 483 | }; 484 | name = Release; 485 | }; 486 | /* End XCBuildConfiguration section */ 487 | 488 | /* Begin XCConfigurationList section */ 489 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 97C147031CF9000F007C117D /* Debug */, 493 | 97C147041CF9000F007C117D /* Release */, 494 | 249021D3217E4FDB00AE95B9 /* Profile */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | 97C147061CF9000F007C117D /* Debug */, 503 | 97C147071CF9000F007C117D /* Release */, 504 | 249021D4217E4FDB00AE95B9 /* Profile */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | /* End XCConfigurationList section */ 510 | }; 511 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 512 | } 513 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/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 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | import 'ui/demo/dialog_demo.dart'; 5 | 6 | main() { 7 | runApp(MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | return MaterialApp( 14 | home: Scaffold( 15 | body: Material( 16 | child: DialogDemo(), 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/lib/ui/demo/dialog_action.dart: -------------------------------------------------------------------------------- 1 | enum DialogDemoAction { 2 | cancel, 3 | discard, 4 | disagree, 5 | agree, 6 | } 7 | -------------------------------------------------------------------------------- /example/lib/ui/demo/dialog_demo.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/ui/demo/dialog_action.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:material_dialog/material_dialog.dart'; 5 | 6 | class DialogDemo extends StatefulWidget { 7 | @override 8 | DialogDemoState createState() => DialogDemoState(); 9 | } 10 | 11 | class DialogDemoState extends State { 12 | // global key 13 | final GlobalKey _scaffoldKey = GlobalKey(); 14 | 15 | // title 16 | final String _alertTitle = 'Discard draft?'; 17 | 18 | // message 19 | final String _alertText = 20 | 'Let Google help apps determine location. This means sending anonymous location ' 21 | 'data to Google, even when no apps are running.'; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | final ThemeData theme = Theme.of(context); 26 | 27 | return Scaffold( 28 | key: _scaffoldKey, 29 | appBar: AppBar( 30 | title: const Text('Custom Material Dialogs'), 31 | ), 32 | body: ListView( 33 | padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0), 34 | children: [ 35 | RaisedButton( 36 | child: const Text('ALERT'), 37 | onPressed: () { 38 | showDemoDialog( 39 | context: context, 40 | child: _buildAlertDialog(theme, context), 41 | ); 42 | }, 43 | ), 44 | RaisedButton( 45 | child: const Text('ALERT WITH TITLE'), 46 | onPressed: () { 47 | showDemoDialog( 48 | context: context, 49 | child: _buildAlertDialogWithTitle(theme, context), 50 | ); 51 | }, 52 | ), 53 | RaisedButton( 54 | child: const Text( 55 | 'ALERT WITH CLOSE AND BACK BUTTON', 56 | textAlign: TextAlign.center, 57 | ), 58 | onPressed: () { 59 | showDemoDialog( 60 | context: context, 61 | child: _buildAlertDialogWithCloseAndBackButton(theme, context), 62 | ); 63 | }, 64 | ), 65 | RaisedButton( 66 | child: const Text('ALERT WITH CHILDREN'), 67 | onPressed: () { 68 | showDemoDialog( 69 | context: context, 70 | child: _buildAlertDialogWithChildren(theme, context, false), 71 | ); 72 | }, 73 | ), 74 | RaisedButton( 75 | child: const Text('FULLSCREEN'), 76 | onPressed: () { 77 | showDemoDialog( 78 | context: context, 79 | child: _buildAlertDialogWithChildren(theme, context, true), 80 | ); 81 | }, 82 | ), 83 | ] 84 | // Add a little space between the buttons 85 | .map((Widget button) { 86 | return Container( 87 | padding: const EdgeInsets.symmetric(vertical: 8.0), 88 | child: button, 89 | ); 90 | }).toList(), 91 | ), 92 | ); 93 | } 94 | 95 | // Example 1: Basic Alert Dialog --------------------------------------------- 96 | Widget _buildAlertDialog(ThemeData theme, BuildContext context) { 97 | return MaterialDialog( 98 | content: Text(_alertText), 99 | actions: [ 100 | FlatButton( 101 | child: Text( 102 | 'CANCEL', 103 | style: Theme.of(context).textTheme.button.copyWith( 104 | fontSize: 12.0, color: Theme.of(context).primaryColor), 105 | ), 106 | onPressed: () { 107 | Navigator.pop(context, DialogDemoAction.agree); 108 | }, 109 | ), 110 | FlatButton( 111 | child: Text( 112 | 'OK', 113 | style: Theme.of(context).textTheme.button.copyWith( 114 | fontSize: 12.0, color: Theme.of(context).primaryColor), 115 | ), 116 | onPressed: () { 117 | Navigator.pop(context, DialogDemoAction.cancel); 118 | }, 119 | ), 120 | ], 121 | ); 122 | } 123 | 124 | // Example 2: Basic Alert Dialog And Title ----------------------------------- 125 | Widget _buildAlertDialogWithTitle(ThemeData theme, BuildContext context) { 126 | return MaterialDialog( 127 | title: Text(_alertTitle), 128 | subTitle: Text('Subtitle'), 129 | content: Text(_alertText), 130 | actions: [ 131 | FlatButton( 132 | child: Text( 133 | 'CANCEL', 134 | style: Theme.of(context).textTheme.button.copyWith( 135 | fontSize: 12.0, color: Theme.of(context).primaryColor), 136 | ), 137 | onPressed: () { 138 | Navigator.pop(context, DialogDemoAction.agree); 139 | }, 140 | ), 141 | FlatButton( 142 | child: Text( 143 | 'OK', 144 | style: Theme.of(context).textTheme.button.copyWith( 145 | fontSize: 12.0, color: Theme.of(context).primaryColor), 146 | ), 147 | onPressed: () { 148 | Navigator.pop(context, DialogDemoAction.cancel); 149 | }, 150 | ), 151 | ], 152 | ); 153 | } 154 | 155 | // Example 3: Basic Alert Dialog With Close & Back Buttons ------------------- 156 | Widget _buildAlertDialogWithCloseAndBackButton( 157 | ThemeData theme, BuildContext context) { 158 | return MaterialDialog( 159 | title: Text(_alertTitle), 160 | subTitle: Text('Subtitle'), 161 | content: Text(_alertText), 162 | enableBackButton: true, 163 | enableCloseButton: true, 164 | onBackButtonClicked: () { 165 | Navigator.pop(context, DialogDemoAction.agree); 166 | }, 167 | onCloseButtonClicked: () { 168 | Navigator.pop(context, DialogDemoAction.cancel); 169 | }, 170 | actions: [ 171 | FlatButton( 172 | child: Text( 173 | 'CANCEL', 174 | style: Theme.of(context).textTheme.button.copyWith( 175 | fontSize: 12.0, color: Theme.of(context).primaryColor), 176 | ), 177 | onPressed: () { 178 | Navigator.pop(context, DialogDemoAction.agree); 179 | }, 180 | ), 181 | FlatButton( 182 | child: Text( 183 | 'OK', 184 | style: Theme.of(context).textTheme.button.copyWith( 185 | fontSize: 12.0, color: Theme.of(context).primaryColor), 186 | ), 187 | onPressed: () { 188 | Navigator.pop(context, DialogDemoAction.cancel); 189 | }, 190 | ), 191 | ], 192 | ); 193 | } 194 | 195 | // Example 4: Basic Alert Dialog With Children ------------------------------- 196 | Widget _buildAlertDialogWithChildren( 197 | ThemeData theme, BuildContext context, bool isFullScreen) { 198 | return MaterialDialog( 199 | borderRadius: 8.0, 200 | enableFullHeight: isFullScreen, 201 | enableFullWidth: isFullScreen, 202 | enableCloseButton: true, 203 | closeButtonColor: Colors.white, 204 | headerColor: Theme.of(context).primaryColor, 205 | title: Text( 206 | _alertTitle, 207 | style: TextStyle( 208 | color: Colors.white, 209 | fontSize: 18.0, 210 | ), 211 | ), 212 | subTitle: Text( 213 | 'Subtitle', 214 | style: TextStyle( 215 | color: Colors.white70, 216 | fontSize: 12.0, 217 | ), 218 | ), 219 | onCloseButtonClicked: () { 220 | Navigator.pop(context, DialogDemoAction.cancel.toString()); 221 | }, 222 | children: [ 223 | Text( 224 | _alertTitle, 225 | style: TextStyle( 226 | fontSize: 18.0, 227 | ), 228 | ), 229 | SizedBox(height: 8.0), 230 | Text( 231 | _alertText, 232 | style: TextStyle( 233 | fontSize: 12.0, 234 | ), 235 | ), 236 | SizedBox(height: 16.0), 237 | TextField( 238 | decoration: InputDecoration(hintText: 'Enter Username'), 239 | ), 240 | ], 241 | actions: [ 242 | FlatButton( 243 | child: Text( 244 | 'CANCEL', 245 | style: Theme.of(context).textTheme.button.copyWith( 246 | fontSize: 12.0, color: Theme.of(context).primaryColor), 247 | ), 248 | onPressed: () { 249 | Navigator.pop(context, DialogDemoAction.cancel.toString()); 250 | }, 251 | ), 252 | FlatButton( 253 | child: Text( 254 | 'OK', 255 | style: Theme.of(context).textTheme.button.copyWith( 256 | fontSize: 12.0, color: Theme.of(context).primaryColor), 257 | ), 258 | onPressed: () { 259 | Navigator.pop(context, DialogDemoAction.agree.toString()); 260 | }, 261 | ) 262 | ], 263 | ); 264 | } 265 | 266 | // general methods:----------------------------------------------------------- 267 | void showDemoDialog({BuildContext context, Widget child}) { 268 | showDialog( 269 | context: context, 270 | builder: (BuildContext context) => child, 271 | ).then((T value) { 272 | // The value passed to Navigator.pop() or null. 273 | if (value != null) { 274 | _scaffoldKey.currentState.showSnackBar(SnackBar( 275 | content: Text('You selected: $value'), 276 | )); 277 | } 278 | }); 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /example/lib/ui/demo/dialog_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DialogDemoItem extends StatelessWidget { 4 | const DialogDemoItem( 5 | {Key key, this.icon, this.color, this.text, this.onPressed}) 6 | : super(key: key); 7 | 8 | final IconData icon; 9 | final Color color; 10 | final String text; 11 | final VoidCallback onPressed; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return SimpleDialogOption( 16 | onPressed: onPressed, 17 | child: Row( 18 | mainAxisAlignment: MainAxisAlignment.start, 19 | crossAxisAlignment: CrossAxisAlignment.center, 20 | children: [ 21 | Icon(icon, size: 36.0, color: color), 22 | Padding( 23 | padding: const EdgeInsets.only(left: 16.0), 24 | child: Text(text), 25 | ), 26 | ], 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /example/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 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | conditional: 33 | dependency: "direct main" 34 | description: 35 | name: conditional 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.0.1" 39 | cupertino_icons: 40 | dependency: "direct main" 41 | description: 42 | name: cupertino_icons 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "0.1.2" 46 | flutter: 47 | dependency: "direct main" 48 | description: flutter 49 | source: sdk 50 | version: "0.0.0" 51 | flutter_test: 52 | dependency: "direct dev" 53 | description: flutter 54 | source: sdk 55 | version: "0.0.0" 56 | matcher: 57 | dependency: transitive 58 | description: 59 | name: matcher 60 | url: "https://pub.dartlang.org" 61 | source: hosted 62 | version: "0.12.5" 63 | material_dialog: 64 | dependency: "direct main" 65 | description: 66 | path: ".." 67 | relative: true 68 | source: path 69 | version: "0.0.8" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "1.1.7" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.6.4" 84 | pedantic: 85 | dependency: transitive 86 | description: 87 | name: pedantic 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.8.0+1" 91 | quiver: 92 | dependency: transitive 93 | description: 94 | name: quiver 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "2.0.5" 98 | sky_engine: 99 | dependency: transitive 100 | description: flutter 101 | source: sdk 102 | version: "0.0.99" 103 | source_span: 104 | dependency: transitive 105 | description: 106 | name: source_span 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "1.5.5" 110 | stack_trace: 111 | dependency: transitive 112 | description: 113 | name: stack_trace 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.9.3" 117 | stream_channel: 118 | dependency: transitive 119 | description: 120 | name: stream_channel 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "2.0.0" 124 | string_scanner: 125 | dependency: transitive 126 | description: 127 | name: string_scanner 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.0.5" 131 | term_glyph: 132 | dependency: transitive 133 | description: 134 | name: term_glyph 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.1.0" 138 | test_api: 139 | dependency: transitive 140 | description: 141 | name: test_api 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "0.2.5" 145 | typed_data: 146 | dependency: transitive 147 | description: 148 | name: typed_data 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.1.6" 152 | vector_math: 153 | dependency: transitive 154 | description: 155 | name: vector_math 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.0.8" 159 | sdks: 160 | dart: ">=2.2.2 <3.0.0" 161 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | material_dialog: 27 | path: ../ 28 | 29 | conditional: ^0.0.1 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | 35 | 36 | # For information on the generic Dart part of this file, see the 37 | # following page: https://dart.dev/tools/pub/pubspec 38 | 39 | # The following section is specific to Flutter. 40 | flutter: 41 | 42 | # The following line ensures that the Material Icons font is 43 | # included with your application, so that you can use the icons in 44 | # the material Icons class. 45 | uses-material-design: true 46 | 47 | # To add assets to your application, add an assets section, like this: 48 | # assets: 49 | # - images/a_dot_burr.jpeg 50 | # - images/a_dot_ham.jpeg 51 | 52 | # An image asset can refer to one or more resolution-specific "variants", see 53 | # https://flutter.dev/assets-and-images/#resolution-aware. 54 | 55 | # For details regarding adding assets from package dependencies, see 56 | # https://flutter.dev/assets-and-images/#from-packages 57 | 58 | # To add custom fonts to your application, add a fonts section here, 59 | # in this "flutter" section. Each entry in this list should have a 60 | # "family" key with the font family name, and a "fonts" key with a 61 | # list giving the asset and other descriptors for the font. For 62 | # example: 63 | # fonts: 64 | # - family: Schyler 65 | # fonts: 66 | # - asset: fonts/Schyler-Regular.ttf 67 | # - asset: fonts/Schyler-Italic.ttf 68 | # style: italic 69 | # - family: Trajan Pro 70 | # fonts: 71 | # - asset: fonts/TrajanPro.ttf 72 | # - asset: fonts/TrajanPro_Bold.ttf 73 | # weight: 700 74 | # 75 | # For details regarding fonts from package dependencies, 76 | # see https://flutter.dev/custom-fonts/#from-packages 77 | -------------------------------------------------------------------------------- /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:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/material_dialog.dart: -------------------------------------------------------------------------------- 1 | library material_dialog; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:material_dialog/widgets/dialog.dart' as dialog; 5 | 6 | class MaterialDialog extends StatelessWidget { 7 | final Widget title; 8 | final Widget subTitle; 9 | final Widget content; 10 | final List actions; 11 | final List children; 12 | final Color headerColor; 13 | final Color backButtonColor; 14 | final Color closeButtonColor; 15 | final Color backgroundColor; 16 | final bool enableFullWidth; 17 | final bool enableFullHeight; 18 | final bool enableBackButton; 19 | final bool enableCloseButton; 20 | final double borderRadius; 21 | final VoidCallback onBackButtonClicked; 22 | final VoidCallback onCloseButtonClicked; 23 | 24 | const MaterialDialog({ 25 | Key key, 26 | this.title, 27 | this.subTitle, 28 | this.content, 29 | this.actions, 30 | this.children, 31 | this.enableFullWidth = false, 32 | this.enableFullHeight = false, 33 | this.headerColor, 34 | this.backButtonColor = Colors.black, 35 | this.closeButtonColor = Colors.black, 36 | this.borderRadius = 10.0, 37 | this.onBackButtonClicked, 38 | this.onCloseButtonClicked, 39 | this.enableBackButton = false, 40 | this.enableCloseButton = false, 41 | this.backgroundColor = Colors.white, 42 | }) : super(key: key); 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return dialog.SimpleDialog( 47 | backgroundColor: backgroundColor, 48 | shape: RoundedRectangleBorder( 49 | borderRadius: BorderRadius.circular(borderRadius)), 50 | title: title ?? null, 51 | subTitle: subTitle ?? null, 52 | content: content, 53 | actions: actions, 54 | children: children, 55 | headerColor: headerColor, 56 | backButtonColor: backButtonColor, 57 | closeButtonColor: closeButtonColor, 58 | borderRadius: borderRadius, 59 | onBackClick: onBackButtonClicked, 60 | onCloseClick: onCloseButtonClicked, 61 | enableBackButton: enableBackButton, 62 | enableCloseButton: enableCloseButton, 63 | enableFullWidth: enableFullWidth, 64 | enableFullHeight: enableFullHeight, 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/widgets/button_bar.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/widgets.dart'; 7 | 8 | /// An end-aligned row of buttons. 9 | /// 10 | /// Places the buttons horizontally according to the padding in the current 11 | /// [ButtonTheme]. The children are laid out in a [Row] with 12 | /// [MainAxisAlignment.end]. When the [Directionality] is [TextDirection.ltr], 13 | /// the button bar's children are right justified and the last child becomes 14 | /// the rightmost child. When the [Directionality] [TextDirection.rtl] the 15 | /// children are left justified and the last child becomes the leftmost child. 16 | /// 17 | /// Used by [Dialog] to arrange the actions at the bottom of the dialog. 18 | /// 19 | /// See also: 20 | /// 21 | /// * [RaisedButton], a kind of button. 22 | /// * [FlatButton], another kind of button. 23 | /// * [Card], at the bottom of which it is common to place a [ButtonBar]. 24 | /// * [Dialog], which uses a [ButtonBar] for its actions. 25 | /// * [ButtonTheme], which configures the [ButtonBar]. 26 | class ButtonBar extends StatelessWidget { 27 | /// Creates a button bar. 28 | /// 29 | /// The alignment argument defaults to [MainAxisAlignment.end]. 30 | const ButtonBar({ 31 | Key key, 32 | this.alignment = MainAxisAlignment.end, 33 | this.mainAxisSize = MainAxisSize.max, 34 | this.children = const [], 35 | }) : super(key: key); 36 | 37 | /// How the children should be placed along the horizontal axis. 38 | final MainAxisAlignment alignment; 39 | 40 | /// How much horizontal space is available. See [Row.mainAxisSize]. 41 | final MainAxisSize mainAxisSize; 42 | 43 | /// The buttons to arrange horizontally. 44 | /// 45 | /// Typically [RaisedButton] or [FlatButton] widgets. 46 | final List children; 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | final ButtonThemeData buttonTheme = ButtonTheme.of(context); 51 | // We divide by 4.0 because we want half of the average of the left and right padding. 52 | final double paddingUnit = buttonTheme.padding.horizontal / 4.0; 53 | final Widget child = Row( 54 | mainAxisAlignment: alignment, 55 | mainAxisSize: mainAxisSize, 56 | children: children.map((Widget child) { 57 | return Padding( 58 | padding: EdgeInsets.symmetric(horizontal: paddingUnit), 59 | child: child, 60 | ); 61 | }).toList(), 62 | ); 63 | switch (buttonTheme.layoutBehavior) { 64 | case ButtonBarLayoutBehavior.padded: 65 | return Padding( 66 | padding: EdgeInsets.symmetric( 67 | // vertical: paddingUnit, 68 | // horizontal: paddingUnit, 69 | ), 70 | child: child, 71 | ); 72 | case ButtonBarLayoutBehavior.constrained: 73 | return Container( 74 | padding: EdgeInsets.symmetric(horizontal: paddingUnit), 75 | constraints: const BoxConstraints(minHeight: 52.0), 76 | alignment: Alignment.center, 77 | child: child, 78 | ); 79 | } 80 | assert(false); 81 | return null; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/widgets/dialog.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:material_dialog/widgets/button_bar.dart' as buttonBar; 9 | 10 | // Examples can assume: 11 | // enum Department { treasury, state } 12 | // BuildContext context; 13 | 14 | /// A material design dialog. 15 | /// 16 | /// This dialog widget does not have any opinion about the contents of the 17 | /// dialog. Rather than using this widget directly, consider using [AlertDialog] 18 | /// or [SimpleDialog], which implement specific kinds of material design 19 | /// dialogs. 20 | /// 21 | /// See also: 22 | /// 23 | /// * [AlertDialog], for dialogs that have a message and some buttons. 24 | /// * [SimpleDialog], for dialogs that offer a variety of options. 25 | /// * [showDialog], which actually displays the dialog and returns its result. 26 | /// * 27 | class Dialog extends StatelessWidget { 28 | /// Creates a dialog. 29 | /// 30 | /// Typically used in conjunction with [showDialog]. 31 | const Dialog({ 32 | Key key, 33 | this.backgroundColor, 34 | this.elevation, 35 | this.insetAnimationDuration = const Duration(milliseconds: 100), 36 | this.insetAnimationCurve = Curves.decelerate, 37 | this.shape, 38 | this.child, 39 | }) : super(key: key); 40 | 41 | /// {@template flutter.material.dialog.backgroundColor} 42 | /// The background color of the surface of this [Dialog]. 43 | /// 44 | /// This sets the [Material.color] on this [Dialog]'s [Material]. 45 | /// 46 | /// If `null`, [ThemeData.cardColor] is used. 47 | /// {@endtemplate} 48 | final Color backgroundColor; 49 | 50 | /// {@template flutter.material.dialog.elevation} 51 | /// The z-coordinate of this [Dialog]. 52 | /// 53 | /// If null then [DialogTheme.elevation] is used, and if that's null then the 54 | /// dialog's elevation is 24.0. 55 | /// {@endtemplate} 56 | /// {@macro flutter.material.material.elevation} 57 | final double elevation; 58 | 59 | /// The duration of the animation to show when the system keyboard intrudes 60 | /// into the space that the dialog is placed in. 61 | /// 62 | /// Defaults to 100 milliseconds. 63 | final Duration insetAnimationDuration; 64 | 65 | /// The curve to use for the animation shown when the system keyboard intrudes 66 | /// into the space that the dialog is placed in. 67 | /// 68 | /// Defaults to [Curves.fastOutSlowIn]. 69 | final Curve insetAnimationCurve; 70 | 71 | /// {@template flutter.material.dialog.shape} 72 | /// The shape of this dialog's border. 73 | /// 74 | /// Defines the dialog's [Material.shape]. 75 | /// 76 | /// The default shape is a [RoundedRectangleBorder] with a radius of 2.0. 77 | /// {@endtemplate} 78 | final ShapeBorder shape; 79 | 80 | /// The widget below this widget in the tree. 81 | /// 82 | /// {@macro flutter.widgets.child} 83 | final Widget child; 84 | 85 | // TODO(johnsonmh): Update default dialog border radius to 4.0 to match material spec. 86 | static const RoundedRectangleBorder _defaultDialogShape = 87 | RoundedRectangleBorder( 88 | borderRadius: BorderRadius.all(Radius.circular(2.0))); 89 | static const double _defaultElevation = 24.0; 90 | 91 | @override 92 | Widget build(BuildContext context) { 93 | final DialogTheme dialogTheme = DialogTheme.of(context); 94 | return AnimatedPadding( 95 | padding: MediaQuery.of(context).viewInsets + 96 | const EdgeInsets.symmetric(horizontal: 24.0, vertical: 24.0), 97 | duration: insetAnimationDuration, 98 | curve: insetAnimationCurve, 99 | child: MediaQuery.removeViewInsets( 100 | removeLeft: true, 101 | removeTop: true, 102 | removeRight: true, 103 | removeBottom: true, 104 | context: context, 105 | child: Center( 106 | child: ConstrainedBox( 107 | constraints: const BoxConstraints(minWidth: 280.0), 108 | child: Material( 109 | color: backgroundColor ?? 110 | dialogTheme.backgroundColor ?? 111 | Theme.of(context).dialogBackgroundColor, 112 | elevation: 113 | elevation ?? dialogTheme.elevation ?? _defaultElevation, 114 | shape: shape ?? dialogTheme.shape ?? _defaultDialogShape, 115 | type: MaterialType.card, 116 | child: child, 117 | ), 118 | ), 119 | ), 120 | ), 121 | ); 122 | } 123 | } 124 | 125 | /// An option used in a [SimpleDialog]. 126 | /// 127 | /// A simple dialog offers the user a choice between several options. This 128 | /// widget is commonly used to represent each of the options. If the user 129 | /// selects this option, the widget will call the [onPressed] callback, which 130 | /// typically uses [Navigator.pop] to close the dialog. 131 | /// 132 | /// The padding on a [SimpleDialogOption] is configured to combine with the 133 | /// default [SimpleDialog.contentPadding] so that each option ends up 8 pixels 134 | /// from the other vertically, with 20 pixels of spacing between the dialog's 135 | /// title and the first option, and 24 pixels of spacing between the last option 136 | /// and the bottom of the dialog. 137 | /// 138 | /// {@tool sample} 139 | /// 140 | /// ```dart 141 | /// SimpleDialogOption( 142 | /// onPressed: () { Navigator.pop(context, Department.treasury); }, 143 | /// child: const Text('Treasury department'), 144 | /// ) 145 | /// ``` 146 | /// {@end-tool} 147 | /// 148 | /// See also: 149 | /// 150 | /// * [SimpleDialog], for a dialog in which to use this widget. 151 | /// * [showDialog], which actually displays the dialog and returns its result. 152 | /// * [FlatButton], which are commonly used as actions in other kinds of 153 | /// dialogs, such as [AlertDialog]s. 154 | /// * 155 | class SimpleDialogOption extends StatelessWidget { 156 | /// Creates an option for a [SimpleDialog]. 157 | const SimpleDialogOption({ 158 | Key key, 159 | this.onPressed, 160 | this.child, 161 | }) : super(key: key); 162 | 163 | /// The callback that is called when this option is selected. 164 | /// 165 | /// If this is set to null, the option cannot be selected. 166 | /// 167 | /// When used in a [SimpleDialog], this will typically call [Navigator.pop] 168 | /// with a value for [showDialog] to complete its future with. 169 | final VoidCallback onPressed; 170 | 171 | /// The widget below this widget in the tree. 172 | /// 173 | /// Typically a [Text] widget. 174 | final Widget child; 175 | 176 | @override 177 | Widget build(BuildContext context) { 178 | return InkWell( 179 | onTap: onPressed, 180 | child: Padding( 181 | padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 24.0), 182 | child: child, 183 | ), 184 | ); 185 | } 186 | } 187 | 188 | /// A simple material design dialog. 189 | /// 190 | /// A simple dialog offers the user a choice between several options. A simple 191 | /// dialog has an optional title that is displayed above the choices. 192 | /// 193 | /// Choices are normally represented using [SimpleDialogOption] widgets. If 194 | /// other widgets are used, see [contentPadding] for notes regarding the 195 | /// conventions for obtaining the spacing expected by Material Design. 196 | /// 197 | /// For dialogs that inform the user about a situation, consider using an 198 | /// [AlertDialog]. 199 | /// 200 | /// Typically passed as the child widget to [showDialog], which displays the 201 | /// dialog. 202 | /// 203 | /// {@tool sample} 204 | /// 205 | /// In this example, the user is asked to select between two options. These 206 | /// options are represented as an enum. The [showDialog] method here returns 207 | /// a [Future] that completes to a value of that enum. If the user cancels 208 | /// the dialog (e.g. by hitting the back button on Android, or tapping on the 209 | /// mask behind the dialog) then the future completes with the null value. 210 | /// 211 | /// The return value in this example is used as the index for a switch statement. 212 | /// One advantage of using an enum as the return value and then using that to 213 | /// drive a switch statement is that the analyzer will flag any switch statement 214 | /// that doesn't mention every value in the enum. 215 | /// 216 | /// ```dart 217 | /// Future _askedToLead() async { 218 | /// switch (await showDialog( 219 | /// context: context, 220 | /// builder: (BuildContext context) { 221 | /// return SimpleDialog( 222 | /// title: const Text('Select assignment'), 223 | /// children: [ 224 | /// SimpleDialogOption( 225 | /// onPressed: () { Navigator.pop(context, Department.treasury); }, 226 | /// child: const Text('Treasury department'), 227 | /// ), 228 | /// SimpleDialogOption( 229 | /// onPressed: () { Navigator.pop(context, Department.state); }, 230 | /// child: const Text('State department'), 231 | /// ), 232 | /// ], 233 | /// ); 234 | /// } 235 | /// )) { 236 | /// case Department.treasury: 237 | /// // Let's go. 238 | /// // ... 239 | /// break; 240 | /// case Department.state: 241 | /// // ... 242 | /// break; 243 | /// } 244 | /// } 245 | /// ``` 246 | /// {@end-tool} 247 | /// 248 | /// See also: 249 | /// 250 | /// * [SimpleDialogOption], which are options used in this type of dialog. 251 | /// * [AlertDialog], for dialogs that have a row of buttons below the body. 252 | /// * [Dialog], on which [SimpleDialog] and [AlertDialog] are based. 253 | /// * [showDialog], which actually displays the dialog and returns its result. 254 | /// * 255 | class SimpleDialog extends StatelessWidget { 256 | /// Creates a simple dialog. 257 | /// 258 | /// Typically used in conjunction with [showDialog]. 259 | /// 260 | /// The [titlePadding] and [contentPadding] arguments must not be null. 261 | const SimpleDialog({ 262 | Key key, 263 | this.title, 264 | this.subTitle, 265 | this.titlePadding = const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 16.0), 266 | this.children, 267 | this.contentPadding = const EdgeInsets.fromLTRB(16.0, 12.0, 16.0, 16.0), 268 | this.backgroundColor, 269 | this.elevation, 270 | this.semanticLabel, 271 | this.shape, 272 | this.content, 273 | this.contentTextStyle, 274 | this.actions, 275 | this.enableFullWidth, 276 | this.enableFullHeight, 277 | this.headerColor, 278 | this.backButtonColor, 279 | this.closeButtonColor, 280 | this.borderRadius, 281 | this.onBackClick, 282 | this.onCloseClick, 283 | this.enableBackButton, 284 | this.enableCloseButton, 285 | }) : assert(titlePadding != null), 286 | assert(contentPadding != null), 287 | super(key: key); 288 | 289 | /// The (optional) title of the dialog is displayed in a large font at the top 290 | /// of the dialog. 291 | /// 292 | /// Typically a [Text] widget. 293 | final Widget title; 294 | 295 | /// The (optional) subtitle of the dialog is displayed below title 296 | /// of the dialog. 297 | /// 298 | /// Typically a [Text] widget. 299 | final Widget subTitle; 300 | 301 | /// Padding around the title. 302 | /// 303 | /// If there is no title, no padding will be provided. 304 | /// 305 | /// By default, this provides the recommend Material Design padding of 24 306 | /// pixels around the left, top, and right edges of the title. 307 | /// 308 | /// See [contentPadding] for the conventions regarding padding between the 309 | /// [title] and the [children]. 310 | final EdgeInsetsGeometry titlePadding; 311 | 312 | /// The (optional) content of the dialog is displayed in a 313 | /// [SingleChildScrollView] underneath the title. 314 | /// 315 | /// Typically a list of [SimpleDialogOption]s. 316 | final List children; 317 | 318 | /// Padding around the content. 319 | /// 320 | /// By default, this is 12 pixels on the top and 16 pixels on the bottom. This 321 | /// is intended to be combined with children that have 24 pixels of padding on 322 | /// the left and right, and 8 pixels of padding on the top and bottom, so that 323 | /// the content ends up being indented 20 pixels from the title, 24 pixels 324 | /// from the bottom, and 24 pixels from the sides. 325 | /// 326 | /// The [SimpleDialogOption] widget uses such padding. 327 | /// 328 | /// If there is no [title], the [contentPadding] should be adjusted so that 329 | /// the top padding ends up being 24 pixels. 330 | final EdgeInsetsGeometry contentPadding; 331 | 332 | /// The (optional) content of the dialog is displayed in the center of the 333 | /// dialog in a lighter font. 334 | /// 335 | /// Typically this is a [SingleChildScrollView] that contains the dialog's 336 | /// message. As noted in the [AlertDialog] documentation, it's important 337 | /// to use a [SingleChildScrollView] if there's any risk that the content 338 | /// will not fit. 339 | final Widget content; 340 | 341 | /// Style for the text in the [content] of this [AlertDialog]. 342 | /// 343 | /// If null, [DialogTheme.contentTextStyle] is used, if that's null, defaults 344 | /// to [ThemeData.textTheme.subhead]. 345 | final TextStyle contentTextStyle; 346 | 347 | /// The (optional) set of actions that are displayed at the bottom of the 348 | /// dialog. 349 | /// 350 | /// Typically this is a list of [FlatButton] widgets. 351 | /// 352 | /// These widgets will be wrapped in a [ButtonBar], which introduces 8 pixels 353 | /// of padding on each side. 354 | /// 355 | /// If the [title] is not null but the [content] _is_ null, then an extra 20 356 | /// pixels of padding is added above the [ButtonBar] to separate the [title] 357 | /// from the [actions]. 358 | final List actions; 359 | 360 | /// {@macro flutter.material.dialog.backgroundColor} 361 | final Color backgroundColor; 362 | 363 | /// {@macro flutter.material.dialog.elevation} 364 | /// {@macro flutter.material.material.elevation} 365 | final double elevation; 366 | 367 | /// The semantic label of the dialog used by accessibility frameworks to 368 | /// announce screen transitions when the dialog is opened and closed. 369 | /// 370 | /// If this label is not provided, a semantic label will be inferred from the 371 | /// [title] if it is not null. If there is no title, the label will be taken 372 | /// from [MaterialLocalizations.dialogLabel]. 373 | /// 374 | /// See also: 375 | /// 376 | /// * [SemanticsConfiguration.isRouteName], for a description of how this 377 | /// value is used. 378 | final String semanticLabel; 379 | 380 | /// {@macro flutter.material.dialog.shape} 381 | final ShapeBorder shape; 382 | 383 | final enableFullWidth; 384 | final enableFullHeight; 385 | final Color headerColor; 386 | final Color backButtonColor; 387 | final Color closeButtonColor; 388 | final double borderRadius; 389 | final VoidCallback onBackClick; 390 | final VoidCallback onCloseClick; 391 | final bool enableBackButton; 392 | final bool enableCloseButton; 393 | 394 | @override 395 | Widget build(BuildContext context) { 396 | assert(debugCheckHasMaterialLocalizations(context)); 397 | final ThemeData theme = Theme.of(context); 398 | final DialogTheme dialogTheme = DialogTheme.of(context); 399 | final List body = []; 400 | String label = semanticLabel; 401 | 402 | if (title != null) { 403 | body.add( 404 | Container( 405 | width: double.infinity, 406 | decoration: BoxDecoration( 407 | color: headerColor, 408 | borderRadius: BorderRadius.only( 409 | topRight: Radius.circular(borderRadius), 410 | topLeft: Radius.circular(borderRadius), 411 | ), 412 | ), 413 | child: Row( 414 | children: [ 415 | enableBackButton 416 | ? IconButton( 417 | icon: Icon( 418 | Icons.arrow_back, 419 | color: backButtonColor, 420 | ), 421 | onPressed: onBackClick, 422 | ) 423 | : SizedBox.shrink(), 424 | Expanded( 425 | child: Padding( 426 | padding: enableBackButton 427 | ? EdgeInsets.all(12.0) 428 | : EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0), 429 | child: Column( 430 | mainAxisAlignment: MainAxisAlignment.center, 431 | crossAxisAlignment: CrossAxisAlignment.start, 432 | children: [ 433 | DefaultTextStyle( 434 | style: theme.textTheme.title, 435 | child: Semantics(namesRoute: true, child: title), 436 | ), 437 | // SizedBox(height: 4.0), 438 | subTitle != null 439 | ? DefaultTextStyle( 440 | style: contentTextStyle ?? 441 | dialogTheme.contentTextStyle ?? 442 | theme.textTheme.subhead, 443 | child: subTitle, 444 | ) 445 | : SizedBox.shrink() 446 | ], 447 | ), 448 | ), 449 | ), 450 | enableCloseButton 451 | ? IconButton( 452 | icon: Icon( 453 | Icons.clear, 454 | color: closeButtonColor, 455 | ), 456 | onPressed: onCloseClick, 457 | ) 458 | : SizedBox.shrink(), 459 | ], 460 | ), 461 | ), 462 | ); 463 | } else { 464 | switch (theme.platform) { 465 | case TargetPlatform.iOS: 466 | label = semanticLabel; 467 | break; 468 | case TargetPlatform.android: 469 | case TargetPlatform.fuchsia: 470 | label = 471 | semanticLabel ?? MaterialLocalizations.of(context)?.dialogLabel; 472 | } 473 | } 474 | 475 | if (content != null) { 476 | body.add( 477 | Flexible( 478 | child: Padding( 479 | padding: title == null 480 | ? EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 16.0) 481 | : children == null 482 | ? EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 16.0) 483 | : EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0), 484 | child: DefaultTextStyle( 485 | style: contentTextStyle ?? 486 | dialogTheme.contentTextStyle ?? 487 | theme.textTheme.subhead, 488 | child: content, 489 | ), 490 | ), 491 | ), 492 | ); 493 | } 494 | 495 | if (children != null) { 496 | body.add( 497 | Flexible( 498 | fit: FlexFit.loose, 499 | child: SingleChildScrollView( 500 | padding: contentPadding, 501 | child: ListBody(children: children), 502 | ), 503 | ), 504 | ); 505 | } 506 | 507 | if (actions != null) { 508 | body.add( 509 | Column( 510 | children: [ 511 | Divider(height: 1.0), 512 | (enableFullWidth && 513 | MediaQuery.of(context).orientation != 514 | Orientation.portrait) || 515 | actions.length < 3 516 | ? buttonBar.ButtonBar( 517 | children: actions, 518 | ) 519 | : FittedBox( 520 | child: buttonBar.ButtonBar( 521 | children: actions, 522 | ), 523 | ), 524 | ], 525 | ), 526 | ); 527 | } 528 | 529 | Widget dialogChild = IntrinsicWidth( 530 | stepWidth: 56.0, 531 | child: ConstrainedBox( 532 | constraints: BoxConstraints( 533 | minWidth: 534 | enableFullWidth ? MediaQuery.of(context).size.width : 280.0, 535 | minHeight: enableFullHeight && 536 | MediaQuery.of(context).orientation != Orientation.portrait 537 | ? MediaQuery.of(context).size.height 538 | : 0.0), 539 | child: Column( 540 | mainAxisSize: MainAxisSize.min, 541 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 542 | crossAxisAlignment: CrossAxisAlignment.stretch, 543 | children: body, 544 | ), 545 | ), 546 | ); 547 | 548 | if (label != null) { 549 | dialogChild = Semantics( 550 | namesRoute: true, 551 | label: label, 552 | child: dialogChild, 553 | ); 554 | } 555 | 556 | return Dialog( 557 | backgroundColor: backgroundColor, 558 | elevation: elevation, 559 | shape: shape, 560 | child: dialogChild, 561 | ); 562 | } 563 | } 564 | 565 | Widget _buildMaterialDialogTransitions( 566 | BuildContext context, 567 | Animation animation, 568 | Animation secondaryAnimation, 569 | Widget child) { 570 | return FadeTransition( 571 | opacity: CurvedAnimation( 572 | parent: animation, 573 | curve: Curves.easeOut, 574 | ), 575 | child: child, 576 | ); 577 | } 578 | 579 | /// Displays a Material dialog above the current contents of the app, with 580 | /// Material entrance and exit animations, modal barrier color, and modal 581 | /// barrier behavior (dialog is dismissible with a tap on the barrier). 582 | /// 583 | /// This function takes a `builder` which typically builds a [Dialog] widget. 584 | /// Content below the dialog is dimmed with a [ModalBarrier]. The widget 585 | /// returned by the `builder` does not share a context with the location that 586 | /// `showDialog` is originally called from. Use a [StatefulBuilder] or a 587 | /// custom [StatefulWidget] if the dialog needs to update dynamically. 588 | /// 589 | /// The `context` argument is used to look up the [Navigator] and [Theme] for 590 | /// the dialog. It is only used when the method is called. Its corresponding 591 | /// widget can be safely removed from the tree before the dialog is closed. 592 | /// 593 | /// The `child` argument is deprecated, and should be replaced with `builder`. 594 | /// 595 | /// Returns a [Future] that resolves to the value (if any) that was passed to 596 | /// [Navigator.pop] when the dialog was closed. 597 | /// 598 | /// The dialog route created by this method is pushed to the root navigator. 599 | /// If the application has multiple [Navigator] objects, it may be necessary to 600 | /// call `Navigator.of(context, rootNavigator: true).pop(result)` to close the 601 | /// dialog rather than just `Navigator.pop(context, result)`. 602 | /// 603 | /// See also: 604 | /// 605 | /// * [AlertDialog], for dialogs that have a row of buttons below a body. 606 | /// * [SimpleDialog], which handles the scrolling of the contents and does 607 | /// not show buttons below its body. 608 | /// * [Dialog], on which [SimpleDialog] and [AlertDialog] are based. 609 | /// * [showCupertinoDialog], which displays an iOS-style dialog. 610 | /// * [showGeneralDialog], which allows for customization of the dialog popup. 611 | /// * 612 | Future showDialog({ 613 | @required 614 | BuildContext context, 615 | bool barrierDismissible = true, 616 | @Deprecated( 617 | 'Instead of using the "child" argument, return the child from a closure ' 618 | 'provided to the "builder" argument. This will ensure that the BuildContext ' 619 | 'is appropriate for widgets built in the dialog.') 620 | Widget child, 621 | WidgetBuilder builder, 622 | }) { 623 | assert(child == null || builder == null); 624 | assert(debugCheckHasMaterialLocalizations(context)); 625 | 626 | final ThemeData theme = Theme.of(context, shadowThemeOnly: true); 627 | return showGeneralDialog( 628 | context: context, 629 | pageBuilder: (BuildContext buildContext, Animation animation, 630 | Animation secondaryAnimation) { 631 | final Widget pageChild = child ?? Builder(builder: builder); 632 | return SafeArea( 633 | child: Builder(builder: (BuildContext context) { 634 | return theme != null 635 | ? Theme(data: theme, child: pageChild) 636 | : pageChild; 637 | }), 638 | ); 639 | }, 640 | barrierDismissible: barrierDismissible, 641 | barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, 642 | barrierColor: Colors.black54, 643 | transitionDuration: const Duration(milliseconds: 150), 644 | transitionBuilder: _buildMaterialDialogTransitions, 645 | ); 646 | } 647 | -------------------------------------------------------------------------------- /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 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | flutter: 33 | dependency: "direct main" 34 | description: flutter 35 | source: sdk 36 | version: "0.0.0" 37 | flutter_test: 38 | dependency: "direct dev" 39 | description: flutter 40 | source: sdk 41 | version: "0.0.0" 42 | matcher: 43 | dependency: transitive 44 | description: 45 | name: matcher 46 | url: "https://pub.dartlang.org" 47 | source: hosted 48 | version: "0.12.5" 49 | meta: 50 | dependency: "direct main" 51 | description: 52 | name: meta 53 | url: "https://pub.dartlang.org" 54 | source: hosted 55 | version: "1.1.7" 56 | path: 57 | dependency: transitive 58 | description: 59 | name: path 60 | url: "https://pub.dartlang.org" 61 | source: hosted 62 | version: "1.6.4" 63 | pedantic: 64 | dependency: transitive 65 | description: 66 | name: pedantic 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "1.8.0+1" 70 | quiver: 71 | dependency: transitive 72 | description: 73 | name: quiver 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "2.0.5" 77 | sky_engine: 78 | dependency: transitive 79 | description: flutter 80 | source: sdk 81 | version: "0.0.99" 82 | source_span: 83 | dependency: transitive 84 | description: 85 | name: source_span 86 | url: "https://pub.dartlang.org" 87 | source: hosted 88 | version: "1.5.5" 89 | stack_trace: 90 | dependency: transitive 91 | description: 92 | name: stack_trace 93 | url: "https://pub.dartlang.org" 94 | source: hosted 95 | version: "1.9.3" 96 | stream_channel: 97 | dependency: transitive 98 | description: 99 | name: stream_channel 100 | url: "https://pub.dartlang.org" 101 | source: hosted 102 | version: "2.0.0" 103 | string_scanner: 104 | dependency: transitive 105 | description: 106 | name: string_scanner 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "1.0.5" 110 | term_glyph: 111 | dependency: transitive 112 | description: 113 | name: term_glyph 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.1.0" 117 | test_api: 118 | dependency: transitive 119 | description: 120 | name: test_api 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "0.2.5" 124 | typed_data: 125 | dependency: transitive 126 | description: 127 | name: typed_data 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.1.6" 131 | vector_math: 132 | dependency: transitive 133 | description: 134 | name: vector_math 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.0.8" 138 | sdks: 139 | dart: ">=2.2.2 <3.0.0" 140 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: material_dialog 2 | description: A wrapper on top of alert dialog provided by flutter. 3 | version: 0.0.9 4 | author: Zubair Rehman 5 | homepage: https://github.com/zubairehman/MaterialDialog.git 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | meta: ^1.1.7 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | # For information on the generic Dart part of this file, see the 21 | # following page: https://dart.dev/tools/pub/pubspec 22 | 23 | # The following section is specific to Flutter. 24 | flutter: 25 | 26 | # To add assets to your package, add an assets section, like this: 27 | # assets: 28 | # - images/a_dot_burr.jpeg 29 | # - images/a_dot_ham.jpeg 30 | # 31 | # For details regarding assets in packages, see 32 | # https://flutter.dev/assets-and-images/#from-packages 33 | # 34 | # An image asset can refer to one or more resolution-specific "variants", see 35 | # https://flutter.dev/assets-and-images/#resolution-aware. 36 | 37 | # To add custom fonts to your package, add a fonts section here, 38 | # in this "flutter" section. Each entry in this list should have a 39 | # "family" key with the font family name, and a "fonts" key with a 40 | # list giving the asset and other descriptors for the font. For 41 | # example: 42 | # fonts: 43 | # - family: Schyler 44 | # fonts: 45 | # - asset: fonts/Schyler-Regular.ttf 46 | # - asset: fonts/Schyler-Italic.ttf 47 | # style: italic 48 | # - family: Trajan Pro 49 | # fonts: 50 | # - asset: fonts/TrajanPro.ttf 51 | # - asset: fonts/TrajanPro_Bold.ttf 52 | # weight: 700 53 | # 54 | # For details regarding fonts in packages, see 55 | # https://flutter.dev/custom-fonts/#from-packages 56 | -------------------------------------------------------------------------------- /screenshots/Screenshot_20191204-153700.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/screenshots/Screenshot_20191204-153700.jpg -------------------------------------------------------------------------------- /screenshots/Screenshot_20191204-153705.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/screenshots/Screenshot_20191204-153705.jpg -------------------------------------------------------------------------------- /screenshots/Screenshot_20191204-153710.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/screenshots/Screenshot_20191204-153710.jpg -------------------------------------------------------------------------------- /screenshots/Screenshot_20191204-153716.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/screenshots/Screenshot_20191204-153716.jpg -------------------------------------------------------------------------------- /screenshots/Screenshot_20191204-153721.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zubairehman/MaterialDialog/0a007bddf8f380a409785fe6db59716f8c0bcea9/screenshots/Screenshot_20191204-153721.jpg --------------------------------------------------------------------------------