├── material_sheets
├── android
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ ├── app
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── materialsheets
│ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── settings.gradle
│ ├── build.gradle
│ ├── gradlew.bat
│ └── gradlew
├── ios
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── 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-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Info.plist
│ │ └── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ └── .gitignore
├── .gitignore
├── README.md
├── lib
│ ├── demos
│ │ ├── materialDemos.dart
│ │ ├── otherDemos.dart
│ │ └── flutterGalleryDemos.dart
│ ├── main.dart
│ └── materialSheet.dart
├── .idea
│ ├── libraries
│ │ ├── Flutter_Plugins.xml
│ │ ├── Flutter_for_Android.xml
│ │ ├── Dart_SDK.xml
│ │ └── Dart_Packages.xml
│ ├── runConfigurations
│ │ └── main_dart.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── codeStyles
│ │ └── Project.xml
│ └── workspace.xml
├── .metadata
├── material_sheets.iml
├── material_sheets_android.iml
├── pubspec.yaml
└── pubspec.lock
└── README.md
/material_sheets/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/material_sheets/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/material_sheets/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/material_sheets/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/material_sheets/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/material_sheets/README.md:
--------------------------------------------------------------------------------
1 | # material_sheets
2 |
3 | A new Flutter application.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
--------------------------------------------------------------------------------
/material_sheets/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/material_sheets/lib/demos/materialDemos.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:material_sheets/materialSheet.dart';
3 |
4 | //TODO... implement some layouts that flutter has no yet implemented (like side sheets)
--------------------------------------------------------------------------------
/material_sheets/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/material_sheets/.idea/libraries/Flutter_Plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/b-cancel/Flutter_MaterialSheetAndNavigationDrawer/HEAD/material_sheets/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/material_sheets/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/material_sheets/.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: f9bb4289e9fd861d70ae78bcc3a042ef1b35cc9d
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/material_sheets/.idea/runConfigurations/main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/material_sheets/.idea/libraries/Flutter_for_Android.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/material_sheets/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.
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/material_sheets/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/kotlin/com/example/materialsheets/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.materialsheets
2 |
3 | import android.os.Bundle
4 |
5 | import io.flutter.app.FlutterActivity
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity(): FlutterActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | GeneratedPluginRegistrant.registerWith(this)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/material_sheets/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: [UIApplicationLaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/material_sheets/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 |
--------------------------------------------------------------------------------
/material_sheets/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/material_sheets/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 | .symlinks/
46 |
--------------------------------------------------------------------------------
/material_sheets/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.1.51'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.0.1'
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 |
--------------------------------------------------------------------------------
/material_sheets/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | //Demos
4 | import 'demos/flutterGalleryDemos.dart';
5 | import 'demos/materialDemos.dart';
6 | import 'demos/otherDemos.dart';
7 |
8 | //TODO.. materialApp plans for android slide down menu
9 |
10 | //-------------------------Main Functions For Testing-------------------------
11 |
12 | //---flutter gallery
13 | //void main() => runApp(new MaterialApp( home: new PersistentBottomSheet()));
14 | //void main() => runApp(new ModalBottomSheet());
15 | //void main() => runApp(new NavigationDrawer()); //TODO... complete demo
16 | //void main() => runApp(new ListDemo());
17 |
18 | //---material
19 |
20 | //---other
21 | //void main() => runApp(new MaterialSheetTestApp());
22 | void main() => runApp(new MaterialApp( home: new MultiSheets()));
23 |
--------------------------------------------------------------------------------
/material_sheets/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/material_sheets/material_sheets.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/material_sheets/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/material_sheets/.idea/misc.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/material_sheets/material_sheets_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/material_sheets/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | material_sheets
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
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 |
--------------------------------------------------------------------------------
/material_sheets/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 |
--------------------------------------------------------------------------------
/material_sheets/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/material_sheets/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 | apply plugin: 'com.android.application'
15 | apply plugin: 'kotlin-android'
16 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
17 |
18 | android {
19 | compileSdkVersion 27
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | lintOptions {
26 | disable 'InvalidPackage'
27 | }
28 |
29 | defaultConfig {
30 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
31 | applicationId "com.example.materialsheets"
32 | minSdkVersion 16
33 | targetSdkVersion 27
34 | versionCode 1
35 | versionName "1.0"
36 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
37 | }
38 |
39 | buildTypes {
40 | release {
41 | // TODO: Add your own signing config for the release build.
42 | // Signing with the debug keys for now, so `flutter run --release` works.
43 | signingConfig signingConfigs.debug
44 | }
45 | }
46 | }
47 |
48 | flutter {
49 | source '../..'
50 | }
51 |
52 | dependencies {
53 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
54 | testImplementation 'junit:junit:4.12'
55 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
56 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
57 | }
58 |
--------------------------------------------------------------------------------
/material_sheets/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: material_sheets
2 | description: A new Flutter application.
3 |
4 | dependencies:
5 | flutter:
6 | sdk: flutter
7 |
8 | # The following adds the Cupertino Icons font to your application.
9 | # Use with the CupertinoIcons class for iOS style icons.
10 | cupertino_icons: ^0.1.2
11 |
12 | dev_dependencies:
13 | flutter_test:
14 | sdk: flutter
15 |
16 |
17 | # For information on the generic Dart part of this file, see the
18 | # following page: https://www.dartlang.org/tools/pub/pubspec
19 |
20 | # The following section is specific to Flutter.
21 | flutter:
22 |
23 | # The following line ensures that the Material Icons font is
24 | # included with your application, so that you can use the icons in
25 | # the material Icons class.
26 | uses-material-design: true
27 |
28 | # To add assets to your application, add an assets section, like this:
29 | # assets:
30 | # - images/a_dot_burr.jpeg
31 | # - images/a_dot_ham.jpeg
32 |
33 | # An image asset can refer to one or more resolution-specific "variants", see
34 | # https://flutter.io/assets-and-images/#resolution-aware.
35 |
36 | # For details regarding adding assets from package dependencies, see
37 | # https://flutter.io/assets-and-images/#from-packages
38 |
39 | # To add custom fonts to your application, add a fonts section here,
40 | # in this "flutter" section. Each entry in this list should have a
41 | # "family" key with the font family name, and a "fonts" key with a
42 | # list giving the asset and other descriptors for the font. For
43 | # example:
44 | # fonts:
45 | # - family: Schyler
46 | # fonts:
47 | # - asset: fonts/Schyler-Regular.ttf
48 | # - asset: fonts/Schyler-Italic.ttf
49 | # style: italic
50 | # - family: Trajan Pro
51 | # fonts:
52 | # - asset: fonts/TrajanPro.ttf
53 | # - asset: fonts/TrajanPro_Bold.ttf
54 | # weight: 700
55 | #
56 | # For details regarding fonts from package dependencies,
57 | # see https://flutter.io/custom-fonts/#from-packages
58 |
--------------------------------------------------------------------------------
/material_sheets/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/material_sheets/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 |
--------------------------------------------------------------------------------
/material_sheets/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/material_sheets/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 |
--------------------------------------------------------------------------------
/material_sheets/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/material_sheets/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flutter_MaterialSheetAndNavigationDrawer
2 |
3 |
If this project helped you reduce developement time or you just want to help me continue making useful tools
4 | Feel free to buy me a cup of coffee! :)
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Purpose
18 |
19 | A Very Flexible Widget that can Implement Material Sheets (bottom, top, side) (modal and persistent)
20 |
21 | Features
22 |
23 | MULTIPLE SHEETS PER APP
24 |
25 | WIDGET PARAMETERS
26 | 1. app [required] -> the application that goes behind the sheet
27 | 2. sheet [required] -> the sheet that animates in or out of the screen
28 | 3. attachment -> an attachment to the sheet that is always on screen
29 |
30 | VARIABLE PARAMETERS
31 | 1. startOpen -> whether or not the sheet should startOpen (true, false)
32 | 2. position -> what edge the sheet is attached to (top, right, bottom, left)
33 | 3. type -> what type of sheet this is (modal, persistent)
34 | 4. placement -> where the attachment is placed relative to the screen edges (inside, outside)
35 | 5. backBtnClosesSheet -> whether or not the back button closes the sheet
36 | 6. backBtnClosesAnimated -> whether the back button closes the sheet animated or instantaneously
37 | 7. autoOpenOrCloseIndicator -> whether or not you should be shown whether you sheet will autoClose or autoOpen after you let go of it
38 | 8. swipeToOpen -> whether or not you can swipe the sheet to open (NOTE: if no attachment is specified you will swipe the edge of the screen to open)
39 | 9. swipeToClose -> whether or not you can swipe the sheet to close
40 | 10. maxAnimationTimeInMilliseconds -> how long the sheet takes to open or close if animated
41 | 11. indicatorAutoCloseColor -> the color that shows up when the sheet will auto close if let go [opacity matter]
42 | 12. scrimOpenColor -> the color of the scrim when using a modal sheet [opacity matters]
43 | 13. sheetMin -> the smallest the sheet can be
44 | 14. sheetMax -> the largest the sheet can be
45 | 15. textDirection -> the text direction inside of the sheet
46 |
47 | FUNCTIONS TO GRAB INFORMATION
48 | 1. getOpenPercent() -> get how open the sheet is [0.0 -> 1.0]
49 | 2. getAttachmentSize() -> get the width and height of the attachment
50 | 3. getSheetSize() -> get the width and height of the sheet
51 |
52 | FUNCTIONS TO RUN COMMANDS
53 | 1. toggleInstantaneous() -> toggle between opened and closed states with no animation
54 | 2. toggleAnimated() -> toggle between opened and closed states with animation
55 | 3. openInstantaneous() -> open the sheet instantly
56 | 4. openAnimated() -> open the sheet with an animation
57 | 5. closeInstantaneous() -> close the sheet instantly
58 | 6. closeAnimated() -> close the sheet with an animation
59 |
60 | Limitation
61 | I was not created to be performant.
62 | Modify my code if needed to suit your specific needs and get the best performance possible.
63 |
64 | How To
65 |
66 | ```
67 | import 'package:flutter/material.dart';
68 | import 'materialSheet.dart';
69 |
70 | void main() => runApp(new MaterialSheetTestApp());
71 |
72 | class MaterialSheetTestApp extends StatelessWidget {
73 |
74 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
75 |
76 | Sheet matSheet;
77 | getOpenPercent() => matSheet.functions.getOpenPercent();
78 | getSheetSize() => matSheet.functions.getSheetSize();
79 | getAttachmentSize() => matSheet.functions.getAttachmentSize();
80 | toggleInstant() => matSheet.functions.toggleInstantaneous();
81 | toggleAnim() => matSheet.functions.toggleAnimated();
82 | openInstant() => matSheet.functions.openInstantaneous();
83 | closeInstant() => matSheet.functions.closeInstantaneous();
84 | openAnim() => matSheet.functions.openAnimated();
85 | closeAnim() => matSheet.functions.closeAnimated();
86 |
87 | @override
88 | Widget build(BuildContext context) {
89 | matSheet = new Sheet(
90 | parameters: new Parameters(
91 | //-----Widgets
92 | app: new Container(
93 | child: new Center(
94 | child: new FlatButton(
95 | color: Colors.redAccent,
96 | onPressed: () => openAnim(),
97 | child: new Text("Press me to open the sheet"),
98 | ),
99 | ),
100 | ),
101 | sheet: new Container(
102 | color: Colors.yellowAccent,
103 | child: new Center(
104 | child: new Text(
105 | "Right Sheet",
106 | style: TextStyle(
107 | color: Colors.black,
108 | fontSize: 14.0,
109 | ),
110 | ),
111 | ),
112 | ),
113 | attachment: new Container(
114 | color: Colors.greenAccent,
115 | child: new Icon(
116 | Icons.attachment,
117 | color: Colors.white,
118 | ),
119 | ),
120 | //-----Other Vars
121 | position: sheetPosition.right,
122 | autoOpenOrCloseIndicator: true,
123 | placement: attachmentPlacement.inside,
124 | ),
125 | );
126 |
127 | return matSheet;
128 | }
129 | }
130 | ```
131 |
132 | Plans
133 |
134 | 1. lockSheet (opened, closed, false) [mutable]
135 | 2. sheetAffectsApp (resize, move, none) [mutable]
136 |
--------------------------------------------------------------------------------
/material_sheets/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile
3 | packages:
4 | analyzer:
5 | dependency: transitive
6 | description:
7 | name: analyzer
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "0.31.2-alpha.2"
11 | args:
12 | dependency: transitive
13 | description:
14 | name: args
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.4.3"
18 | async:
19 | dependency: transitive
20 | description:
21 | name: async
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.0.7"
25 | boolean_selector:
26 | dependency: transitive
27 | description:
28 | name: boolean_selector
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.0.3"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.1"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.14.6"
46 | convert:
47 | dependency: transitive
48 | description:
49 | name: convert
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "2.0.1"
53 | crypto:
54 | dependency: transitive
55 | description:
56 | name: crypto
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.0.3"
60 | csslib:
61 | dependency: transitive
62 | description:
63 | name: csslib
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "0.14.4"
67 | cupertino_icons:
68 | dependency: "direct main"
69 | description:
70 | name: cupertino_icons
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "0.1.2"
74 | flutter:
75 | dependency: "direct main"
76 | description: flutter
77 | source: sdk
78 | version: "0.0.0"
79 | flutter_test:
80 | dependency: "direct dev"
81 | description: flutter
82 | source: sdk
83 | version: "0.0.0"
84 | front_end:
85 | dependency: transitive
86 | description:
87 | name: front_end
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "0.1.0-alpha.12"
91 | glob:
92 | dependency: transitive
93 | description:
94 | name: glob
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.1.5"
98 | html:
99 | dependency: transitive
100 | description:
101 | name: html
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "0.13.3"
105 | http:
106 | dependency: transitive
107 | description:
108 | name: http
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "0.11.3+16"
112 | http_multi_server:
113 | dependency: transitive
114 | description:
115 | name: http_multi_server
116 | url: "https://pub.dartlang.org"
117 | source: hosted
118 | version: "2.0.4"
119 | http_parser:
120 | dependency: transitive
121 | description:
122 | name: http_parser
123 | url: "https://pub.dartlang.org"
124 | source: hosted
125 | version: "3.1.2"
126 | io:
127 | dependency: transitive
128 | description:
129 | name: io
130 | url: "https://pub.dartlang.org"
131 | source: hosted
132 | version: "0.3.2+1"
133 | js:
134 | dependency: transitive
135 | description:
136 | name: js
137 | url: "https://pub.dartlang.org"
138 | source: hosted
139 | version: "0.6.1"
140 | kernel:
141 | dependency: transitive
142 | description:
143 | name: kernel
144 | url: "https://pub.dartlang.org"
145 | source: hosted
146 | version: "0.3.0-alpha.12"
147 | logging:
148 | dependency: transitive
149 | description:
150 | name: logging
151 | url: "https://pub.dartlang.org"
152 | source: hosted
153 | version: "0.11.3+1"
154 | matcher:
155 | dependency: transitive
156 | description:
157 | name: matcher
158 | url: "https://pub.dartlang.org"
159 | source: hosted
160 | version: "0.12.2+1"
161 | meta:
162 | dependency: transitive
163 | description:
164 | name: meta
165 | url: "https://pub.dartlang.org"
166 | source: hosted
167 | version: "1.1.5"
168 | mime:
169 | dependency: transitive
170 | description:
171 | name: mime
172 | url: "https://pub.dartlang.org"
173 | source: hosted
174 | version: "0.9.6"
175 | multi_server_socket:
176 | dependency: transitive
177 | description:
178 | name: multi_server_socket
179 | url: "https://pub.dartlang.org"
180 | source: hosted
181 | version: "1.0.1"
182 | node_preamble:
183 | dependency: transitive
184 | description:
185 | name: node_preamble
186 | url: "https://pub.dartlang.org"
187 | source: hosted
188 | version: "1.4.1"
189 | package_config:
190 | dependency: transitive
191 | description:
192 | name: package_config
193 | url: "https://pub.dartlang.org"
194 | source: hosted
195 | version: "1.0.3"
196 | package_resolver:
197 | dependency: transitive
198 | description:
199 | name: package_resolver
200 | url: "https://pub.dartlang.org"
201 | source: hosted
202 | version: "1.0.2"
203 | path:
204 | dependency: transitive
205 | description:
206 | name: path
207 | url: "https://pub.dartlang.org"
208 | source: hosted
209 | version: "1.5.1"
210 | plugin:
211 | dependency: transitive
212 | description:
213 | name: plugin
214 | url: "https://pub.dartlang.org"
215 | source: hosted
216 | version: "0.2.0+2"
217 | pool:
218 | dependency: transitive
219 | description:
220 | name: pool
221 | url: "https://pub.dartlang.org"
222 | source: hosted
223 | version: "1.3.4"
224 | pub_semver:
225 | dependency: transitive
226 | description:
227 | name: pub_semver
228 | url: "https://pub.dartlang.org"
229 | source: hosted
230 | version: "1.4.1"
231 | quiver:
232 | dependency: transitive
233 | description:
234 | name: quiver
235 | url: "https://pub.dartlang.org"
236 | source: hosted
237 | version: "0.29.0+1"
238 | shelf:
239 | dependency: transitive
240 | description:
241 | name: shelf
242 | url: "https://pub.dartlang.org"
243 | source: hosted
244 | version: "0.7.3"
245 | shelf_packages_handler:
246 | dependency: transitive
247 | description:
248 | name: shelf_packages_handler
249 | url: "https://pub.dartlang.org"
250 | source: hosted
251 | version: "1.0.3"
252 | shelf_static:
253 | dependency: transitive
254 | description:
255 | name: shelf_static
256 | url: "https://pub.dartlang.org"
257 | source: hosted
258 | version: "0.2.7"
259 | shelf_web_socket:
260 | dependency: transitive
261 | description:
262 | name: shelf_web_socket
263 | url: "https://pub.dartlang.org"
264 | source: hosted
265 | version: "0.2.2"
266 | sky_engine:
267 | dependency: transitive
268 | description: flutter
269 | source: sdk
270 | version: "0.0.99"
271 | source_map_stack_trace:
272 | dependency: transitive
273 | description:
274 | name: source_map_stack_trace
275 | url: "https://pub.dartlang.org"
276 | source: hosted
277 | version: "1.1.4"
278 | source_maps:
279 | dependency: transitive
280 | description:
281 | name: source_maps
282 | url: "https://pub.dartlang.org"
283 | source: hosted
284 | version: "0.10.5"
285 | source_span:
286 | dependency: transitive
287 | description:
288 | name: source_span
289 | url: "https://pub.dartlang.org"
290 | source: hosted
291 | version: "1.4.0"
292 | stack_trace:
293 | dependency: transitive
294 | description:
295 | name: stack_trace
296 | url: "https://pub.dartlang.org"
297 | source: hosted
298 | version: "1.9.2"
299 | stream_channel:
300 | dependency: transitive
301 | description:
302 | name: stream_channel
303 | url: "https://pub.dartlang.org"
304 | source: hosted
305 | version: "1.6.6"
306 | string_scanner:
307 | dependency: transitive
308 | description:
309 | name: string_scanner
310 | url: "https://pub.dartlang.org"
311 | source: hosted
312 | version: "1.0.2"
313 | term_glyph:
314 | dependency: transitive
315 | description:
316 | name: term_glyph
317 | url: "https://pub.dartlang.org"
318 | source: hosted
319 | version: "1.0.0"
320 | test:
321 | dependency: transitive
322 | description:
323 | name: test
324 | url: "https://pub.dartlang.org"
325 | source: hosted
326 | version: "0.12.37"
327 | typed_data:
328 | dependency: transitive
329 | description:
330 | name: typed_data
331 | url: "https://pub.dartlang.org"
332 | source: hosted
333 | version: "1.1.5"
334 | utf:
335 | dependency: transitive
336 | description:
337 | name: utf
338 | url: "https://pub.dartlang.org"
339 | source: hosted
340 | version: "0.9.0+4"
341 | vector_math:
342 | dependency: transitive
343 | description:
344 | name: vector_math
345 | url: "https://pub.dartlang.org"
346 | source: hosted
347 | version: "2.0.6"
348 | watcher:
349 | dependency: transitive
350 | description:
351 | name: watcher
352 | url: "https://pub.dartlang.org"
353 | source: hosted
354 | version: "0.9.7+7"
355 | web_socket_channel:
356 | dependency: transitive
357 | description:
358 | name: web_socket_channel
359 | url: "https://pub.dartlang.org"
360 | source: hosted
361 | version: "1.0.7"
362 | yaml:
363 | dependency: transitive
364 | description:
365 | name: yaml
366 | url: "https://pub.dartlang.org"
367 | source: hosted
368 | version: "2.1.13"
369 | sdks:
370 | dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.54.0.flutter-46ab040e58"
371 |
--------------------------------------------------------------------------------
/material_sheets/lib/demos/otherDemos.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:material_sheets/materialSheet.dart';
3 |
4 | class MaterialSheetTestApp extends StatelessWidget {
5 | //-------------------------Helper Functions
6 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
7 |
8 | Sheet matSheet;
9 | toggleInstant() => matSheet.functions.toggleInstantaneous();
10 | toggleAnim() => matSheet.functions.toggleAnimated();
11 | openInstant() => matSheet.functions.openInstantaneous();
12 | closeInstant() => matSheet.functions.closeInstantaneous();
13 | openAnim() => matSheet.functions.openAnimated();
14 | closeAnim() => matSheet.functions.closeAnimated();
15 |
16 | //-------------------------Build Function
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | matSheet = new Sheet(
21 | parameters: new Parameters(
22 | //-----Widgets
23 | app: new Container(
24 | color: Colors.black,
25 | child: new Center(
26 | child: new Container(
27 | color: Colors.purple,
28 | child: new Column(
29 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
30 | children: [
31 | new Container(
32 | color: Colors.red,
33 | child: new FlatButton(
34 | onPressed: () => closeAnim(),
35 | child: new Icon(
36 | Icons.close,
37 | color: Colors.white,
38 | ),
39 | ),
40 | ),
41 | new Container(
42 | color: Colors.blue,
43 | child: new FlatButton(
44 | onPressed: () => openInstant(),
45 | child: new Icon(
46 | Icons.open_in_browser,
47 | color: Colors.white,
48 | ),
49 | ),
50 | ),
51 | ],
52 | ),
53 | ),
54 | ),
55 | ),
56 | sheet: new Container(
57 | color: Colors.yellowAccent,
58 | child: new Center(
59 | child: new Container(
60 | child: new Column(
61 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
62 | children: [
63 | new Container(
64 | color: Colors.red,
65 | child: new FlatButton(
66 | onPressed: () => closeAnim(),
67 | child: new Icon(
68 | Icons.close,
69 | color: Colors.white,
70 | ),
71 | ),
72 | ),
73 | new Container(
74 | color: Colors.blue,
75 | child: new FlatButton(
76 | onPressed: () => openInstant(),
77 | child: new Icon(
78 | Icons.open_in_browser,
79 | color: Colors.white,
80 | ),
81 | ),
82 | ),
83 | ],
84 | ),
85 | ),
86 | ),
87 | ),
88 | attachment: new Container(
89 | color: Colors.greenAccent,
90 | child: new Icon(
91 | Icons.attachment,
92 | color: Colors.white,
93 | ),
94 | ),
95 | //-----Other Vars
96 | startOpen: true,
97 | position: sheetPosition.right,
98 | sheetMin: 250.0,
99 | autoOpenOrCloseIndicator: true,
100 | type: sheetType.persistent,
101 | placement: attachmentPlacement.inside,
102 | ),
103 | );
104 |
105 | return matSheet;
106 | }
107 | }
108 |
109 | class MultiSheets extends StatelessWidget {
110 | //-------------------------Helper Functions
111 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
112 |
113 | Sheet rightSheet;
114 | toggleInstantR() => rightSheet.functions.toggleInstantaneous();
115 | toggleAnimR() => rightSheet.functions.toggleAnimated();
116 | openInstantR() => rightSheet.functions.openInstantaneous();
117 | closeInstantR() => rightSheet.functions.closeInstantaneous();
118 | openAnimR() => rightSheet.functions.openAnimated();
119 | closeAnimR() => rightSheet.functions.closeAnimated();
120 |
121 | Sheet leftSheet;
122 | toggleInstantL() => leftSheet.functions.toggleInstantaneous();
123 | toggleAnimL() => leftSheet.functions.toggleAnimated();
124 | openInstantL() => leftSheet.functions.openInstantaneous();
125 | closeInstantL() => leftSheet.functions.closeInstantaneous();
126 | openAnimL() => leftSheet.functions.openAnimated();
127 | closeAnimL() => leftSheet.functions.closeAnimated();
128 |
129 | Sheet bottomSheet;
130 | toggleInstantB() => bottomSheet.functions.toggleInstantaneous();
131 | toggleAnimB() => bottomSheet.functions.toggleAnimated();
132 | openInstantB() => bottomSheet.functions.openInstantaneous();
133 | closeInstantB() => bottomSheet.functions.closeInstantaneous();
134 | openAnimB() => bottomSheet.functions.openAnimated();
135 | closeAnimB() => bottomSheet.functions.closeAnimated();
136 |
137 | Sheet topSheet;
138 | toggleInstantT() => topSheet.functions.toggleInstantaneous();
139 | toggleAnimT() => topSheet.functions.toggleAnimated();
140 | openInstantT() => topSheet.functions.openInstantaneous();
141 | closeInstantT() => topSheet.functions.closeInstantaneous();
142 | openAnimT() => topSheet.functions.openAnimated();
143 | closeAnimT() => topSheet.functions.closeAnimated();
144 |
145 | //-------------------------Build Function
146 |
147 | @override
148 | Widget build(BuildContext context) {
149 | rightSheet = new Sheet(
150 | parameters: new Parameters(
151 | //-----Widgets
152 | app: new Container(),
153 | sheet: new Container(
154 | color: Colors.yellowAccent,
155 | child: new Center(
156 | child: new Text(
157 | "Right Sheet",
158 | style: TextStyle(
159 | color: Colors.black,
160 | fontSize: 14.0,
161 | ),
162 | ),
163 | ),
164 | ),
165 | attachment: new Container(
166 | color: Colors.greenAccent,
167 | child: new Icon(
168 | Icons.attachment,
169 | color: Colors.white,
170 | ),
171 | ),
172 | //-----Other Vars
173 | position: sheetPosition.right,
174 | autoOpenOrCloseIndicator: true,
175 | placement: attachmentPlacement.inside,
176 | type: sheetType.persistent,
177 | ),
178 | );
179 |
180 | leftSheet = new Sheet(
181 | parameters: new Parameters(
182 | //-----Widgets
183 | app: Container(),
184 | sheet: new Container(
185 | color: Colors.yellowAccent,
186 | child: new Center(
187 | child: new Text(
188 | "Left Sheet",
189 | style: TextStyle(
190 | color: Colors.black,
191 | fontSize: 14.0,
192 | ),
193 | ),
194 | ),
195 | ),
196 | attachment: new Container(
197 | color: Colors.orangeAccent,
198 | child: new Icon(
199 | Icons.attachment,
200 | color: Colors.white,
201 | ),
202 | ),
203 | //-----Other Vars
204 | position: sheetPosition.left,
205 | autoOpenOrCloseIndicator: true,
206 | placement: attachmentPlacement.inside,
207 | type: sheetType.persistent,
208 | ),
209 | );
210 |
211 | topSheet = new Sheet(
212 | parameters: new Parameters(
213 | //-----Widgets
214 | app: Container(),
215 | sheet: new Container(
216 | color: Colors.purple,
217 | child: new Center(
218 | child: new Text(
219 | "Top Sheet",
220 | style: TextStyle(
221 | color: Colors.black,
222 | fontSize: 14.0,
223 | ),
224 | ),
225 | ),
226 | ),
227 | attachment: new Container(
228 | color: Colors.pinkAccent,
229 | child: new Column(
230 | children: [
231 | new Icon(
232 | Icons.attachment,
233 | color: Colors.white,
234 | ),
235 | new Icon(
236 | Icons.attachment,
237 | color: Colors.white,
238 | ),
239 | ],
240 | )
241 | ),
242 | //-----Other Vars
243 | position: sheetPosition.top,
244 | autoOpenOrCloseIndicator: true,
245 | placement: attachmentPlacement.inside,
246 | type: sheetType.persistent,
247 | ),
248 | );
249 |
250 | bottomSheet = new Sheet(
251 | parameters: new Parameters(
252 | //-----Widgets
253 | app: Container(),
254 | sheet: new Container(
255 | color: Colors.yellowAccent,
256 | child: new Center(
257 | child: new Text(
258 | "Bottom Sheet",
259 | style: TextStyle(
260 | color: Colors.black,
261 | fontSize: 14.0,
262 | ),
263 | ),
264 | ),
265 | ),
266 | attachment: new Container(
267 | color: Colors.redAccent,
268 | child: new Icon(
269 | Icons.attachment,
270 | color: Colors.white,
271 | ),
272 | ),
273 | //-----Other Vars
274 | position: sheetPosition.bottom,
275 | autoOpenOrCloseIndicator: true,
276 | placement: attachmentPlacement.inside,
277 | type: sheetType.persistent,
278 | ),
279 | );
280 |
281 | return new Stack(
282 | children: [
283 | new Container(
284 | color: Colors.blue,
285 | child: new Center(
286 | child: new Text(
287 | "SOME APP",
288 | style: TextStyle(
289 | color: Colors.white,
290 | ),
291 | ),
292 | ),
293 | ),
294 | rightSheet,
295 | leftSheet,
296 | bottomSheet,
297 | topSheet,
298 | ],
299 | );
300 | }
301 | }
--------------------------------------------------------------------------------
/material_sheets/.idea/libraries/Dart_Packages.xml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
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 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
--------------------------------------------------------------------------------
/material_sheets/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 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
19 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXCopyFilesBuildPhase section */
26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
27 | isa = PBXCopyFilesBuildPhase;
28 | buildActionMask = 2147483647;
29 | dstPath = "";
30 | dstSubfolderSpec = 10;
31 | files = (
32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
34 | );
35 | name = "Embed Frameworks";
36 | runOnlyForDeploymentPostprocessing = 0;
37 | };
38 | /* End PBXCopyFilesBuildPhase section */
39 |
40 | /* Begin PBXFileReference section */
41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
43 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
46 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
47 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
54 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
55 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
56 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
57 | /* End PBXFileReference section */
58 |
59 | /* Begin PBXFrameworksBuildPhase section */
60 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
65 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | /* End PBXFrameworksBuildPhase section */
70 |
71 | /* Begin PBXGroup section */
72 | 9740EEB11CF90186004384FC /* Flutter */ = {
73 | isa = PBXGroup;
74 | children = (
75 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
76 | 3B80C3931E831B6300D905FE /* App.framework */,
77 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
78 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
79 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
80 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
81 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
82 | );
83 | name = Flutter;
84 | sourceTree = "";
85 | };
86 | 97C146E51CF9000F007C117D = {
87 | isa = PBXGroup;
88 | children = (
89 | 9740EEB11CF90186004384FC /* Flutter */,
90 | 97C146F01CF9000F007C117D /* Runner */,
91 | 97C146EF1CF9000F007C117D /* Products */,
92 | );
93 | sourceTree = "";
94 | };
95 | 97C146EF1CF9000F007C117D /* Products */ = {
96 | isa = PBXGroup;
97 | children = (
98 | 97C146EE1CF9000F007C117D /* Runner.app */,
99 | );
100 | name = Products;
101 | sourceTree = "";
102 | };
103 | 97C146F01CF9000F007C117D /* Runner */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
107 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
108 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
109 | 97C147021CF9000F007C117D /* Info.plist */,
110 | 97C146F11CF9000F007C117D /* Supporting Files */,
111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
113 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
114 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
115 | );
116 | path = Runner;
117 | sourceTree = "";
118 | };
119 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
120 | isa = PBXGroup;
121 | children = (
122 | );
123 | name = "Supporting Files";
124 | sourceTree = "";
125 | };
126 | /* End PBXGroup section */
127 |
128 | /* Begin PBXNativeTarget section */
129 | 97C146ED1CF9000F007C117D /* Runner */ = {
130 | isa = PBXNativeTarget;
131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
132 | buildPhases = (
133 | 9740EEB61CF901F6004384FC /* Run Script */,
134 | 97C146EA1CF9000F007C117D /* Sources */,
135 | 97C146EB1CF9000F007C117D /* Frameworks */,
136 | 97C146EC1CF9000F007C117D /* Resources */,
137 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
139 | );
140 | buildRules = (
141 | );
142 | dependencies = (
143 | );
144 | name = Runner;
145 | productName = Runner;
146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
147 | productType = "com.apple.product-type.application";
148 | };
149 | /* End PBXNativeTarget section */
150 |
151 | /* Begin PBXProject section */
152 | 97C146E61CF9000F007C117D /* Project object */ = {
153 | isa = PBXProject;
154 | attributes = {
155 | LastUpgradeCheck = 0910;
156 | ORGANIZATIONNAME = "The Chromium Authors";
157 | TargetAttributes = {
158 | 97C146ED1CF9000F007C117D = {
159 | CreatedOnToolsVersion = 7.3.1;
160 | LastSwiftMigration = 0910;
161 | };
162 | };
163 | };
164 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
165 | compatibilityVersion = "Xcode 3.2";
166 | developmentRegion = English;
167 | hasScannedForEncodings = 0;
168 | knownRegions = (
169 | en,
170 | Base,
171 | );
172 | mainGroup = 97C146E51CF9000F007C117D;
173 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
174 | projectDirPath = "";
175 | projectRoot = "";
176 | targets = (
177 | 97C146ED1CF9000F007C117D /* Runner */,
178 | );
179 | };
180 | /* End PBXProject section */
181 |
182 | /* Begin PBXResourcesBuildPhase section */
183 | 97C146EC1CF9000F007C117D /* Resources */ = {
184 | isa = PBXResourcesBuildPhase;
185 | buildActionMask = 2147483647;
186 | files = (
187 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
188 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
189 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
190 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
191 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
192 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
193 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
194 | );
195 | runOnlyForDeploymentPostprocessing = 0;
196 | };
197 | /* End PBXResourcesBuildPhase section */
198 |
199 | /* Begin PBXShellScriptBuildPhase section */
200 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
201 | isa = PBXShellScriptBuildPhase;
202 | buildActionMask = 2147483647;
203 | files = (
204 | );
205 | inputPaths = (
206 | );
207 | name = "Thin Binary";
208 | outputPaths = (
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | shellPath = /bin/sh;
212 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
213 | };
214 | 9740EEB61CF901F6004384FC /* Run Script */ = {
215 | isa = PBXShellScriptBuildPhase;
216 | buildActionMask = 2147483647;
217 | files = (
218 | );
219 | inputPaths = (
220 | );
221 | name = "Run Script";
222 | outputPaths = (
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | shellPath = /bin/sh;
226 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
227 | };
228 | /* End PBXShellScriptBuildPhase section */
229 |
230 | /* Begin PBXSourcesBuildPhase section */
231 | 97C146EA1CF9000F007C117D /* Sources */ = {
232 | isa = PBXSourcesBuildPhase;
233 | buildActionMask = 2147483647;
234 | files = (
235 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
236 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
237 | );
238 | runOnlyForDeploymentPostprocessing = 0;
239 | };
240 | /* End PBXSourcesBuildPhase section */
241 |
242 | /* Begin PBXVariantGroup section */
243 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
244 | isa = PBXVariantGroup;
245 | children = (
246 | 97C146FB1CF9000F007C117D /* Base */,
247 | );
248 | name = Main.storyboard;
249 | sourceTree = "";
250 | };
251 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
252 | isa = PBXVariantGroup;
253 | children = (
254 | 97C147001CF9000F007C117D /* Base */,
255 | );
256 | name = LaunchScreen.storyboard;
257 | sourceTree = "";
258 | };
259 | /* End PBXVariantGroup section */
260 |
261 | /* Begin XCBuildConfiguration section */
262 | 97C147031CF9000F007C117D /* Debug */ = {
263 | isa = XCBuildConfiguration;
264 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
265 | buildSettings = {
266 | ALWAYS_SEARCH_USER_PATHS = NO;
267 | CLANG_ANALYZER_NONNULL = YES;
268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
269 | CLANG_CXX_LIBRARY = "libc++";
270 | CLANG_ENABLE_MODULES = YES;
271 | CLANG_ENABLE_OBJC_ARC = YES;
272 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
273 | CLANG_WARN_BOOL_CONVERSION = YES;
274 | CLANG_WARN_COMMA = YES;
275 | CLANG_WARN_CONSTANT_CONVERSION = YES;
276 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
277 | CLANG_WARN_EMPTY_BODY = YES;
278 | CLANG_WARN_ENUM_CONVERSION = YES;
279 | CLANG_WARN_INFINITE_RECURSION = YES;
280 | CLANG_WARN_INT_CONVERSION = YES;
281 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
282 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
284 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
285 | CLANG_WARN_STRICT_PROTOTYPES = YES;
286 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
287 | CLANG_WARN_UNREACHABLE_CODE = YES;
288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
289 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
290 | COPY_PHASE_STRIP = NO;
291 | DEBUG_INFORMATION_FORMAT = dwarf;
292 | ENABLE_STRICT_OBJC_MSGSEND = YES;
293 | ENABLE_TESTABILITY = YES;
294 | GCC_C_LANGUAGE_STANDARD = gnu99;
295 | GCC_DYNAMIC_NO_PIC = NO;
296 | GCC_NO_COMMON_BLOCKS = YES;
297 | GCC_OPTIMIZATION_LEVEL = 0;
298 | GCC_PREPROCESSOR_DEFINITIONS = (
299 | "DEBUG=1",
300 | "$(inherited)",
301 | );
302 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
303 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
304 | GCC_WARN_UNDECLARED_SELECTOR = YES;
305 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
306 | GCC_WARN_UNUSED_FUNCTION = YES;
307 | GCC_WARN_UNUSED_VARIABLE = YES;
308 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
309 | MTL_ENABLE_DEBUG_INFO = YES;
310 | ONLY_ACTIVE_ARCH = YES;
311 | SDKROOT = iphoneos;
312 | TARGETED_DEVICE_FAMILY = "1,2";
313 | };
314 | name = Debug;
315 | };
316 | 97C147041CF9000F007C117D /* Release */ = {
317 | isa = XCBuildConfiguration;
318 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
319 | buildSettings = {
320 | ALWAYS_SEARCH_USER_PATHS = NO;
321 | CLANG_ANALYZER_NONNULL = YES;
322 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
323 | CLANG_CXX_LIBRARY = "libc++";
324 | CLANG_ENABLE_MODULES = YES;
325 | CLANG_ENABLE_OBJC_ARC = YES;
326 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
327 | CLANG_WARN_BOOL_CONVERSION = YES;
328 | CLANG_WARN_COMMA = YES;
329 | CLANG_WARN_CONSTANT_CONVERSION = YES;
330 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
331 | CLANG_WARN_EMPTY_BODY = YES;
332 | CLANG_WARN_ENUM_CONVERSION = YES;
333 | CLANG_WARN_INFINITE_RECURSION = YES;
334 | CLANG_WARN_INT_CONVERSION = YES;
335 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
336 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
338 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
339 | CLANG_WARN_STRICT_PROTOTYPES = YES;
340 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
341 | CLANG_WARN_UNREACHABLE_CODE = YES;
342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
343 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
344 | COPY_PHASE_STRIP = NO;
345 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
346 | ENABLE_NS_ASSERTIONS = NO;
347 | ENABLE_STRICT_OBJC_MSGSEND = YES;
348 | GCC_C_LANGUAGE_STANDARD = gnu99;
349 | GCC_NO_COMMON_BLOCKS = YES;
350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
352 | GCC_WARN_UNDECLARED_SELECTOR = YES;
353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
354 | GCC_WARN_UNUSED_FUNCTION = YES;
355 | GCC_WARN_UNUSED_VARIABLE = YES;
356 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
357 | MTL_ENABLE_DEBUG_INFO = NO;
358 | SDKROOT = iphoneos;
359 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
360 | TARGETED_DEVICE_FAMILY = "1,2";
361 | VALIDATE_PRODUCT = YES;
362 | };
363 | name = Release;
364 | };
365 | 97C147061CF9000F007C117D /* Debug */ = {
366 | isa = XCBuildConfiguration;
367 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
368 | buildSettings = {
369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
370 | CLANG_ENABLE_MODULES = YES;
371 | CURRENT_PROJECT_VERSION = 1;
372 | ENABLE_BITCODE = NO;
373 | FRAMEWORK_SEARCH_PATHS = (
374 | "$(inherited)",
375 | "$(PROJECT_DIR)/Flutter",
376 | );
377 | INFOPLIST_FILE = Runner/Info.plist;
378 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
379 | LIBRARY_SEARCH_PATHS = (
380 | "$(inherited)",
381 | "$(PROJECT_DIR)/Flutter",
382 | );
383 | PRODUCT_BUNDLE_IDENTIFIER = com.example.materialSheets;
384 | PRODUCT_NAME = "$(TARGET_NAME)";
385 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
386 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
387 | SWIFT_SWIFT3_OBJC_INFERENCE = On;
388 | SWIFT_VERSION = 4.0;
389 | VERSIONING_SYSTEM = "apple-generic";
390 | };
391 | name = Debug;
392 | };
393 | 97C147071CF9000F007C117D /* Release */ = {
394 | isa = XCBuildConfiguration;
395 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
396 | buildSettings = {
397 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
398 | CLANG_ENABLE_MODULES = YES;
399 | CURRENT_PROJECT_VERSION = 1;
400 | ENABLE_BITCODE = NO;
401 | FRAMEWORK_SEARCH_PATHS = (
402 | "$(inherited)",
403 | "$(PROJECT_DIR)/Flutter",
404 | );
405 | INFOPLIST_FILE = Runner/Info.plist;
406 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
407 | LIBRARY_SEARCH_PATHS = (
408 | "$(inherited)",
409 | "$(PROJECT_DIR)/Flutter",
410 | );
411 | PRODUCT_BUNDLE_IDENTIFIER = com.example.materialSheets;
412 | PRODUCT_NAME = "$(TARGET_NAME)";
413 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
414 | SWIFT_SWIFT3_OBJC_INFERENCE = On;
415 | SWIFT_VERSION = 4.0;
416 | VERSIONING_SYSTEM = "apple-generic";
417 | };
418 | name = Release;
419 | };
420 | /* End XCBuildConfiguration section */
421 |
422 | /* Begin XCConfigurationList section */
423 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
424 | isa = XCConfigurationList;
425 | buildConfigurations = (
426 | 97C147031CF9000F007C117D /* Debug */,
427 | 97C147041CF9000F007C117D /* Release */,
428 | );
429 | defaultConfigurationIsVisible = 0;
430 | defaultConfigurationName = Release;
431 | };
432 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
433 | isa = XCConfigurationList;
434 | buildConfigurations = (
435 | 97C147061CF9000F007C117D /* Debug */,
436 | 97C147071CF9000F007C117D /* Release */,
437 | );
438 | defaultConfigurationIsVisible = 0;
439 | defaultConfigurationName = Release;
440 | };
441 | /* End XCConfigurationList section */
442 | };
443 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
444 | }
445 |
--------------------------------------------------------------------------------
/material_sheets/lib/demos/flutterGalleryDemos.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:material_sheets/materialSheet.dart';
3 |
4 | import 'dart:math';
5 |
6 | //-------------------------Persistent Bottom Sheet-------------------------
7 |
8 | class PersistentBottomSheet extends StatefulWidget {
9 | @override
10 | _PersistentBottomSheetState createState() => _PersistentBottomSheetState();
11 | }
12 |
13 | class _PersistentBottomSheetState extends State {
14 | //-------------------------Helper Functions
15 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
16 |
17 | Sheet matSheet;
18 | getOpenPercent() => matSheet.functions.getOpenPercent();
19 | getSheetSize() => matSheet.functions.getSheetSize();
20 | getAttachmentSize() => matSheet.functions.getAttachmentSize();
21 | toggleInstant() => matSheet.functions.toggleInstantaneous();
22 | toggleAnim() => matSheet.functions.toggleAnimated();
23 | openInstant() => matSheet.functions.openInstantaneous();
24 | closeInstant() => matSheet.functions.closeInstantaneous();
25 | openAnim() => matSheet.functions.openAnimated();
26 | closeAnim() => matSheet.functions.closeAnimated();
27 |
28 | IconData _backIcon() {
29 | switch (Theme.of(context).platform) {
30 | case TargetPlatform.android:
31 | case TargetPlatform.fuchsia:
32 | return Icons.arrow_back;
33 | case TargetPlatform.iOS:
34 | return Icons.arrow_back_ios;
35 | }
36 | assert(false);
37 | return null;
38 | }
39 |
40 | void _showMessage() {
41 | showDialog(
42 | context: context,
43 | builder: (BuildContext context) {
44 | return new AlertDialog(
45 | content: const Text('You tapped the floating action button.'),
46 | actions: [
47 | new FlatButton(
48 | onPressed: () {
49 | Navigator.pop(context);
50 | },
51 | child: const Text('OK'))
52 | ],
53 | );
54 | },
55 | );
56 | }
57 |
58 | @override
59 | Widget build(BuildContext context) {
60 | final ThemeData themeData = Theme.of(context);
61 |
62 | matSheet = new Sheet(
63 | parameters: new Parameters(
64 | app: new MaterialApp(
65 | home: new Scaffold(
66 | appBar: new AppBar(
67 | leading: new IconButton(
68 | icon: new Icon(_backIcon()),
69 | alignment: Alignment.centerLeft,
70 | tooltip: 'Back',
71 | onPressed: () => print("there is nothing to Pop"),
72 | ),
73 | title: const Text('Persistent bottom sheet'),
74 | ),
75 | body: new Center(
76 | child: new RaisedButton(
77 | onPressed: openAnim,
78 | child: const Text('SHOW BOTTOM SHEET'),
79 | ),
80 | ),
81 | ),
82 | ),
83 | sheet: new Material(
84 | child: new Container(
85 | decoration: new BoxDecoration(
86 | color: themeData.scaffoldBackgroundColor,
87 | border: new Border(
88 | top: new BorderSide(
89 | color: themeData.disabledColor
90 | ),
91 | ),
92 | ),
93 | child: new Padding(
94 | padding: const EdgeInsets.all(32.0),
95 | child: new Text(
96 | 'This is a Material persistent bottom sheet. Drag downwards to dismiss it.',
97 | textAlign: TextAlign.center,
98 | style: new TextStyle(color: themeData.accentColor, fontSize: 24.0, ),
99 | ),
100 | ),
101 | ),
102 | ),
103 | attachment: new Container(
104 | alignment: Alignment.bottomRight,
105 | padding: EdgeInsets.all(16.0),
106 | child: new FloatingActionButton(
107 | onPressed: _showMessage,
108 | backgroundColor: Colors.redAccent,
109 | child: const Icon(
110 | Icons.add,
111 | semanticLabel: 'Add',
112 | ),
113 | ),
114 | ),
115 | type: sheetType.persistent,
116 | swipeToOpen: false,
117 | ),
118 | );
119 |
120 | return matSheet;
121 | }
122 | }
123 |
124 | //-------------------------Modal Bottom Sheet-------------------------
125 |
126 | class ModalBottomSheet extends StatelessWidget {
127 |
128 | //-------------------------Helper Functions
129 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
130 |
131 | Sheet matSheet;
132 | toggleInstant() => matSheet.functions.toggleInstantaneous();
133 | toggleAnim() => matSheet.functions.toggleAnimated();
134 | openInstant() => matSheet.functions.openInstantaneous();
135 | closeInstant() => matSheet.functions.closeInstantaneous();
136 | openAnim() => matSheet.functions.openAnimated();
137 | closeAnim() => matSheet.functions.closeAnimated();
138 |
139 | IconData _backIcon(BuildContext context) {
140 | switch (Theme.of(context).platform) {
141 | case TargetPlatform.android:
142 | case TargetPlatform.fuchsia:
143 | return Icons.arrow_back;
144 | case TargetPlatform.iOS:
145 | return Icons.arrow_back_ios;
146 | }
147 | assert(false);
148 | return null;
149 | }
150 |
151 | @override
152 | Widget build(BuildContext context) {
153 |
154 | matSheet = new Sheet(
155 | parameters: new Parameters(
156 | app: new MaterialApp(
157 | home: new Scaffold(
158 | appBar: new AppBar(
159 | leading: new IconButton(
160 | icon: new Icon(_backIcon(context)),
161 | alignment: Alignment.centerLeft,
162 | tooltip: 'Back',
163 | onPressed: () => print("there is nothing to Pop"),
164 | ),
165 | title: const Text('Modal bottom sheet'),
166 | ),
167 | body: new Center(
168 | child: new RaisedButton(
169 | child: const Text('SHOW BOTTOM SHEET'),
170 | onPressed: openAnim,
171 | ),
172 | ),
173 | ),
174 | ),
175 | sheet: new Material(
176 | child: new Container(
177 | child: new Padding(
178 | padding: const EdgeInsets.all(32.0),
179 | child: new Text(
180 | 'This is the modal bottom sheet. Click anywhere to dismiss.',
181 | textAlign: TextAlign.center,
182 | style: new TextStyle(
183 | color: Theme
184 | .of(context)
185 | .accentColor,
186 | fontSize: 24.0
187 | ),
188 | ),
189 | ),
190 | ),
191 | ),
192 | type: sheetType.modal,
193 | swipeToOpen: false,
194 | ),
195 | );
196 |
197 | return matSheet;
198 | }
199 | }
200 |
201 | //-------------------------Navigation Drawer-------------------------
202 |
203 | const String _kAsset0 = 'people/square/trevor.png';
204 | const String _kAsset1 = 'people/square/stella.png';
205 | const String _kAsset2 = 'people/square/sandra.png';
206 | const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
207 |
208 | class NavigationDrawer extends StatefulWidget {
209 | @override
210 | _NavigationDrawerState createState() => new _NavigationDrawerState();
211 | }
212 |
213 | class _NavigationDrawerState extends State{
214 |
215 | //-------------------------Helper Functions
216 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
217 |
218 | Sheet matSheet;
219 | toggleInstant() => matSheet.functions.toggleInstantaneous();
220 | toggleAnim() => matSheet.functions.toggleAnimated();
221 | openInstant() => matSheet.functions.openInstantaneous();
222 | closeInstant() => matSheet.functions.closeInstantaneous();
223 | openAnim() => matSheet.functions.openAnimated();
224 | closeAnim() => matSheet.functions.closeAnimated();
225 |
226 | final GlobalKey _scaffoldKey = new GlobalKey();
227 |
228 | static const List _drawerContents = const ['A', 'B', 'C', 'D', 'E'];
229 |
230 | IconData _backIcon() {
231 | switch (Theme.of(context).platform) {
232 | case TargetPlatform.android:
233 | case TargetPlatform.fuchsia:
234 | return Icons.arrow_back;
235 | case TargetPlatform.iOS:
236 | return Icons.arrow_back_ios;
237 | }
238 | assert(false);
239 | return null;
240 | }
241 |
242 | void _showNotImplementedMessage() {
243 | Navigator.pop(context); // Dismiss the drawer.
244 | _scaffoldKey.currentState.showSnackBar(const SnackBar(
245 | content: const Text("The drawer's items don't do anything")
246 | ));
247 | }
248 |
249 | void _onOtherAccountsTap(BuildContext context) {
250 | showDialog(
251 | context: context,
252 | builder: (BuildContext context) {
253 | return new AlertDialog(
254 | title: const Text('Account switching not implemented.'),
255 | actions: [
256 | new FlatButton(
257 | child: const Text('OK'),
258 | onPressed: () {
259 | Navigator.pop(context);
260 | },
261 | ),
262 | ],
263 | );
264 | },
265 | );
266 | }
267 |
268 | @override
269 | Widget build(BuildContext context) {
270 |
271 | matSheet = new Sheet(
272 | parameters: new Parameters(
273 | app: new MaterialApp(
274 | home: new Scaffold(
275 | key: _scaffoldKey,
276 | appBar: new AppBar(
277 | leading: new IconButton(
278 | icon: new Icon(_backIcon()),
279 | alignment: Alignment.centerLeft,
280 | tooltip: 'Back',
281 | onPressed: () => print("there is nothing to Pop"),
282 | ),
283 | title: const Text('Navigation drawer'),
284 | ),
285 | body: new Center(
286 | child: new InkWell(
287 | onTap: openAnim,
288 | child: new Column(
289 | mainAxisSize: MainAxisSize.min,
290 | children: [
291 | new Container(
292 | width: 100.0,
293 | height: 100.0,
294 | decoration: const BoxDecoration(
295 | color: Colors.pinkAccent,
296 | shape: BoxShape.circle,
297 | image: const DecorationImage(
298 | image: const AssetImage(
299 | _kAsset0,
300 | package: _kGalleryAssetsPackage,
301 | ),
302 | ),
303 | ),
304 | ),
305 | new Padding(
306 | padding: const EdgeInsets.only(top: 8.0),
307 | child: new Text('Tap here to open the drawer',
308 | style: Theme.of(context).textTheme.subhead,
309 | ),
310 | ),
311 | ],
312 | ),
313 | ),
314 | ),
315 | ),
316 | ),
317 | sheet: new Column(
318 | children: [
319 | /*
320 | new UserAccountsDrawerHeader(
321 | accountName: const Text('Trevor Widget'),
322 | accountEmail: const Text('trevor.widget@example.com'),
323 | currentAccountPicture: const CircleAvatar(
324 | backgroundColor: Colors.redAccent,
325 | backgroundImage: const AssetImage(
326 | _kAsset0,
327 | package: _kGalleryAssetsPackage,
328 | ),
329 | ),
330 |
331 | otherAccountsPictures: [
332 | new GestureDetector(
333 | onTap: () {
334 | _onOtherAccountsTap(context);
335 | },
336 | child: new Semantics(
337 | label: 'Switch to Account B',
338 | child: const CircleAvatar(
339 | backgroundImage: const AssetImage(
340 | _kAsset1,
341 | package: _kGalleryAssetsPackage,
342 | ),
343 | ),
344 | ),
345 | ),
346 | new GestureDetector(
347 | onTap: () {
348 | _onOtherAccountsTap(context);
349 | },
350 | child: new Semantics(
351 | label: 'Switch to Account C',
352 | child: const CircleAvatar(
353 | backgroundImage: const AssetImage(
354 | _kAsset2,
355 | package: _kGalleryAssetsPackage,
356 | ),
357 | ),
358 | ),
359 | ),
360 | ],
361 |
362 | margin: EdgeInsets.zero,
363 | onDetailsPressed: () {//TODO... controller forward or reverse
364 | },
365 | ),
366 | */
367 | /*
368 | new Expanded(
369 | child: new ListView(
370 | padding: const EdgeInsets.only(top: 8.0),
371 | children: [
372 |
373 | new Stack(
374 | children: [
375 | // The initial contents of the drawer.
376 | new FadeTransition(
377 | opacity: _drawerContentsOpacity,
378 | child: new Column(
379 | mainAxisSize: MainAxisSize.min,
380 | crossAxisAlignment: CrossAxisAlignment.stretch,
381 | children: _drawerContents.map((String id) {
382 | return new ListTile(
383 | leading: new CircleAvatar(child: new Text(id)),
384 | title: new Text('Drawer item $id'),
385 | onTap: _showNotImplementedMessage,
386 | );
387 | }).toList(),
388 | ),
389 | ),
390 | // The drawer's "details" view.
391 | new SlideTransition(
392 | position: _drawerDetailsPosition,
393 | child: new FadeTransition(
394 | opacity: new ReverseAnimation(_drawerContentsOpacity),
395 | child: new Column(
396 | mainAxisSize: MainAxisSize.min,
397 | crossAxisAlignment: CrossAxisAlignment.stretch,
398 | children: [
399 | new ListTile(
400 | leading: const Icon(Icons.add),
401 | title: const Text('Add account'),
402 | onTap: _showNotImplementedMessage,
403 | ),
404 | new ListTile(
405 | leading: const Icon(Icons.settings),
406 | title: const Text('Manage accounts'),
407 | onTap: _showNotImplementedMessage,
408 | ),
409 | ],
410 | ),
411 | ),
412 | ),
413 | ],
414 | ),
415 |
416 | ],
417 | ),
418 | ),
419 | */
420 | ],
421 | ),
422 | position: sheetPosition.left,
423 | ),
424 | );
425 |
426 | return matSheet;
427 | }
428 | }
429 |
430 | //-------------------------Bottom Sheet From List Demo-------------------------
431 |
432 | enum _MaterialListType {oneLine, oneLineWithAvatar, twoLine, threeLine}
433 |
434 | class ListDemo extends StatefulWidget {
435 | const ListDemo({ Key key }) : super(key: key);
436 |
437 | @override
438 | _ListDemoState createState() => new _ListDemoState();
439 | }
440 |
441 | class _ListDemoState extends State {
442 |
443 | static final GlobalKey scaffoldKey = new GlobalKey();
444 |
445 | _MaterialListType _itemType = _MaterialListType.threeLine;
446 | bool _dense = false;
447 | bool _showAvatars = true;
448 | bool _showIcons = false;
449 | bool _showDividers = false;
450 | bool _reverseSort = false;
451 | List items = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'];
452 |
453 | IconData _backIcon() {
454 | switch (Theme.of(context).platform) {
455 | case TargetPlatform.android:
456 | case TargetPlatform.fuchsia:
457 | return Icons.arrow_back;
458 | case TargetPlatform.iOS:
459 | return Icons.arrow_back_ios;
460 | }
461 | assert(false);
462 | return null;
463 | }
464 |
465 | //-------------------------Helper Functions
466 | //NOTE: these are required if you want buttons that will be opening or closing the sheet
467 |
468 | Sheet matSheet;
469 | toggleInstant() => matSheet.functions.toggleInstantaneous();
470 | toggleAnim() => matSheet.functions.toggleAnimated();
471 | openInstant() => matSheet.functions.openInstantaneous();
472 | closeInstant() => matSheet.functions.closeInstantaneous();
473 | openAnim() => matSheet.functions.openAnimated();
474 | closeAnim() => matSheet.functions.closeAnimated();
475 |
476 | bool testBool = true;
477 |
478 | @override
479 | Widget build(BuildContext context){
480 | const scaffColor = Color(0xfffafafa); //manually read in from Theme.of(context).scaffoldBackgroundColor
481 |
482 | final String layoutText = _dense ? ' \u2013 Dense' : '';
483 | String itemTypeText;
484 | switch (_itemType) {
485 | case _MaterialListType.oneLine:
486 | case _MaterialListType.oneLineWithAvatar:
487 | itemTypeText = 'Single-line';
488 | break;
489 | case _MaterialListType.twoLine:
490 | itemTypeText = 'Two-line';
491 | break;
492 | case _MaterialListType.threeLine:
493 | itemTypeText = 'Three-line';
494 | break;
495 | }
496 |
497 | Iterable listTiles = items.map((String item) => buildListTile(context, item));
498 | if (_showDividers)
499 | listTiles = ListTile.divideTiles(context: context, tiles: listTiles);
500 |
501 | matSheet = new Sheet(
502 | parameters: new Parameters(
503 | app: new MaterialApp(
504 | home: new Scaffold(
505 | key: scaffoldKey,
506 | appBar: new AppBar(
507 | leading: new IconButton(
508 | icon: new Icon(_backIcon()),
509 | alignment: Alignment.centerLeft,
510 | tooltip: 'Back',
511 | onPressed: () => print("there is nothing to Pop"),
512 | ),
513 | title: new Text('Scrolling list\n$itemTypeText$layoutText'),
514 | actions: [
515 | new IconButton(
516 | icon: const Icon(Icons.sort_by_alpha),
517 | tooltip: 'Sort',
518 | onPressed: () {
519 | setState(() {
520 | _reverseSort = !_reverseSort;
521 | items.sort((String a, String b) => _reverseSort ? b.compareTo(a) : a.compareTo(b));
522 | });
523 | },
524 | ),
525 | new IconButton(
526 | icon: const Icon(Icons.more_vert),
527 | tooltip: 'Show menu',
528 | onPressed: () => toggleAnim(),
529 | ),
530 | ],
531 | ),
532 | body: new Scrollbar(
533 | child: new ListView(
534 | padding: new EdgeInsets.symmetric(vertical: _dense ? 4.0 : 8.0),
535 | children: listTiles.toList(),
536 | ),
537 | ),
538 | ),
539 | ),
540 | sheet: new Container(
541 | decoration: const BoxDecoration(
542 | border: const Border(top: const BorderSide(color: Colors.black26)),
543 | color: scaffColor,
544 | ),
545 | child: new ListView(
546 | shrinkWrap: true,
547 | primary: false, //NOTE: if this is commented out behavior of scrolling will supercede that of closing the sheet
548 | children: [
549 | new MergeSemantics(
550 | child: new ListTile(
551 | dense: true,
552 | title: const Text('One-line'),
553 | trailing: new Radio<_MaterialListType>(
554 | value: _showAvatars ? _MaterialListType.oneLineWithAvatar : _MaterialListType.oneLine,
555 | groupValue: _itemType,
556 | onChanged: changeItemType,
557 | )
558 | ),
559 | ),
560 | new MergeSemantics(
561 | child: new ListTile(
562 | dense: true,
563 | title: const Text('Two-line'),
564 | trailing: new Radio<_MaterialListType>(
565 | value: _MaterialListType.twoLine,
566 | groupValue: _itemType,
567 | onChanged: changeItemType,
568 | )
569 | ),
570 | ),
571 | new MergeSemantics(
572 | child: new ListTile(
573 | dense: true,
574 | title: const Text('Three-line'),
575 | trailing: new Radio<_MaterialListType>(
576 | value: _MaterialListType.threeLine,
577 | groupValue: _itemType,
578 | onChanged: changeItemType,
579 | ),
580 | ),
581 | ),
582 | new MergeSemantics(
583 | child: new ListTile(
584 | dense: true,
585 | title: const Text('Show avatar'),
586 | trailing: new Checkbox(
587 | value: _showAvatars,
588 | onChanged: (bool value) {
589 | setState(() {
590 | _showAvatars = value;
591 | });
592 | },
593 | ),
594 | ),
595 | ),
596 | new MergeSemantics(
597 | child: new ListTile(
598 | dense: true,
599 | title: const Text('Show icon'),
600 | trailing: new Checkbox(
601 | value: _showIcons,
602 | onChanged: (bool value) {
603 | setState(() {
604 | _showIcons = value;
605 | });
606 | },
607 | ),
608 | ),
609 | ),
610 | new MergeSemantics(
611 | child: new ListTile(
612 | dense: true,
613 | title: const Text('Show dividers'),
614 | trailing: new Checkbox(
615 | value: _showDividers,
616 | onChanged: (bool value) {
617 | setState(() {
618 | _showDividers = value;
619 | });
620 | },
621 | ),
622 | ),
623 | ),
624 | new MergeSemantics(
625 | child: new ListTile(
626 | dense: true,
627 | title: const Text('Dense layout'),
628 | trailing: new Checkbox(
629 | value: _dense,
630 | onChanged: (bool value) {
631 | setState(() {
632 | _dense = value;
633 | });
634 | },
635 | ),
636 | ),
637 | ),
638 | ],
639 | ),
640 | ),
641 | type: sheetType.persistent,
642 | swipeToOpen: false,
643 | ),
644 | );
645 |
646 | return new Material(child: matSheet);
647 | }
648 |
649 | //--------------------------------------------------
650 |
651 |
652 | void changeItemType(_MaterialListType type) {
653 | setState(() {
654 | _itemType = type;
655 | });
656 | }
657 |
658 | Widget buildListTile(BuildContext context, String item) {
659 | Widget secondary;
660 | if (_itemType == _MaterialListType.twoLine) {
661 | secondary = const Text('Additional item information.');
662 | } else if (_itemType == _MaterialListType.threeLine) {
663 | secondary = const Text(
664 | 'Even more additional list item information appears on line three.',
665 | );
666 | }
667 | return new MergeSemantics(
668 | child: new ListTile(
669 | isThreeLine: _itemType == _MaterialListType.threeLine,
670 | dense: _dense,
671 | leading: _showAvatars ? new ExcludeSemantics(child: new CircleAvatar(child: new Text(item))) : null,
672 | title: new Text('This item represents $item.'),
673 | subtitle: secondary,
674 | trailing: _showIcons ? new Icon(Icons.info, color: Theme.of(context).disabledColor) : null,
675 | ),
676 | );
677 | }
678 | }
679 |
--------------------------------------------------------------------------------
/material_sheets/lib/materialSheet.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 | import 'dart:ui';
3 | import 'dart:async';
4 |
5 | import 'package:flutter/material.dart';
6 |
7 | //-------------------------Enumerations-------------------------
8 |
9 | enum sheetPosition { top, right, bottom, left }
10 | enum sheetType { modal, persistent }
11 | enum attachmentPlacement { inside, outside }
12 |
13 | //-------------------------Passed Parameters-------------------------
14 |
15 | class Parameters{
16 | //the application that the sheet is going to appear in front of
17 | final Widget app;
18 | //the primary sheet component that shows the content that shows and hides
19 | final Widget sheet;
20 | //the secondary sheet component that always shows regardless of whether or not the sheet is open or closed
21 | final Widget attachment;
22 |
23 | //whether or not the sheet starts of open or closed
24 | final bool startOpen;
25 | //what edge the sheet is stuck to
26 | final sheetPosition position;
27 | //whether the sheet is modal or persistent
28 | final sheetType type;
29 | //whether the secondary widget is closer to the center or the screen (inside) or further away (outside)
30 | final attachmentPlacement placement;
31 | //whether or not the backButton closes the Sheet (ONLY android)
32 | final bool backBtnClosesSheet;
33 | //how the sheet closes when you press the backButton
34 | final bool backBtnClosesAnimated;
35 | //if you drag the sheet but not all the way after 50% on either side it will open or close automatically
36 | //this will show an indicator when the action that will be taken is obvious
37 | //darker overlay means it will close, no overlay means it will open
38 | final bool autoOpenOrCloseIndicator;
39 |
40 | //whether or not we can swipe from the edge of the screen or the attachment to open the sheet
41 | final bool swipeToOpen;
42 | //whether or not we can swipe the sheet to close it (gesture detector lets event pass through)
43 | final bool swipeToClose;
44 |
45 | //how long the animator will take to automatically complete the closing or opening of the sheet
46 | final int maxAnimationTimeInMilliseconds;
47 | //the color that shows up over the sheet when the animator will automatically close the sheet if the sheet is let go
48 | final Color indicatorAutoCloseColor;
49 | //the scrim color that will be linearly interpolated to as you open or close a modal sheet
50 | final Color scrimOpenColor;
51 |
52 | //if you have too little content you still want your sheet to be a particular size (might have to align)
53 | final double sheetMin;
54 | //if you dont want your sheet to be larger than a certain size
55 | final double sheetMax; //TODO... set inherent limit (max size).... allow overflow to just be scrolled
56 |
57 | //text direction in sheet
58 | final TextDirection textDirection;
59 |
60 | Parameters({
61 | @required this.app,
62 | @required this.sheet,
63 | this.attachment,
64 |
65 | this.startOpen: false,
66 | this.position: sheetPosition.bottom,
67 | this.type: sheetType.modal,
68 | this.placement: attachmentPlacement.inside,
69 | this.backBtnClosesSheet: true,
70 | this.backBtnClosesAnimated: true,
71 | this.autoOpenOrCloseIndicator: false,
72 |
73 | this.swipeToOpen: true,
74 | this.swipeToClose: true,
75 |
76 | this.maxAnimationTimeInMilliseconds: 100,
77 | this.indicatorAutoCloseColor: const Color.fromRGBO(0,0,0,.5),
78 | this.scrimOpenColor: const Color.fromRGBO(0,0,0,.5),
79 |
80 | this.sheetMin,
81 | this.sheetMax, //TODO... In Progress
82 |
83 | this.textDirection: TextDirection.ltr,
84 | });
85 | }
86 |
87 | //-------------------------Private Functions-------------------------
88 |
89 | class PrivateFunctions{
90 | Function getAnimationTicker;
91 | Function setAnimationTicker;
92 |
93 | Function getAnimationOpenOrClose;
94 | Function setAnimationOpenOrClose;
95 |
96 | Function getSlideUpdateStream;
97 | Function setSlideUpdateStream;
98 |
99 | Function getOpenPercent;
100 | Function setOpenPercent;
101 | }
102 |
103 | //-------------------------Public Functions-------------------------
104 |
105 | //TODO.... implement these functions
106 | class PublicFunctions{
107 | //grab information
108 | Function getOpenPercent;
109 | Function getAttachmentSize;
110 | Function getSheetSize;
111 | //run command
112 | Function toggleInstantaneous;
113 | Function toggleAnimated;
114 | Function openInstantaneous;
115 | Function closeInstantaneous;
116 | Function openAnimated;
117 | Function closeAnimated;
118 | }
119 |
120 | //-------------------------Material Sheet-------------------------
121 |
122 | //NOTE: this exists to avoid unnecessary rebuilding of the sheet since it has to rebuild twice to work properly
123 | class Sheet extends StatelessWidget{
124 |
125 | final Parameters parameters;
126 | final PublicFunctions functions = new PublicFunctions();
127 |
128 | Sheet({
129 | @required this.parameters,
130 | });
131 |
132 | @override
133 | Widget build(BuildContext context) {
134 | return new MediaQuery(
135 | data: MediaQueryData(),
136 | child: new Directionality(
137 | textDirection: parameters.textDirection,
138 | child: new Stack(
139 | children: [
140 | parameters.app,
141 | new SheetWidget(
142 | parameter: parameters,
143 | functions: functions,
144 | ),
145 | ],
146 | ),
147 | ),
148 | );
149 | }
150 | }
151 |
152 | //-------------------------The Actual Sheet-------------------------
153 |
154 | //NOTE: this has to be stateful because "with WidgetsBindingObserver" requires it and setState might be called
155 | class SheetWidget extends StatefulWidget {
156 |
157 | final Parameters parameter;
158 | final PublicFunctions functions;
159 |
160 | SheetWidget({
161 | @required this.parameter,
162 | @required this.functions,
163 | });
164 |
165 | @override
166 | _SheetWidgetState createState() => new _SheetWidgetState();
167 | }
168 |
169 | //NOTE: this is a whole other class because the stateful class below already uses a with clause and each class can only have 1 with clause
170 | class _SheetWidgetState extends State with WidgetsBindingObserver{
171 |
172 | //-------------------------Local Variables----------
173 |
174 | //private function variables
175 | PrivateFunctions private = new PrivateFunctions();
176 | TickerProvider animationTicker;
177 | OpenOrCloseAnimation animationOpenOrClose;
178 | StreamController slideUpdateStream;
179 | double openPercent;
180 |
181 | //public function variables
182 | Size sheetSize;
183 | Size attachmentSize;
184 |
185 | //widget keys
186 | GlobalKey wholeKey = new GlobalKey();
187 | GlobalKey attachKey = new GlobalKey();
188 |
189 | //ease of use variables
190 | Parameters parameters;
191 |
192 | //-------------------------Linkage Functions----------
193 |
194 | linkPublicFunctions(){
195 | var w = widget.functions;
196 | w.getOpenPercent = getOpenPercent;
197 | w.getAttachmentSize = getAttachmentSize;
198 | w.getSheetSize = getSheetSize;
199 | w.toggleInstantaneous = toggleInstantaneous;
200 | w.toggleAnimated = toggleAnimated;
201 | w.openInstantaneous = openInstantaneous;
202 | w.closeInstantaneous = closeInstantaneous;
203 | w.openAnimated = openAnimated;
204 | w.closeAnimated = closeAnimated;
205 | }
206 |
207 | linkPrivateFunctions(){
208 | var w = private;
209 | w.setOpenPercent = setOpenPercent;
210 | w.getOpenPercent = getOpenPercent;
211 | w.setSlideUpdateStream = setSlideUpdateStream;
212 | w.getSlideUpdateStream = getSlideUpdateStream;
213 | w.setAnimationTicker = setAnimationTicker;
214 | w.getAnimationTicker = getAnimationTicker;
215 | w.setAnimationOpenOrClose = setAnimationOpenOrClose;
216 | w.getAnimationOpenOrClose = getAnimationOpenOrClose;
217 | }
218 |
219 | //-------------------------Public Functions----------
220 |
221 | Size getAttachmentSize() => attachmentSize;
222 | Size getSheetSize() => sheetSize;
223 |
224 | toggleInstantaneous(){
225 | if(private.getOpenPercent() == 1.0 || private.getOpenPercent() == 0.0)
226 | (private.getOpenPercent() == 1.0) ? closeInstantaneous() : openInstantaneous();
227 | }
228 | toggleAnimated(){
229 | if(private.getOpenPercent() == 1.0 || private.getOpenPercent() == 0.0)
230 | (private.getOpenPercent() == 1.0) ? closeAnimated() : openAnimated();
231 | }
232 |
233 | openInstantaneous() => completeOpenOrClose(1.0, 0, private);
234 | closeInstantaneous() => completeOpenOrClose(0.0, 0, private);
235 |
236 | openAnimated() => completeOpenOrClose(1.0, parameters.maxAnimationTimeInMilliseconds, private);
237 | closeAnimated() => completeOpenOrClose(0.0, parameters.maxAnimationTimeInMilliseconds, private);
238 |
239 | //-------------------------Private Functions----------
240 |
241 | TickerProvider getAnimationTicker() => animationTicker;
242 | setAnimationTicker(TickerProvider newAT) => animationTicker = newAT;
243 |
244 | OpenOrCloseAnimation getAnimationOpenOrClose() => animationOpenOrClose;
245 | setAnimationOpenOrClose(OpenOrCloseAnimation newOOCA) => animationOpenOrClose = newOOCA;
246 |
247 | StreamController getSlideUpdateStream() => slideUpdateStream;
248 | setSlideUpdateStream(StreamController newSUS) => slideUpdateStream = newSUS;
249 |
250 | double getOpenPercent() => openPercent;
251 | setOpenPercent(double newOP) => openPercent = newOP;
252 |
253 | //-------------------------Required For Reading in sheetWidth and sheetHeight----------
254 |
255 | int requiredBuildsPerChange = 2;
256 | int timesBuilt = 0;
257 |
258 | rebuildAsync() async{
259 | await Future.delayed(Duration.zero);
260 | setState(() {});
261 | }
262 |
263 | //-------------------------Required For Gestures and Animations----------
264 |
265 | asyncLinkInit() async{
266 | await linkPrivateFunctions();
267 | initSlideUpdateStream();
268 | }
269 |
270 | initSlideUpdateStream() {
271 | if(private.getSlideUpdateStream() == null){
272 | private.setSlideUpdateStream(new StreamController());
273 |
274 | private.getSlideUpdateStream().stream.listen((double newPercent){
275 | setState(() {
276 | private.setOpenPercent(newPercent);
277 | });
278 | });
279 | }
280 | }
281 |
282 | //-------------------------Required For WidgetsBindingObserver----------
283 |
284 | @override
285 | void initState() {
286 | super.initState();
287 | WidgetsBinding.instance.addObserver(this);
288 |
289 | asyncLinkInit(); //for gestures and animations
290 | }
291 |
292 | @override
293 | void dispose() {
294 | WidgetsBinding.instance.removeObserver(this);
295 | super.dispose();
296 | }
297 |
298 | //-------------------------Function That Triggers when you hit the back key----------
299 |
300 | @override
301 | didPopRoute(){
302 | bool override = parameters.backBtnClosesSheet && (private.getOpenPercent() == 1.0);
303 | if(override)
304 | (parameters.backBtnClosesAnimated) ? closeAnimated() : closeInstantaneous();
305 | return new Future.value(override);
306 | }
307 |
308 | //-------------------------Widget Extract Helpers----------
309 |
310 | Matrix4 _calcSheetClosedTransform(bool isWidthMax, double width, double height){
311 |
312 | width = width ?? 0.0;
313 | height = height ?? 0.0;
314 |
315 | if(isWidthMax){ //mess with y
316 | if(parameters.position == sheetPosition.top) return Matrix4.translationValues(0.0, -height, 0.0);
317 | else return Matrix4.translationValues(0.0, height, 0.0);
318 | } else{ //mess with x
319 | if(parameters.position == sheetPosition.right) return Matrix4.translationValues(width, 0.0, 0.0);
320 | else return Matrix4.translationValues(-width, 0.0, 0.0);
321 | }
322 | }
323 |
324 | BoxConstraints _calcBoxConstraints(bool fullWidth) {
325 | if (parameters.sheetMin == null && parameters.sheetMax == null)
326 | return new BoxConstraints();
327 | else {
328 | if (parameters.sheetMin != null && parameters.sheetMax != null) {
329 | if (fullWidth) //we only care for height
330 | return new BoxConstraints(
331 | minHeight: parameters.sheetMin,
332 | maxHeight: parameters.sheetMax,
333 | );
334 | else //we only care for width
335 | return new BoxConstraints(minWidth: parameters.sheetMin, maxWidth: parameters.sheetMax);
336 | } else {
337 | if (parameters.sheetMin != null) {
338 | //we only have min
339 | if (fullWidth) //we only care for height
340 | return new BoxConstraints(minHeight: parameters.sheetMin);
341 | else //we only care for width
342 | return new BoxConstraints(minWidth: parameters.sheetMin);
343 | } else {
344 | //we only have max
345 | if (fullWidth) //we only care for h`eight
346 | return new BoxConstraints(maxHeight: parameters.sheetMax);
347 | else //we only care for width
348 | return new BoxConstraints(maxWidth: parameters.sheetMax);
349 | }
350 | }
351 | }
352 | }
353 |
354 | //ONLY relevant if position is top or bottom
355 | TextDirection _calcTextDirection(){
356 | if(parameters.position == sheetPosition.right){
357 | if(parameters.placement == attachmentPlacement.inside) return TextDirection.rtl;
358 | else return TextDirection.ltr;
359 | }else{
360 | if(parameters.placement == attachmentPlacement.inside) return TextDirection.ltr;
361 | else return TextDirection.rtl;
362 | }
363 | }
364 |
365 | //ONLY relevant if position is left or right
366 | VerticalDirection _calcVerticalDirection(){
367 | if(parameters.position == sheetPosition.top){
368 | if(parameters.placement == attachmentPlacement.inside) return VerticalDirection.down;
369 | else return VerticalDirection.up;
370 | }else{
371 | if(parameters.placement == attachmentPlacement.inside) return VerticalDirection.up;
372 | else return VerticalDirection.down;
373 | }
374 | }
375 |
376 | Matrix4 _calcTransform(bool isWidthMax, double width, double height){
377 | Matrix4 beginMatrix = Matrix4.translationValues(0.0,0.0,0.0);
378 | Matrix4 endMatrix = _calcSheetClosedTransform(isWidthMax, width, height);
379 | return Matrix4Tween(begin: endMatrix, end: beginMatrix).lerp(private.getOpenPercent());
380 | }
381 |
382 | Color _calcIndicatorColor(){
383 | if(parameters.autoOpenOrCloseIndicator){
384 | if(private.getOpenPercent() > .5) return parameters.indicatorAutoCloseColor.withOpacity(0.0);
385 | else return parameters.indicatorAutoCloseColor;
386 | }
387 | else return Colors.transparent;
388 | }
389 |
390 | //-------------------------Widget Extracts----------
391 |
392 | Widget sheetWidget(double w, double h){
393 | return new Stack(
394 | children: [
395 | new Container(
396 | width: (w == 0.0) ? null : w,
397 | height: (h == 0.0) ? null : h,
398 | child: parameters.sheet,
399 | ),
400 | new IgnorePointer(
401 | child: new Container(
402 | width: (w == 0.0) ? null : w,
403 | height: (h == 0.0) ? null : h,
404 | color: _calcIndicatorColor(),
405 | ),
406 | )
407 | ]
408 | );
409 |
410 | }
411 |
412 | Widget attachmentWidget(bool addKey){
413 | Widget currAttach = parameters.attachment;
414 | if(currAttach == null && parameters.swipeToOpen)
415 | currAttach = new Icon(Icons.attachment, color: Colors.transparent);
416 |
417 | return new Container(
418 | key: (addKey) ? attachKey : null,
419 | child: (currAttach != null) ? currAttach : null,
420 | );
421 | }
422 |
423 | Widget scrimWidget(){
424 | if(parameters.type == sheetType.modal){
425 | if(private.getOpenPercent() != 0.0){
426 | return new Container(
427 | color: Color.lerp(Colors.transparent, parameters.scrimOpenColor, private.getOpenPercent()),
428 | child: new GestureDetector(
429 | onTap: () => (parameters.backBtnClosesAnimated) ? closeAnimated() : closeInstantaneous(),
430 | ),
431 | );
432 | }
433 | else
434 | return new Container();
435 | }
436 | else
437 | return new Container();
438 | }
439 |
440 | Widget sheetAndAttachmentWidget(){
441 |
442 | //both of these are read in by build in the first build phase
443 | double wholeWidth = wholeKey?.currentContext?.findRenderObject()?.semanticBounds?.size?.width;
444 | double wholeHeight = wholeKey?.currentContext?.findRenderObject()?.semanticBounds?.size?.height;
445 | double attachWidth = attachKey?.currentContext?.findRenderObject()?.semanticBounds?.size?.width;
446 | double attachHeight = attachKey?.currentContext?.findRenderObject()?.semanticBounds?.size?.height;
447 |
448 | double sheetWidth = (wholeWidth == null)
449 | ? 0.0
450 | : (wholeWidth == attachWidth) ? wholeWidth : wholeWidth - attachWidth;
451 | double sheetHeight = (wholeHeight == null)
452 | ? 0.0
453 | : (wholeHeight == attachHeight) ? wholeHeight : wholeHeight - attachHeight;
454 |
455 | bool isWidthMax = (parameters.position == sheetPosition.bottom || parameters.position == sheetPosition.top);
456 |
457 | attachmentSize = new Size(attachWidth, attachHeight);
458 | sheetSize = new Size(sheetWidth, sheetHeight);
459 |
460 | Widget thisSheetWidget = sheetWidget(sheetWidth, sheetHeight);
461 |
462 | Transform mainWidget = new Transform(
463 | transform: _calcTransform(isWidthMax, sheetWidth, sheetHeight),
464 | child: new Flex(
465 | direction: (isWidthMax)
466 | ? Axis.vertical
467 | : Axis.horizontal,
468 | //ONLY relevant if position is top or bottom
469 | textDirection: (parameters.position == sheetPosition.right)
470 | ? TextDirection.ltr
471 | : TextDirection.rtl,
472 | //ONLY relevant if position is left or right
473 | verticalDirection: (parameters.position == sheetPosition.top)
474 | ? VerticalDirection.up
475 | : VerticalDirection.down,
476 | crossAxisAlignment: CrossAxisAlignment.stretch,
477 | mainAxisSize: MainAxisSize.min,
478 | children: [
479 | new Expanded(
480 | child: new Container(),
481 | ),
482 | new ConstrainedBox(
483 | constraints: _calcBoxConstraints(isWidthMax),
484 | child: new Container(
485 | key: wholeKey,
486 | color: Colors.transparent,
487 | child: new SwipeToOpenClose(
488 | parameters: parameters,
489 | private: private,
490 | isWidthMax: isWidthMax,
491 | sheetWidth: sheetWidth,
492 | sheetHeight: sheetHeight,
493 | child: new Flex(
494 | direction: (isWidthMax)
495 | ? Axis.vertical
496 | : Axis.horizontal,
497 | textDirection: _calcTextDirection(),
498 | verticalDirection: _calcVerticalDirection(),
499 | crossAxisAlignment: CrossAxisAlignment.stretch,
500 | mainAxisAlignment: MainAxisAlignment.end,
501 | mainAxisSize: MainAxisSize.min,
502 | children: [
503 | thisSheetWidget,
504 | attachmentWidget(true),
505 | ],
506 | ),
507 | ),
508 | ),
509 | ),
510 | ],
511 | ),
512 |
513 | );
514 |
515 | if(parameters.placement == attachmentPlacement.inside){
516 | return mainWidget;
517 | }
518 | else{
519 | return new Stack(
520 | children: [
521 | mainWidget,
522 | new IgnorePointer(
523 | child: new Flex(
524 | direction: (isWidthMax)
525 | ? Axis.vertical
526 | : Axis.horizontal,
527 | //ONLY relevant if position is top or bottom
528 | textDirection: (parameters.position == sheetPosition.right)
529 | ? TextDirection.ltr
530 | : TextDirection.rtl,
531 | //ONLY relevant if position is left or right
532 | verticalDirection: (parameters.position == sheetPosition.top)
533 | ? VerticalDirection.up
534 | : VerticalDirection.down,
535 | crossAxisAlignment: CrossAxisAlignment.stretch,
536 | mainAxisSize: MainAxisSize.min,
537 | children: [
538 | new Expanded(
539 | child: new Container(),
540 | ),
541 | attachmentWidget(false),
542 | ],
543 | ),
544 | ),
545 | ],
546 | );
547 | }
548 | }
549 |
550 | //-------------------------Build Method----------
551 |
552 | @override
553 | Widget build(BuildContext context) {
554 |
555 | //link up functions
556 | linkPrivateFunctions();
557 | linkPublicFunctions();
558 |
559 | //for ease of use
560 | parameters = widget.parameter;
561 |
562 | //init open percent
563 | if(private.getOpenPercent() == null)
564 | private.setOpenPercent((parameters.startOpen) ? 1.0 : 0.0);
565 |
566 | //required to read in sheetWidth and sheetHeight
567 | timesBuilt++;
568 | if(timesBuilt < requiredBuildsPerChange) rebuildAsync();
569 | else timesBuilt = 0;
570 |
571 | //return our widgets
572 | return new Stack(
573 | children: [
574 | scrimWidget(),
575 | sheetAndAttachmentWidget(),
576 | ],
577 | );
578 | }
579 | }
580 |
581 | //-------------------------GestureDetector Code-------------------------
582 |
583 | //NOTE: this has to be stateful because the SingleTickerProviderStateMixin requires it
584 | class SwipeToOpenClose extends StatefulWidget {
585 |
586 | SwipeToOpenClose({
587 | @required this.parameters,
588 | @required this.private,
589 |
590 | @required this.isWidthMax,
591 | @required this.sheetWidth,
592 | @required this.sheetHeight,
593 |
594 | @required this.child,
595 | });
596 |
597 | final Parameters parameters;
598 | final PrivateFunctions private;
599 |
600 | final bool isWidthMax;
601 | final double sheetWidth;
602 | final double sheetHeight;
603 |
604 | final Widget child;
605 |
606 | @override
607 | _SwipeToOpenCloseState createState() => _SwipeToOpenCloseState();
608 | }
609 |
610 | //NOTE: this is a whole other class because the stateful class above already uses a with clause and each class can only have 1 with clause
611 | class _SwipeToOpenCloseState extends State with SingleTickerProviderStateMixin{
612 |
613 | //-------------------------Gesture Helpers
614 |
615 | Offset dragStart;
616 | double slideStart;
617 |
618 | onDragStart(DragStartDetails details){
619 | slideStart = widget.private.getOpenPercent();
620 | dragStart = details.globalPosition;
621 |
622 | //NOTE: because our animation will complete any drag...
623 | //whenever we drag we will begin dragging our slideStart will be 0.0 or 1.0
624 | if(slideStart == 0.0 && widget.parameters.swipeToOpen == false)
625 | slideStart = null;
626 | if(slideStart == 1.0 && widget.parameters.swipeToClose == false)
627 | slideStart = null;
628 | }
629 |
630 | onDragUpdate(DragUpdateDetails details){
631 | if(dragStart != null){
632 | final dragCurrent = details.globalPosition;
633 | var dragChange;
634 | if(widget.parameters.position == sheetPosition.left || widget.parameters.position == sheetPosition.top)
635 | dragChange = dragCurrent - dragStart;
636 | else
637 | dragChange = dragStart - dragCurrent;
638 |
639 | double slideAdded;
640 |
641 | if(widget.isWidthMax)
642 | slideAdded = (dragChange.dy / widget.sheetHeight);
643 | else
644 | slideAdded = (dragChange.dx / widget.sheetWidth);
645 |
646 | widget.private.getSlideUpdateStream().add((slideStart + slideAdded).clamp(0.0, 1.0));
647 | }
648 | }
649 |
650 | onDragEnd(DragEndDetails details){
651 | //clear some data
652 | dragStart = null;
653 | //calculate how long the animation should take
654 | int animationTimeInMilliseconds = widget.parameters.maxAnimationTimeInMilliseconds; //the longest it should take assuming a full animated close or open
655 | bool isOpening = (widget.private.getOpenPercent() >= 0.5);
656 | if(isOpening) animationTimeInMilliseconds = ((1 - widget.private.getOpenPercent()) * animationTimeInMilliseconds).round();
657 | else animationTimeInMilliseconds = ((0.5 - widget.private.getOpenPercent()) * animationTimeInMilliseconds).round();
658 | //compete the open or closing action
659 | completeOpenOrClose(isOpening ? 1.0 : 0.0, animationTimeInMilliseconds, widget.private);
660 | }
661 |
662 | //-------------------------System Functions
663 |
664 | @override
665 | Widget build(BuildContext context) {
666 |
667 | widget.private.setAnimationTicker(this);
668 |
669 | return GestureDetector(
670 | behavior: HitTestBehavior.translucent,
671 | //---for bottom and top sheets
672 | onVerticalDragStart: (widget.isWidthMax) ? onDragStart : null,
673 | onVerticalDragUpdate: (widget.isWidthMax) ? onDragUpdate : null,
674 | onVerticalDragEnd: (widget.isWidthMax) ? onDragEnd : null,
675 | //---for left and right sheets
676 | onHorizontalDragStart: (widget.isWidthMax) ? null : onDragStart,
677 | onHorizontalDragUpdate: (widget.isWidthMax) ? null : onDragUpdate,
678 | onHorizontalDragEnd: (widget.isWidthMax) ? null : onDragEnd,
679 | child: widget.child,
680 | );
681 | }
682 | }
683 |
684 | //-------------------------Animation Code-------------------------
685 |
686 | completeOpenOrClose(double goalOpenPercent, int millisecondsToComplete, PrivateFunctions globals){
687 | if(globals.getAnimationOpenOrClose() == null){
688 | var newOOCA = new OpenOrCloseAnimation(
689 | startOpenPercent: globals.getOpenPercent(),
690 | goalOpenPercent: goalOpenPercent,
691 | millisecondsToComplete: millisecondsToComplete,
692 |
693 | slideUpdateStream: globals.getSlideUpdateStream(),
694 | vsync: globals.getAnimationTicker(), //NOTE: this assumes you have created an animation ticker already
695 | );
696 |
697 | globals.setAnimationOpenOrClose(newOOCA);
698 | }
699 | else{
700 | globals.getAnimationOpenOrClose().startOpenPercent = globals.getOpenPercent();
701 | globals.getAnimationOpenOrClose().goalOpenPercent = goalOpenPercent;
702 | globals.getAnimationOpenOrClose().millisecondsToComplete = millisecondsToComplete;
703 | globals.getAnimationOpenOrClose().completionAnimationController.duration = new Duration(milliseconds: millisecondsToComplete);
704 | }
705 |
706 | globals.getAnimationOpenOrClose().run();
707 | }
708 |
709 | //-------------------------Animation Class-------------------------
710 |
711 | class OpenOrCloseAnimation{
712 |
713 | AnimationController completionAnimationController;
714 |
715 | double startOpenPercent;
716 | double goalOpenPercent;
717 | int millisecondsToComplete;
718 | StreamController slideUpdateStream;
719 | TickerProvider vsync;
720 |
721 | OpenOrCloseAnimation({
722 | @required this.startOpenPercent,
723 | @required this.goalOpenPercent,
724 | @required this.millisecondsToComplete,
725 |
726 | //NOTE: these variables are initially passed by the only stateful widget that has a Ticker
727 | @required this.slideUpdateStream,
728 | @required this.vsync,
729 | }){
730 | completionAnimationController = new AnimationController(
731 | duration: Duration(milliseconds: millisecondsToComplete),
732 | vsync: vsync,
733 | )
734 | ..addListener((){
735 | final slidePercent = lerpDouble(
736 | startOpenPercent,
737 | goalOpenPercent,
738 | completionAnimationController.value,
739 | );
740 |
741 | slideUpdateStream.add(slidePercent);
742 | });
743 | }
744 |
745 | run() async{
746 | completionAnimationController.forward(from: 0.0);
747 | }
748 | }
--------------------------------------------------------------------------------
/material_sheets/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | openPercent
76 | millisecondsperanimation
77 | completeOpenOrClose
78 | autoopenorclose
79 | placement
80 | type
81 | position
82 | closeSheetFunc
83 | setSlideUpdate
84 | _animationope
85 | slideupdatestre
86 | _slide
87 | animationopen
88 | _animationticker
89 | _animationopenorclose
90 | _slideupdatestream
91 | asdfOpen
92 | .add
93 | print
94 | animationticker
95 | animationopenorclose
96 | openpercent
97 | animationSpeedInMilliseconds
98 | app
99 | attachment
100 | functions
101 | linkfunction
102 | textdirection
103 | animationspeed
104 | onp
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
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 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 | 1530572478240
289 |
290 |
291 | 1530572478240
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
--------------------------------------------------------------------------------