├── .fvm └── fvm_config.json ├── .github └── workflows │ └── publish.yaml ├── .gitignore ├── .idea ├── .gitignore ├── codeStyles │ └── Project.xml ├── inspectionProfiles │ └── Project_Default.xml ├── libraries │ ├── Dart_Packages.xml │ ├── Dart_SDK.xml │ └── Flutter_Plugins.xml ├── misc.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml └── vcs.xml ├── .metadata ├── .pubignore ├── .vscode └── launch.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── 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-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── main.dart │ ├── sample.dart │ └── sample_pages │ │ ├── dashboard_page.dart │ │ ├── second_level_item_1_page.dart │ │ ├── second_level_item_2_page.dart │ │ ├── third_level_item_1_page.dart │ │ └── third_level_item_2_page.dart ├── pubspec.lock ├── pubspec.yaml └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── flutter_admin_scaffold.iml ├── lib ├── admin_scaffold.dart └── src │ ├── admin_menu_item.dart │ ├── side_bar.dart │ └── side_bar_item.dart ├── pubspec.lock ├── pubspec.yaml └── test └── flutter_admin_scaffold_test.dart /.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "3.13.6", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | publish: 10 | name: Publish 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 1 17 | - name: Download dart sdk 18 | uses: dart-lang/setup-dart@v1 19 | with: 20 | sdk: stable 21 | - name: Setup credentials 22 | run: | 23 | mkdir -p ~/.pub-cache 24 | cat < ~/.pub-cache/credentials.json 25 | { 26 | "accessToken":"${{ secrets.PUB_CREDENTIALS_ACCESS_TOKEN }}", 27 | "refreshToken":"${{ secrets.PUB_CREDENTIALS_REFRESH_TOKEN }}", 28 | "idToken":"${{ secrets.PUB_CREDENTIALS_ID_TOKEN }}", 29 | "tokenEndpoint":"https://accounts.google.com/o/oauth2/token", 30 | "scopes": ["openid","https://www.googleapis.com/auth/userinfo.email"], 31 | "expiration": 1663545376882 32 | } 33 | EOF 34 | - name: Publish to pub.dev 35 | run: dart pub publish -f 36 | - name: Create release 37 | uses: actions/create-release@v1 38 | env: 39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 40 | with: 41 | tag_name: ${{ github.ref }} 42 | release_name: ${{ github.ref }} 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .idea/workspace.xml 10 | 11 | # fvm related 12 | .fvm/flutter_sdk 13 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /. 3 | 4 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.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: 198df796aa80073ef22bdf249e614e2ff33c6895 8 | channel: beta 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /.pubignore: -------------------------------------------------------------------------------- 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 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | example/build/ 33 | example/ios/Flutter/*.framework 34 | 35 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | example/android/app/debug 46 | example/android/app/profile 47 | example/android/app/release -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "web-html", 6 | "type": "dart", 7 | "request": "launch", 8 | "flutterMode": "debug", 9 | "program": "example/lib/main.dart", 10 | "args": [ 11 | "--web-renderer", 12 | "html", 13 | "--web-hostname", 14 | "localhost", 15 | "--web-port", 16 | "5000", 17 | ] 18 | }, 19 | { 20 | "name": "web-canvaskit", 21 | "type": "dart", 22 | "request": "launch", 23 | "flutterMode": "debug", 24 | "program": "example/lib/main.dart", 25 | "args": [ 26 | "--web-renderer", 27 | "canvaskit", 28 | "--web-hostname", 29 | "localhost", 30 | "--web-port", 31 | "5000", 32 | ] 33 | }, 34 | ] 35 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.4.0 - Dec 21, 2024 2 | 3 | - feat: Add leadingIcon parameter #24 4 | 5 | ## 1.3.0 - May 12, 2024 6 | 7 | - fix: Reflect AppBar.shadowColor #20 8 | - feat: Add mobileThreshold parameter #21 9 | 10 | ## 1.2.0 - April 9, 2023 11 | 12 | - Change minimum Dart version to '2.18.0' 13 | - Change minimum Flutter version to '3.3.0' 14 | - Added support for AppBar properties (`scrolledUnderElevation`, `notificationPredicate` and `surfaceTintColor` ) 15 | - Removed support for deprecated AppBar properties ( `brightness`, `textTheme` and `backwardsCompatibility` ) 16 | 17 | ## 1.1.2 - September 19, 2022 18 | 19 | - Fixed lint 20 | 21 | ## 1.1.1 - May 12, 2022 22 | 23 | - BREAKING: `MenuItem` are removed. You can now instead use `AdminMenuItem`. 24 | 25 | ## 1.1.0 - February 16, 2022 26 | 27 | - Performance improvements 28 | - Support any parameters at AppBar class 29 | 30 | ## 1.0.1 - February 14, 2022 31 | 32 | - Add scrollController parameter at SideBar class 33 | 34 | ## 1.0.0 - April 27, 2021 35 | 36 | - support null-safety 37 | 38 | ## 0.0.5 - December 22, 2020 39 | 40 | - SingleChildScrollView of body is abolished 41 | 42 | ## 0.0.4 - November 21, 2020 43 | 44 | - Rename package name 45 | - Rename parameters 46 | - Add header and footer parameters at SideBar class 47 | 48 | ## 0.0.3 - November 13, 2020 49 | 50 | - Add iconColor, activeIconColor, activeTextStyle param to Sidebar class 51 | 52 | ## 0.0.2 - November 5, 2020 53 | 54 | - add backgroundColor parameter 55 | 56 | ## 0.0.1+3 - November 4, 2020 57 | 58 | - Initial Release -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Keyber Inc. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_admin_scaffold 2 | 3 | A scaffold class with a sideBar that works with a appBar. 4 | 5 | example.gif 6 | 7 | ## Usage 8 | 9 | ```dart 10 | import 'package:flutter_admin_scaffold/admin_scaffold.dart'; 11 | ``` 12 | 13 | You can add a sideBar as shown below. See `example` for details. 14 | 15 | ```dart 16 | import 'package:flutter/material.dart'; 17 | import 'package:flutter_admin_scaffold/admin_scaffold.dart'; 18 | 19 | class SamplePage extends StatelessWidget { 20 | @override 21 | Widget build(BuildContext context) { 22 | return AdminScaffold( 23 | backgroundColor: Colors.white, 24 | appBar: AppBar( 25 | title: const Text('Sample'), 26 | ), 27 | sideBar: SideBar( 28 | items: const [ 29 | AdminMenuItem( 30 | title: 'Dashboard', 31 | route: '/', 32 | icon: Icons.dashboard, 33 | ), 34 | AdminMenuItem( 35 | title: 'Top Level', 36 | icon: Icons.file_copy, 37 | children: [ 38 | AdminMenuItem( 39 | title: 'Second Level Item 1', 40 | route: '/secondLevelItem1', 41 | ), 42 | AdminMenuItem( 43 | title: 'Second Level Item 2', 44 | route: '/secondLevelItem2', 45 | ), 46 | AdminMenuItem( 47 | title: 'Third Level', 48 | children: [ 49 | AdminMenuItem( 50 | title: 'Third Level Item 1', 51 | route: '/thirdLevelItem1', 52 | ), 53 | AdminMenuItem( 54 | title: 'Third Level Item 2', 55 | route: '/thirdLevelItem2', 56 | ), 57 | ], 58 | ), 59 | ], 60 | ), 61 | ], 62 | selectedRoute: '/', 63 | onSelected: (item) { 64 | if (item.route != null) { 65 | Navigator.of(context).pushNamed(item.route!); 66 | } 67 | }, 68 | header: Container( 69 | height: 50, 70 | width: double.infinity, 71 | color: const Color(0xff444444), 72 | child: const Center( 73 | child: Text( 74 | 'header', 75 | style: TextStyle( 76 | color: Colors.white, 77 | ), 78 | ), 79 | ), 80 | ), 81 | footer: Container( 82 | height: 50, 83 | width: double.infinity, 84 | color: const Color(0xff444444), 85 | child: const Center( 86 | child: Text( 87 | 'footer', 88 | style: TextStyle( 89 | color: Colors.white, 90 | ), 91 | ), 92 | ), 93 | ), 94 | ), 95 | body: SingleChildScrollView( 96 | child: Container( 97 | alignment: Alignment.topLeft, 98 | padding: const EdgeInsets.all(10), 99 | child: const Text( 100 | 'Dashboard', 101 | style: TextStyle( 102 | fontWeight: FontWeight.w700, 103 | fontSize: 36, 104 | ), 105 | ), 106 | ), 107 | ), 108 | ); 109 | } 110 | } 111 | ``` 112 | -------------------------------------------------------------------------------- /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 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /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: 198df796aa80073ef22bdf249e614e2ff33c6895 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_admin_scaffold_example 2 | 3 | Demonstrates how to use the flutter_admin_scaffold plugin. 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/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 29 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.example" 42 | minSdkVersion 16 43 | targetSdkVersion 29 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/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 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - Flutter (from `Flutter`) 6 | 7 | EXTERNAL SOURCES: 8 | Flutter: 9 | :path: Flutter 10 | 11 | SPEC CHECKSUMS: 12 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 13 | 14 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 15 | 16 | COCOAPODS: 1.9.3 17 | -------------------------------------------------------------------------------- /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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | D8E50C531DD58523286E5540 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E1510D948464559BF3F97D8 /* Pods_Runner.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 0E1510D948464559BF3F97D8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 47C6294EB5C6C09639C842F8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 38 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 39 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | D14E92CCE8DB6BDA6E71A3B9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 49 | D26CFB4DC57132BEC4718B3B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | D8E50C531DD58523286E5540 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 0AA2A0BBE29B8B62A0D77633 /* Frameworks */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 0E1510D948464559BF3F97D8 /* Pods_Runner.framework */, 68 | ); 69 | name = Frameworks; 70 | sourceTree = ""; 71 | }; 72 | 9740EEB11CF90186004384FC /* Flutter */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 77 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 78 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 79 | ); 80 | name = Flutter; 81 | sourceTree = ""; 82 | }; 83 | 97C146E51CF9000F007C117D = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9740EEB11CF90186004384FC /* Flutter */, 87 | 97C146F01CF9000F007C117D /* Runner */, 88 | 97C146EF1CF9000F007C117D /* Products */, 89 | B9293FFAF094253FDF1DA1B8 /* Pods */, 90 | 0AA2A0BBE29B8B62A0D77633 /* 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 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 106 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 107 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 108 | 97C147021CF9000F007C117D /* Info.plist */, 109 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 110 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 111 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 112 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 113 | ); 114 | path = Runner; 115 | sourceTree = ""; 116 | }; 117 | B9293FFAF094253FDF1DA1B8 /* Pods */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 47C6294EB5C6C09639C842F8 /* Pods-Runner.debug.xcconfig */, 121 | D26CFB4DC57132BEC4718B3B /* Pods-Runner.release.xcconfig */, 122 | D14E92CCE8DB6BDA6E71A3B9 /* Pods-Runner.profile.xcconfig */, 123 | ); 124 | name = Pods; 125 | path = Pods; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 97C146ED1CF9000F007C117D /* Runner */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 134 | buildPhases = ( 135 | DD416B28423E1BAE3EDC25BD /* [CP] Check Pods Manifest.lock */, 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | 1E4048A1F3904ECAEF9AB1FD /* [CP] Embed Pods Frameworks */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 1020; 160 | ORGANIZATIONNAME = ""; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | LastSwiftMigration = 1100; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 169 | compatibilityVersion = "Xcode 9.3"; 170 | developmentRegion = en; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 97C146E51CF9000F007C117D; 177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 97C146ED1CF9000F007C117D /* Runner */, 182 | ); 183 | }; 184 | /* End PBXProject section */ 185 | 186 | /* Begin PBXResourcesBuildPhase section */ 187 | 97C146EC1CF9000F007C117D /* Resources */ = { 188 | isa = PBXResourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 1E4048A1F3904ECAEF9AB1FD /* [CP] Embed Pods Frameworks */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 208 | "${PODS_ROOT}/../Flutter/Flutter.framework", 209 | ); 210 | name = "[CP] Embed Pods Frameworks"; 211 | outputPaths = ( 212 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | shellPath = /bin/sh; 216 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 217 | showEnvVarsInLog = 0; 218 | }; 219 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 220 | isa = PBXShellScriptBuildPhase; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | ); 224 | inputPaths = ( 225 | ); 226 | name = "Thin Binary"; 227 | outputPaths = ( 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | shellPath = /bin/sh; 231 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 232 | }; 233 | 9740EEB61CF901F6004384FC /* Run Script */ = { 234 | isa = PBXShellScriptBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | ); 238 | inputPaths = ( 239 | ); 240 | name = "Run Script"; 241 | outputPaths = ( 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | shellPath = /bin/sh; 245 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 246 | }; 247 | DD416B28423E1BAE3EDC25BD /* [CP] Check Pods Manifest.lock */ = { 248 | isa = PBXShellScriptBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | inputFileListPaths = ( 253 | ); 254 | inputPaths = ( 255 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 256 | "${PODS_ROOT}/Manifest.lock", 257 | ); 258 | name = "[CP] Check Pods Manifest.lock"; 259 | outputFileListPaths = ( 260 | ); 261 | outputPaths = ( 262 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | shellPath = /bin/sh; 266 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 267 | showEnvVarsInLog = 0; 268 | }; 269 | /* End PBXShellScriptBuildPhase section */ 270 | 271 | /* Begin PBXSourcesBuildPhase section */ 272 | 97C146EA1CF9000F007C117D /* Sources */ = { 273 | isa = PBXSourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 277 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXVariantGroup section */ 284 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 285 | isa = PBXVariantGroup; 286 | children = ( 287 | 97C146FB1CF9000F007C117D /* Base */, 288 | ); 289 | name = Main.storyboard; 290 | sourceTree = ""; 291 | }; 292 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 97C147001CF9000F007C117D /* Base */, 296 | ); 297 | name = LaunchScreen.storyboard; 298 | sourceTree = ""; 299 | }; 300 | /* End PBXVariantGroup section */ 301 | 302 | /* Begin XCBuildConfiguration section */ 303 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 304 | isa = XCBuildConfiguration; 305 | buildSettings = { 306 | ALWAYS_SEARCH_USER_PATHS = NO; 307 | CLANG_ANALYZER_NONNULL = YES; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 313 | CLANG_WARN_BOOL_CONVERSION = YES; 314 | CLANG_WARN_COMMA = YES; 315 | CLANG_WARN_CONSTANT_CONVERSION = YES; 316 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 317 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 318 | CLANG_WARN_EMPTY_BODY = YES; 319 | CLANG_WARN_ENUM_CONVERSION = YES; 320 | CLANG_WARN_INFINITE_RECURSION = YES; 321 | CLANG_WARN_INT_CONVERSION = YES; 322 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 323 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 324 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 327 | CLANG_WARN_STRICT_PROTOTYPES = YES; 328 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 329 | CLANG_WARN_UNREACHABLE_CODE = YES; 330 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 331 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 332 | COPY_PHASE_STRIP = NO; 333 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 334 | ENABLE_NS_ASSERTIONS = NO; 335 | ENABLE_STRICT_OBJC_MSGSEND = YES; 336 | GCC_C_LANGUAGE_STANDARD = gnu99; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 339 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 340 | GCC_WARN_UNDECLARED_SELECTOR = YES; 341 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 342 | GCC_WARN_UNUSED_FUNCTION = YES; 343 | GCC_WARN_UNUSED_VARIABLE = YES; 344 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 345 | MTL_ENABLE_DEBUG_INFO = NO; 346 | SDKROOT = iphoneos; 347 | SUPPORTED_PLATFORMS = iphoneos; 348 | TARGETED_DEVICE_FAMILY = "1,2"; 349 | VALIDATE_PRODUCT = YES; 350 | }; 351 | name = Profile; 352 | }; 353 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 354 | isa = XCBuildConfiguration; 355 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 356 | buildSettings = { 357 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 358 | CLANG_ENABLE_MODULES = YES; 359 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 360 | ENABLE_BITCODE = NO; 361 | FRAMEWORK_SEARCH_PATHS = ( 362 | "$(inherited)", 363 | "$(PROJECT_DIR)/Flutter", 364 | ); 365 | INFOPLIST_FILE = Runner/Info.plist; 366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 367 | LIBRARY_SEARCH_PATHS = ( 368 | "$(inherited)", 369 | "$(PROJECT_DIR)/Flutter", 370 | ); 371 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 372 | PRODUCT_NAME = "$(TARGET_NAME)"; 373 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 374 | SWIFT_VERSION = 5.0; 375 | VERSIONING_SYSTEM = "apple-generic"; 376 | }; 377 | name = Profile; 378 | }; 379 | 97C147031CF9000F007C117D /* Debug */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ALWAYS_SEARCH_USER_PATHS = NO; 383 | CLANG_ANALYZER_NONNULL = YES; 384 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 385 | CLANG_CXX_LIBRARY = "libc++"; 386 | CLANG_ENABLE_MODULES = YES; 387 | CLANG_ENABLE_OBJC_ARC = YES; 388 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 389 | CLANG_WARN_BOOL_CONVERSION = YES; 390 | CLANG_WARN_COMMA = YES; 391 | CLANG_WARN_CONSTANT_CONVERSION = YES; 392 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_EMPTY_BODY = YES; 395 | CLANG_WARN_ENUM_CONVERSION = YES; 396 | CLANG_WARN_INFINITE_RECURSION = YES; 397 | CLANG_WARN_INT_CONVERSION = YES; 398 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 400 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 402 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 403 | CLANG_WARN_STRICT_PROTOTYPES = YES; 404 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 405 | CLANG_WARN_UNREACHABLE_CODE = YES; 406 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 407 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 408 | COPY_PHASE_STRIP = NO; 409 | DEBUG_INFORMATION_FORMAT = dwarf; 410 | ENABLE_STRICT_OBJC_MSGSEND = YES; 411 | ENABLE_TESTABILITY = YES; 412 | GCC_C_LANGUAGE_STANDARD = gnu99; 413 | GCC_DYNAMIC_NO_PIC = NO; 414 | GCC_NO_COMMON_BLOCKS = YES; 415 | GCC_OPTIMIZATION_LEVEL = 0; 416 | GCC_PREPROCESSOR_DEFINITIONS = ( 417 | "DEBUG=1", 418 | "$(inherited)", 419 | ); 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 427 | MTL_ENABLE_DEBUG_INFO = YES; 428 | ONLY_ACTIVE_ARCH = YES; 429 | SDKROOT = iphoneos; 430 | TARGETED_DEVICE_FAMILY = "1,2"; 431 | }; 432 | name = Debug; 433 | }; 434 | 97C147041CF9000F007C117D /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_ANALYZER_NONNULL = YES; 439 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 440 | CLANG_CXX_LIBRARY = "libc++"; 441 | CLANG_ENABLE_MODULES = YES; 442 | CLANG_ENABLE_OBJC_ARC = YES; 443 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 444 | CLANG_WARN_BOOL_CONVERSION = YES; 445 | CLANG_WARN_COMMA = YES; 446 | CLANG_WARN_CONSTANT_CONVERSION = YES; 447 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 448 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 449 | CLANG_WARN_EMPTY_BODY = YES; 450 | CLANG_WARN_ENUM_CONVERSION = YES; 451 | CLANG_WARN_INFINITE_RECURSION = YES; 452 | CLANG_WARN_INT_CONVERSION = YES; 453 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 455 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 456 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 457 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 458 | CLANG_WARN_STRICT_PROTOTYPES = YES; 459 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 460 | CLANG_WARN_UNREACHABLE_CODE = YES; 461 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 462 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 463 | COPY_PHASE_STRIP = NO; 464 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 465 | ENABLE_NS_ASSERTIONS = NO; 466 | ENABLE_STRICT_OBJC_MSGSEND = YES; 467 | GCC_C_LANGUAGE_STANDARD = gnu99; 468 | GCC_NO_COMMON_BLOCKS = YES; 469 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 470 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 471 | GCC_WARN_UNDECLARED_SELECTOR = YES; 472 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 473 | GCC_WARN_UNUSED_FUNCTION = YES; 474 | GCC_WARN_UNUSED_VARIABLE = YES; 475 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 476 | MTL_ENABLE_DEBUG_INFO = NO; 477 | SDKROOT = iphoneos; 478 | SUPPORTED_PLATFORMS = iphoneos; 479 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 480 | TARGETED_DEVICE_FAMILY = "1,2"; 481 | VALIDATE_PRODUCT = YES; 482 | }; 483 | name = Release; 484 | }; 485 | 97C147061CF9000F007C117D /* Debug */ = { 486 | isa = XCBuildConfiguration; 487 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 488 | buildSettings = { 489 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 490 | CLANG_ENABLE_MODULES = YES; 491 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 492 | ENABLE_BITCODE = NO; 493 | FRAMEWORK_SEARCH_PATHS = ( 494 | "$(inherited)", 495 | "$(PROJECT_DIR)/Flutter", 496 | ); 497 | INFOPLIST_FILE = Runner/Info.plist; 498 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 499 | LIBRARY_SEARCH_PATHS = ( 500 | "$(inherited)", 501 | "$(PROJECT_DIR)/Flutter", 502 | ); 503 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 506 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 507 | SWIFT_VERSION = 5.0; 508 | VERSIONING_SYSTEM = "apple-generic"; 509 | }; 510 | name = Debug; 511 | }; 512 | 97C147071CF9000F007C117D /* Release */ = { 513 | isa = XCBuildConfiguration; 514 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 515 | buildSettings = { 516 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 517 | CLANG_ENABLE_MODULES = YES; 518 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 519 | ENABLE_BITCODE = NO; 520 | FRAMEWORK_SEARCH_PATHS = ( 521 | "$(inherited)", 522 | "$(PROJECT_DIR)/Flutter", 523 | ); 524 | INFOPLIST_FILE = Runner/Info.plist; 525 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 526 | LIBRARY_SEARCH_PATHS = ( 527 | "$(inherited)", 528 | "$(PROJECT_DIR)/Flutter", 529 | ); 530 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 531 | PRODUCT_NAME = "$(TARGET_NAME)"; 532 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 533 | SWIFT_VERSION = 5.0; 534 | VERSIONING_SYSTEM = "apple-generic"; 535 | }; 536 | name = Release; 537 | }; 538 | /* End XCBuildConfiguration section */ 539 | 540 | /* Begin XCConfigurationList section */ 541 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 97C147031CF9000F007C117D /* Debug */, 545 | 97C147041CF9000F007C117D /* Release */, 546 | 249021D3217E4FDB00AE95B9 /* Profile */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 552 | isa = XCConfigurationList; 553 | buildConfigurations = ( 554 | 97C147061CF9000F007C117D /* Debug */, 555 | 97C147071CF9000F007C117D /* Release */, 556 | 249021D4217E4FDB00AE95B9 /* Profile */, 557 | ); 558 | defaultConfigurationIsVisible = 0; 559 | defaultConfigurationName = Release; 560 | }; 561 | /* End XCConfigurationList section */ 562 | }; 563 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 564 | } 565 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 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 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/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/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold/admin_scaffold.dart'; 3 | import 'package:flutter_admin_scaffold_example/sample_pages/dashboard_page.dart'; 4 | import 'package:flutter_admin_scaffold_example/sample_pages/second_level_item_1_page.dart'; 5 | import 'package:flutter_admin_scaffold_example/sample_pages/second_level_item_2_page.dart'; 6 | import 'package:flutter_admin_scaffold_example/sample_pages/third_level_item_1_page.dart'; 7 | import 'package:flutter_admin_scaffold_example/sample_pages/third_level_item_2_page.dart'; 8 | 9 | void main() { 10 | runApp(MyApp()); 11 | } 12 | 13 | class MyApp extends StatefulWidget { 14 | @override 15 | _MyAppState createState() => _MyAppState(); 16 | } 17 | 18 | class _MyAppState extends State { 19 | static const MaterialColor themeBlack = MaterialColor( 20 | _themeBlackPrimaryValue, 21 | { 22 | 50: Color(_themeBlackPrimaryValue), 23 | 100: Color(_themeBlackPrimaryValue), 24 | 200: Color(_themeBlackPrimaryValue), 25 | 300: Color(_themeBlackPrimaryValue), 26 | 400: Color(_themeBlackPrimaryValue), 27 | 500: Color(_themeBlackPrimaryValue), 28 | 600: Color(_themeBlackPrimaryValue), 29 | 700: Color(_themeBlackPrimaryValue), 30 | 800: Color(_themeBlackPrimaryValue), 31 | 900: Color(_themeBlackPrimaryValue), 32 | }, 33 | ); 34 | static const int _themeBlackPrimaryValue = 0xFF222222; 35 | static const Color themeTextPrimary = Color(0xFF9D9D9D); 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return MaterialApp( 40 | debugShowCheckedModeBanner: false, 41 | title: 'Sample', 42 | theme: ThemeData( 43 | primarySwatch: themeBlack, 44 | textTheme: Theme.of(context).textTheme.apply( 45 | bodyColor: themeBlack, 46 | ), 47 | primaryTextTheme: Theme.of(context).textTheme.apply( 48 | bodyColor: themeTextPrimary, 49 | ), 50 | primaryIconTheme: IconThemeData( 51 | color: themeTextPrimary, 52 | ), 53 | visualDensity: VisualDensity.adaptivePlatformDensity, 54 | ), 55 | onGenerateRoute: (settings) { 56 | final page = _getPageWidget(settings); 57 | if (page != null) { 58 | return PageRouteBuilder( 59 | settings: settings, 60 | pageBuilder: (_, __, ___) => page, 61 | transitionsBuilder: (_, anim, __, child) { 62 | return FadeTransition( 63 | opacity: anim, 64 | child: child, 65 | ); 66 | }); 67 | } 68 | return null; 69 | }, 70 | ); 71 | } 72 | 73 | Widget? _getPageWidget(RouteSettings settings) { 74 | if (settings.name == null) { 75 | return null; 76 | } 77 | final uri = Uri.parse(settings.name!); 78 | switch (uri.path) { 79 | case '/': 80 | return DashboardPage(); 81 | case '/secondLevelItem1': 82 | return SecondLevelItem1Page(); 83 | case '/secondLevelItem2': 84 | return SecondLevelItem2Page(); 85 | case '/thirdLevelItem1': 86 | return ThirdLevelItem1Page(); 87 | case '/thirdLevelItem2': 88 | return ThirdLevelItem2Page(); 89 | } 90 | return null; 91 | } 92 | } 93 | 94 | class MyScaffold extends StatelessWidget { 95 | const MyScaffold({ 96 | Key? key, 97 | required this.route, 98 | required this.body, 99 | }) : super(key: key); 100 | 101 | final Widget body; 102 | final String route; 103 | 104 | final List _sideBarItems = const [ 105 | AdminMenuItem( 106 | title: 'Dashboard', 107 | route: '/', 108 | icon: Icons.dashboard, 109 | ), 110 | AdminMenuItem( 111 | title: 'Top Level', 112 | icon: Icons.file_copy, 113 | children: [ 114 | AdminMenuItem( 115 | title: 'Second Level Item 1', 116 | route: '/secondLevelItem1', 117 | ), 118 | AdminMenuItem( 119 | title: 'Second Level Item 2', 120 | route: '/secondLevelItem2', 121 | ), 122 | AdminMenuItem( 123 | title: 'Third Level', 124 | children: [ 125 | AdminMenuItem( 126 | title: 'Third Level Item 1', 127 | route: '/thirdLevelItem1', 128 | ), 129 | AdminMenuItem( 130 | title: 'Third Level Item 2', 131 | route: '/thirdLevelItem2', 132 | icon: Icons.image, 133 | ), 134 | ], 135 | ), 136 | ], 137 | ), 138 | ]; 139 | 140 | final List _adminMenuItems = const [ 141 | AdminMenuItem( 142 | title: 'User Profile', 143 | icon: Icons.account_circle, 144 | route: '/', 145 | ), 146 | AdminMenuItem( 147 | title: 'Settings', 148 | icon: Icons.settings, 149 | route: '/', 150 | ), 151 | AdminMenuItem( 152 | title: 'Logout', 153 | icon: Icons.logout, 154 | route: '/', 155 | ), 156 | ]; 157 | 158 | @override 159 | Widget build(BuildContext context) { 160 | return AdminScaffold( 161 | backgroundColor: Colors.white, 162 | leadingIcon: Icon(Icons.menu), 163 | appBar: AppBar( 164 | title: const Text('Sample'), 165 | actions: [ 166 | PopupMenuButton( 167 | child: const Icon(Icons.account_circle), 168 | itemBuilder: (context) { 169 | return _adminMenuItems.map((AdminMenuItem item) { 170 | return PopupMenuItem( 171 | value: item, 172 | child: Row( 173 | children: [ 174 | Icon(item.icon), 175 | Padding( 176 | padding: const EdgeInsets.only(left: 8.0), 177 | child: Text( 178 | item.title, 179 | style: const TextStyle( 180 | fontSize: 14, 181 | ), 182 | ), 183 | ), 184 | ], 185 | ), 186 | ); 187 | }).toList(); 188 | }, 189 | onSelected: (item) { 190 | print( 191 | 'actions: onSelected(): title = ${item.title}, route = ${item.route}'); 192 | Navigator.of(context).pushNamed(item.route!); 193 | }, 194 | ), 195 | ], 196 | ), 197 | sideBar: SideBar( 198 | backgroundColor: const Color(0xFFEEEEEE), 199 | activeBackgroundColor: Colors.black26, 200 | borderColor: const Color(0xFFE7E7E7), 201 | iconColor: Colors.black87, 202 | activeIconColor: Colors.blue, 203 | textStyle: const TextStyle( 204 | color: Color(0xFF337ab7), 205 | fontSize: 13, 206 | ), 207 | activeTextStyle: const TextStyle( 208 | color: Colors.white, 209 | fontSize: 13, 210 | ), 211 | items: _sideBarItems, 212 | selectedRoute: route, 213 | onSelected: (item) { 214 | print( 215 | 'sideBar: onTap(): title = ${item.title}, route = ${item.route}'); 216 | if (item.route != null && item.route != route) { 217 | Navigator.of(context).pushNamed(item.route!); 218 | } 219 | }, 220 | header: Container( 221 | height: 50, 222 | width: double.infinity, 223 | color: const Color(0xff444444), 224 | child: const Center( 225 | child: Text( 226 | 'header', 227 | style: TextStyle( 228 | color: Colors.white, 229 | ), 230 | ), 231 | ), 232 | ), 233 | footer: Container( 234 | height: 50, 235 | width: double.infinity, 236 | color: const Color(0xff444444), 237 | child: const Center( 238 | child: Text( 239 | 'footer', 240 | style: TextStyle( 241 | color: Colors.white, 242 | ), 243 | ), 244 | ), 245 | ), 246 | ), 247 | body: SingleChildScrollView( 248 | child: body, 249 | ), 250 | ); 251 | } 252 | } 253 | -------------------------------------------------------------------------------- /example/lib/sample.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold/admin_scaffold.dart'; 3 | 4 | class SamplePage extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return AdminScaffold( 8 | backgroundColor: Colors.white, 9 | leadingIcon: Icon(Icons.menu), 10 | appBar: AppBar( 11 | title: const Text('Sample'), 12 | ), 13 | sideBar: SideBar( 14 | items: const [ 15 | AdminMenuItem( 16 | title: 'Dashboard', 17 | route: '/', 18 | icon: Icons.dashboard, 19 | ), 20 | AdminMenuItem( 21 | title: 'Top Level', 22 | icon: Icons.file_copy, 23 | children: [ 24 | AdminMenuItem( 25 | title: 'Second Level Item 1', 26 | route: '/secondLevelItem1', 27 | ), 28 | AdminMenuItem( 29 | title: 'Second Level Item 2', 30 | route: '/secondLevelItem2', 31 | ), 32 | AdminMenuItem( 33 | title: 'Third Level', 34 | children: [ 35 | AdminMenuItem( 36 | title: 'Third Level Item 1', 37 | route: '/thirdLevelItem1', 38 | ), 39 | AdminMenuItem( 40 | title: 'Third Level Item 2', 41 | route: '/thirdLevelItem2', 42 | ), 43 | ], 44 | ), 45 | ], 46 | ), 47 | ], 48 | selectedRoute: '/', 49 | onSelected: (item) { 50 | if (item.route != null) { 51 | Navigator.of(context).pushNamed(item.route!); 52 | } 53 | }, 54 | header: Container( 55 | height: 50, 56 | width: double.infinity, 57 | color: const Color(0xff444444), 58 | child: const Center( 59 | child: Text( 60 | 'header', 61 | style: TextStyle( 62 | color: Colors.white, 63 | ), 64 | ), 65 | ), 66 | ), 67 | footer: Container( 68 | height: 50, 69 | width: double.infinity, 70 | color: const Color(0xff444444), 71 | child: const Center( 72 | child: Text( 73 | 'footer', 74 | style: TextStyle( 75 | color: Colors.white, 76 | ), 77 | ), 78 | ), 79 | ), 80 | ), 81 | body: SingleChildScrollView( 82 | child: Container( 83 | alignment: Alignment.topLeft, 84 | padding: const EdgeInsets.all(10), 85 | child: const Text( 86 | 'Dashboard', 87 | style: TextStyle( 88 | fontWeight: FontWeight.w700, 89 | fontSize: 36, 90 | ), 91 | ), 92 | ), 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /example/lib/sample_pages/dashboard_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold_example/main.dart'; 3 | 4 | class DashboardPage extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MyScaffold( 8 | route: '/', 9 | body: Container( 10 | alignment: Alignment.topLeft, 11 | padding: const EdgeInsets.all(10), 12 | child: Text( 13 | 'Dashboard', 14 | style: TextStyle( 15 | fontWeight: FontWeight.w700, 16 | fontSize: 36, 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/lib/sample_pages/second_level_item_1_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold_example/main.dart'; 3 | 4 | class SecondLevelItem1Page extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MyScaffold( 8 | route: '/secondLevelItem1', 9 | body: Container( 10 | alignment: Alignment.topLeft, 11 | padding: const EdgeInsets.all(10), 12 | child: Text( 13 | 'Second Level Item 1', 14 | style: TextStyle( 15 | fontWeight: FontWeight.w700, 16 | fontSize: 36, 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/lib/sample_pages/second_level_item_2_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold_example/main.dart'; 3 | 4 | class SecondLevelItem2Page extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MyScaffold( 8 | route: '/secondLevelItem2', 9 | body: Container( 10 | alignment: Alignment.topLeft, 11 | padding: const EdgeInsets.all(10), 12 | child: Text( 13 | 'Second Level Item 2', 14 | style: TextStyle( 15 | fontWeight: FontWeight.w700, 16 | fontSize: 36, 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/lib/sample_pages/third_level_item_1_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold_example/main.dart'; 3 | 4 | class ThirdLevelItem1Page extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MyScaffold( 8 | route: '/thirdLevelItem1', 9 | body: Container( 10 | alignment: Alignment.topLeft, 11 | padding: const EdgeInsets.all(10), 12 | child: Text( 13 | 'Third Level Item 1', 14 | style: TextStyle( 15 | fontWeight: FontWeight.w700, 16 | fontSize: 36, 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/lib/sample_pages/third_level_item_2_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_admin_scaffold_example/main.dart'; 3 | 4 | class ThirdLevelItem2Page extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return MyScaffold( 8 | route: '/thirdLevelItem2', 9 | body: Container( 10 | alignment: Alignment.topLeft, 11 | padding: const EdgeInsets.all(10), 12 | child: Text( 13 | 'Third Level Item 2', 14 | style: TextStyle( 15 | fontWeight: FontWeight.w700, 16 | fontSize: 36, 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.5" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_admin_scaffold: 66 | dependency: "direct main" 67 | description: 68 | path: ".." 69 | relative: true 70 | source: path 71 | version: "1.4.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | js: 78 | dependency: transitive 79 | description: 80 | name: js 81 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 82 | url: "https://pub.dev" 83 | source: hosted 84 | version: "0.6.5" 85 | matcher: 86 | dependency: transitive 87 | description: 88 | name: matcher 89 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "0.12.13" 93 | material_color_utilities: 94 | dependency: transitive 95 | description: 96 | name: material_color_utilities 97 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "0.2.0" 101 | meta: 102 | dependency: transitive 103 | description: 104 | name: meta 105 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "1.8.0" 109 | path: 110 | dependency: transitive 111 | description: 112 | name: path 113 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "1.8.2" 117 | sky_engine: 118 | dependency: transitive 119 | description: flutter 120 | source: sdk 121 | version: "0.0.99" 122 | source_span: 123 | dependency: transitive 124 | description: 125 | name: source_span 126 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 127 | url: "https://pub.dev" 128 | source: hosted 129 | version: "1.9.1" 130 | stack_trace: 131 | dependency: transitive 132 | description: 133 | name: stack_trace 134 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 135 | url: "https://pub.dev" 136 | source: hosted 137 | version: "1.11.0" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "2.1.1" 146 | string_scanner: 147 | dependency: transitive 148 | description: 149 | name: string_scanner 150 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.2.0" 154 | term_glyph: 155 | dependency: transitive 156 | description: 157 | name: term_glyph 158 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.2.1" 162 | test_api: 163 | dependency: transitive 164 | description: 165 | name: test_api 166 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "0.4.16" 170 | vector_math: 171 | dependency: transitive 172 | description: 173 | name: vector_math 174 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "2.1.4" 178 | sdks: 179 | dart: ">=2.18.0 <3.0.0" 180 | flutter: ">=3.3.0" 181 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_admin_scaffold_example 2 | description: Demonstrates how to use the flutter_admin_scaffold plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=2.12.0 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | flutter_admin_scaffold: 16 | # When depending on this package from a real application you should use: 17 | # flutter_admin_scaffold: ^x.y.z 18 | # See https://dart.dev/tools/pub/dependencies#version-constraints 19 | # The example app is bundled with the plugin so we use a path dependency on 20 | # the parent directory to use the current plugin's version. 21 | path: ../ 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: ^1.0.0 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | 31 | # For information on the generic Dart part of this file, see the 32 | # following page: https://dart.dev/tools/pub/pubspec 33 | 34 | # The following section is specific to Flutter. 35 | flutter: 36 | 37 | # The following line ensures that the Material Icons font is 38 | # included with your application, so that you can use the icons in 39 | # the material Icons class. 40 | uses-material-design: true 41 | 42 | # To add assets to your application, add an assets section, like this: 43 | # assets: 44 | # - images/a_dot_burr.jpeg 45 | # - images/a_dot_ham.jpeg 46 | 47 | # An image asset can refer to one or more resolution-specific "variants", see 48 | # https://flutter.dev/assets-and-images/#resolution-aware. 49 | 50 | # For details regarding adding assets from package dependencies, see 51 | # https://flutter.dev/assets-and-images/#from-packages 52 | 53 | # To add custom fonts to your application, add a fonts section here, 54 | # in this "flutter" section. Each entry in this list should have a 55 | # "family" key with the font family name, and a "fonts" key with a 56 | # list giving the asset and other descriptors for the font. For 57 | # example: 58 | # fonts: 59 | # - family: Schyler 60 | # fonts: 61 | # - asset: fonts/Schyler-Regular.ttf 62 | # - asset: fonts/Schyler-Italic.ttf 63 | # style: italic 64 | # - family: Trajan Pro 65 | # fonts: 66 | # - asset: fonts/TrajanPro.ttf 67 | # - asset: fonts/TrajanPro_Bold.ttf 68 | # weight: 700 69 | # 70 | # For details regarding fonts from package dependencies, 71 | # see https://flutter.dev/custom-fonts/#from-packages 72 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keyber-inc/flutter_admin_scaffold/557ecebf909f32af0f42ca3539231e5f1e13dbf2/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | example 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /flutter_admin_scaffold.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /lib/admin_scaffold.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'src/side_bar.dart'; 4 | 5 | export 'src/admin_menu_item.dart'; 6 | export 'src/side_bar.dart'; 7 | 8 | class AdminScaffold extends StatefulWidget { 9 | const AdminScaffold({ 10 | Key? key, 11 | this.appBar, 12 | this.sideBar, 13 | this.leadingIcon, 14 | required this.body, 15 | this.backgroundColor, 16 | this.mobileThreshold = 768.0, 17 | }) : super(key: key); 18 | 19 | final AppBar? appBar; 20 | final SideBar? sideBar; 21 | final Widget? leadingIcon; 22 | final Widget body; 23 | final Color? backgroundColor; 24 | final double mobileThreshold; 25 | @override 26 | _AdminScaffoldState createState() => _AdminScaffoldState(); 27 | } 28 | 29 | class _AdminScaffoldState extends State 30 | with SingleTickerProviderStateMixin { 31 | late AppBar? _appBar; 32 | late AnimationController _animationController; 33 | late Animation _animation; 34 | bool _isMobile = false; 35 | bool _isOpenSidebar = false; 36 | bool _canDragged = false; 37 | double _screenWidth = 0; 38 | 39 | @override 40 | void initState() { 41 | super.initState(); 42 | _appBar = _buildAppBar(widget.appBar, widget.sideBar, widget.leadingIcon); 43 | _animationController = AnimationController( 44 | vsync: this, 45 | duration: Duration(milliseconds: 300), 46 | ); 47 | _animation = CurvedAnimation( 48 | parent: _animationController, 49 | curve: Curves.easeInOutQuad, 50 | ); 51 | } 52 | 53 | @override 54 | void didChangeDependencies() { 55 | super.didChangeDependencies(); 56 | final mediaQuery = MediaQuery.of(context); 57 | if (_screenWidth == mediaQuery.size.width) { 58 | return; 59 | } 60 | 61 | setState(() { 62 | _isMobile = mediaQuery.size.width < widget.mobileThreshold; 63 | _isOpenSidebar = !_isMobile; 64 | _animationController.value = _isMobile ? 0 : 1; 65 | _screenWidth = mediaQuery.size.width; 66 | }); 67 | } 68 | 69 | @override 70 | void dispose() { 71 | _animationController.dispose(); 72 | super.dispose(); 73 | } 74 | 75 | void _toggleSidebar() { 76 | setState(() { 77 | _isOpenSidebar = !_isOpenSidebar; 78 | if (_isOpenSidebar) 79 | _animationController.forward(); 80 | else 81 | _animationController.reverse(); 82 | }); 83 | } 84 | 85 | void _onDragStart(DragStartDetails details) { 86 | final isClosed = _animationController.isDismissed; 87 | final isOpen = _animationController.isCompleted; 88 | _canDragged = (isClosed && details.globalPosition.dx < 60) || isOpen; 89 | } 90 | 91 | void _onDragUpdate(DragUpdateDetails details) { 92 | if (_canDragged) { 93 | final delta = 94 | (details.primaryDelta ?? 0.0) / (widget.sideBar?.width ?? 1.0); 95 | _animationController.value += delta; 96 | } 97 | } 98 | 99 | void _dragCloseDrawer(DragUpdateDetails details) { 100 | final delta = details.primaryDelta ?? 0.0; 101 | if (delta < 0) { 102 | _isOpenSidebar = false; 103 | _animationController.reverse(); 104 | } 105 | } 106 | 107 | void _onDragEnd(DragEndDetails details) async { 108 | final minFlingVelocity = 365.0; 109 | 110 | if (details.velocity.pixelsPerSecond.dx.abs() >= minFlingVelocity) { 111 | final visualVelocity = 112 | details.velocity.pixelsPerSecond.dx / (widget.sideBar?.width ?? 1.0); 113 | 114 | await _animationController.fling(velocity: visualVelocity); 115 | if (_animationController.isCompleted) { 116 | setState(() { 117 | _isOpenSidebar = true; 118 | }); 119 | } else { 120 | setState(() { 121 | _isOpenSidebar = false; 122 | }); 123 | } 124 | } else { 125 | if (_animationController.value < 0.5) { 126 | _animationController.reverse(); 127 | setState(() { 128 | _isOpenSidebar = false; 129 | }); 130 | } else { 131 | _animationController.forward(); 132 | setState(() { 133 | _isOpenSidebar = true; 134 | }); 135 | } 136 | } 137 | } 138 | 139 | @override 140 | Widget build(BuildContext context) { 141 | return Scaffold( 142 | backgroundColor: widget.backgroundColor, 143 | appBar: _appBar, 144 | body: AnimatedBuilder( 145 | animation: _animation, 146 | builder: (_, __) => widget.sideBar == null 147 | ? Row( 148 | children: [ 149 | Expanded( 150 | child: Align( 151 | alignment: Alignment.topCenter, 152 | child: widget.body, 153 | ), 154 | ), 155 | ], 156 | ) 157 | : _isMobile 158 | ? Stack( 159 | children: [ 160 | GestureDetector( 161 | onHorizontalDragStart: _onDragStart, 162 | onHorizontalDragUpdate: _onDragUpdate, 163 | onHorizontalDragEnd: _onDragEnd, 164 | ), 165 | widget.body, 166 | if (_animation.value > 0) 167 | Container( 168 | color: Colors.black 169 | .withAlpha((150 * _animation.value).toInt()), 170 | ), 171 | if (_animation.value == 1) 172 | GestureDetector( 173 | onTap: _toggleSidebar, 174 | onHorizontalDragUpdate: _dragCloseDrawer, 175 | ), 176 | ClipRect( 177 | child: SizedOverflowBox( 178 | size: Size( 179 | (widget.sideBar?.width ?? 1.0) * _animation.value, 180 | double.infinity), 181 | child: widget.sideBar, 182 | ), 183 | ), 184 | ], 185 | ) 186 | : Row( 187 | children: [ 188 | widget.sideBar != null 189 | ? ClipRect( 190 | child: SizedOverflowBox( 191 | size: Size( 192 | (widget.sideBar?.width ?? 1.0) * 193 | _animation.value, 194 | double.infinity), 195 | child: widget.sideBar, 196 | ), 197 | ) 198 | : SizedBox(), 199 | Expanded( 200 | child: Align( 201 | alignment: Alignment.topCenter, 202 | child: widget.body, 203 | ), 204 | ), 205 | ], 206 | ), 207 | ), 208 | ); 209 | } 210 | 211 | AppBar? _buildAppBar(AppBar? appBar, SideBar? sideBar, Widget? leadingIcon) { 212 | if (appBar == null) { 213 | return null; 214 | } 215 | 216 | final leading = sideBar != null 217 | ? IconButton( 218 | icon: leadingIcon ?? const Icon(Icons.menu), 219 | onPressed: _toggleSidebar, 220 | ) 221 | : appBar.leading; 222 | final shadowColor = appBar.shadowColor ?? Colors.transparent; 223 | 224 | return AppBar( 225 | leading: leading, 226 | automaticallyImplyLeading: appBar.automaticallyImplyLeading, 227 | title: appBar.title, 228 | actions: appBar.actions, 229 | flexibleSpace: appBar.flexibleSpace, 230 | bottom: appBar.bottom, 231 | elevation: appBar.elevation, 232 | scrolledUnderElevation: appBar.scrolledUnderElevation, 233 | notificationPredicate: appBar.notificationPredicate, 234 | shadowColor: shadowColor, 235 | surfaceTintColor: appBar.surfaceTintColor, 236 | shape: appBar.shape, 237 | backgroundColor: appBar.backgroundColor, 238 | foregroundColor: appBar.foregroundColor, 239 | iconTheme: appBar.iconTheme, 240 | actionsIconTheme: appBar.actionsIconTheme, 241 | primary: appBar.primary, 242 | centerTitle: appBar.centerTitle ?? false, 243 | excludeHeaderSemantics: appBar.excludeHeaderSemantics, 244 | titleSpacing: appBar.titleSpacing, 245 | toolbarOpacity: appBar.toolbarOpacity, 246 | bottomOpacity: appBar.bottomOpacity, 247 | toolbarHeight: appBar.toolbarHeight, 248 | leadingWidth: appBar.leadingWidth, 249 | toolbarTextStyle: appBar.toolbarTextStyle, 250 | titleTextStyle: appBar.titleTextStyle, 251 | systemOverlayStyle: appBar.systemOverlayStyle, 252 | ); 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /lib/src/admin_menu_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AdminMenuItem { 4 | const AdminMenuItem({ 5 | required this.title, 6 | this.route, 7 | this.icon, 8 | this.children = const [], 9 | }); 10 | 11 | final String title; 12 | final String? route; 13 | final IconData? icon; 14 | final List children; 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/side_bar.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'admin_menu_item.dart'; 6 | import 'side_bar_item.dart'; 7 | 8 | class SideBar extends StatefulWidget { 9 | const SideBar({ 10 | Key? key, 11 | required this.items, 12 | required this.selectedRoute, 13 | this.onSelected, 14 | this.width = 240.0, 15 | this.iconColor, 16 | this.activeIconColor, 17 | this.textStyle = const TextStyle( 18 | color: Color(0xFF337ab7), 19 | fontSize: 12, 20 | ), 21 | this.activeTextStyle = const TextStyle( 22 | color: Color(0xFF337ab7), 23 | fontSize: 12, 24 | ), 25 | this.backgroundColor = const Color(0xFFEEEEEE), 26 | this.activeBackgroundColor = const Color(0xFFE7E7E7), 27 | this.borderColor = const Color(0xFFE7E7E7), 28 | this.scrollController, 29 | this.header, 30 | this.footer, 31 | }) : super(key: key); 32 | 33 | final List items; 34 | final String selectedRoute; 35 | final void Function(AdminMenuItem item)? onSelected; 36 | final double width; 37 | final Color? iconColor; 38 | final Color? activeIconColor; 39 | final TextStyle textStyle; 40 | final TextStyle activeTextStyle; 41 | final Color backgroundColor; 42 | final Color activeBackgroundColor; 43 | final Color borderColor; 44 | final ScrollController? scrollController; 45 | final Widget? header; 46 | final Widget? footer; 47 | 48 | @override 49 | _SideBarState createState() => _SideBarState(); 50 | } 51 | 52 | class _SideBarState extends State with SingleTickerProviderStateMixin { 53 | late double _sideBarWidth; 54 | late Widget _child; 55 | 56 | @override 57 | void initState() { 58 | super.initState(); 59 | _sideBarWidth = widget.width; 60 | _child = Column( 61 | children: [ 62 | if (widget.header != null) widget.header!, 63 | Expanded( 64 | child: Material( 65 | color: widget.backgroundColor, 66 | child: ListView.builder( 67 | itemBuilder: (BuildContext context, int index) { 68 | return SideBarItem( 69 | items: widget.items, 70 | index: index, 71 | onSelected: widget.onSelected, 72 | selectedRoute: widget.selectedRoute, 73 | depth: 0, 74 | iconColor: widget.iconColor, 75 | activeIconColor: widget.activeIconColor, 76 | textStyle: widget.textStyle, 77 | activeTextStyle: widget.activeTextStyle, 78 | backgroundColor: widget.backgroundColor, 79 | activeBackgroundColor: widget.activeBackgroundColor, 80 | borderColor: widget.borderColor, 81 | ); 82 | }, 83 | itemCount: widget.items.length, 84 | controller: widget.scrollController ?? ScrollController(), 85 | ), 86 | ), 87 | ), 88 | if (widget.footer != null) widget.footer!, 89 | ], 90 | ); 91 | } 92 | 93 | @override 94 | void didChangeDependencies() { 95 | super.didChangeDependencies(); 96 | final mediaQuery = MediaQuery.of(context); 97 | _sideBarWidth = min(mediaQuery.size.width * 0.7, widget.width); 98 | } 99 | 100 | @override 101 | Widget build(BuildContext context) { 102 | return Container( 103 | width: _sideBarWidth, 104 | child: _child, 105 | ); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /lib/src/side_bar_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'admin_menu_item.dart'; 4 | 5 | class SideBarItem extends StatelessWidget { 6 | const SideBarItem({ 7 | required this.items, 8 | required this.index, 9 | this.onSelected, 10 | required this.selectedRoute, 11 | this.depth = 0, 12 | this.iconColor, 13 | this.activeIconColor, 14 | required this.textStyle, 15 | required this.activeTextStyle, 16 | required this.backgroundColor, 17 | required this.activeBackgroundColor, 18 | required this.borderColor, 19 | }); 20 | 21 | final List items; 22 | final int index; 23 | final void Function(AdminMenuItem item)? onSelected; 24 | final String selectedRoute; 25 | final int depth; 26 | final Color? iconColor; 27 | final Color? activeIconColor; 28 | final TextStyle textStyle; 29 | final TextStyle activeTextStyle; 30 | final Color backgroundColor; 31 | final Color activeBackgroundColor; 32 | final Color borderColor; 33 | bool get isLast => index == items.length - 1; 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | if (depth > 0 && isLast) { 38 | return _buildTiles(context, items[index]); 39 | } 40 | return Container( 41 | decoration: BoxDecoration( 42 | border: Border( 43 | bottom: BorderSide( 44 | color: borderColor, 45 | ), 46 | ), 47 | ), 48 | child: _buildTiles(context, items[index]), 49 | ); 50 | } 51 | 52 | Widget _buildTiles(BuildContext context, AdminMenuItem item) { 53 | bool selected = _isSelected(selectedRoute, [item]); 54 | 55 | if (item.children.isEmpty) { 56 | return ListTile( 57 | contentPadding: _getTilePadding(depth), 58 | leading: _buildIcon(item.icon, selected), 59 | title: _buildTitle(item.title, selected), 60 | selected: selected, 61 | tileColor: backgroundColor, 62 | selectedTileColor: activeBackgroundColor, 63 | onTap: () { 64 | if (onSelected != null) { 65 | onSelected!(item); 66 | } 67 | }, 68 | ); 69 | } 70 | 71 | int index = 0; 72 | final childrenTiles = item.children.map((child) { 73 | return SideBarItem( 74 | items: item.children, 75 | index: index++, 76 | onSelected: onSelected, 77 | selectedRoute: selectedRoute, 78 | depth: depth + 1, 79 | iconColor: iconColor, 80 | activeIconColor: activeIconColor, 81 | textStyle: textStyle, 82 | activeTextStyle: activeTextStyle, 83 | backgroundColor: backgroundColor, 84 | activeBackgroundColor: activeBackgroundColor, 85 | borderColor: borderColor, 86 | ); 87 | }).toList(); 88 | 89 | return Theme( 90 | data: Theme.of(context).copyWith(dividerColor: Colors.transparent), 91 | child: ExpansionTile( 92 | tilePadding: _getTilePadding(depth), 93 | leading: _buildIcon(item.icon), 94 | title: _buildTitle(item.title), 95 | initiallyExpanded: selected, 96 | children: childrenTiles, 97 | ), 98 | ); 99 | } 100 | 101 | bool _isSelected(String route, List items) { 102 | for (final item in items) { 103 | if (item.route == route) { 104 | return true; 105 | } 106 | if (item.children.isNotEmpty) { 107 | return _isSelected(route, item.children); 108 | } 109 | } 110 | return false; 111 | } 112 | 113 | Widget _buildIcon(IconData? icon, [bool selected = false]) { 114 | return icon != null 115 | ? Icon( 116 | icon, 117 | size: 22, 118 | color: selected 119 | ? activeIconColor != null 120 | ? activeIconColor 121 | : activeTextStyle.color 122 | : iconColor != null 123 | ? iconColor 124 | : textStyle.color, 125 | ) 126 | : SizedBox(); 127 | } 128 | 129 | Widget _buildTitle(String title, [bool selected = false]) { 130 | return Text( 131 | title, 132 | style: selected ? activeTextStyle : textStyle, 133 | ); 134 | } 135 | 136 | EdgeInsets _getTilePadding(int depth) { 137 | return EdgeInsets.only( 138 | left: 10.0 + 10.0 * depth, 139 | right: 10.0, 140 | ); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | characters: 5 | dependency: transitive 6 | description: 7 | name: characters 8 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "1.2.1" 12 | collection: 13 | dependency: transitive 14 | description: 15 | name: collection 16 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "1.17.0" 20 | flutter: 21 | dependency: "direct main" 22 | description: flutter 23 | source: sdk 24 | version: "0.0.0" 25 | js: 26 | dependency: transitive 27 | description: 28 | name: js 29 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 30 | url: "https://pub.dev" 31 | source: hosted 32 | version: "0.6.5" 33 | material_color_utilities: 34 | dependency: transitive 35 | description: 36 | name: material_color_utilities 37 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 38 | url: "https://pub.dev" 39 | source: hosted 40 | version: "0.2.0" 41 | meta: 42 | dependency: transitive 43 | description: 44 | name: meta 45 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 46 | url: "https://pub.dev" 47 | source: hosted 48 | version: "1.8.0" 49 | sky_engine: 50 | dependency: transitive 51 | description: flutter 52 | source: sdk 53 | version: "0.0.99" 54 | vector_math: 55 | dependency: transitive 56 | description: 57 | name: vector_math 58 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 59 | url: "https://pub.dev" 60 | source: hosted 61 | version: "2.1.4" 62 | sdks: 63 | dart: ">=2.18.0 <3.0.0" 64 | flutter: ">=3.3.0" 65 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_admin_scaffold 2 | description: A scaffold class with a sideBar that works with a appBar. 3 | version: 1.4.0 4 | homepage: https://github.com/keyber-inc/flutter_admin_scaffold 5 | 6 | environment: 7 | sdk: ">=2.18.0 <3.0.0" 8 | flutter: ">=3.3.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | -------------------------------------------------------------------------------- /test/flutter_admin_scaffold_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | --------------------------------------------------------------------------------