├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example.gif ├── example ├── .gitignore ├── .metadata ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── example │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── example.iml ├── example_android.iml ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock └── pubspec.yaml ├── flutter_duration_picker.iml ├── lib └── flutter_duration_picker.dart ├── pubspec.lock ├── pubspec.yaml └── test └── flutter_duration_picker_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | example/.idea 3 | .DS_Store 4 | .dart_tool/ 5 | 6 | .packages 7 | .pub/ 8 | 9 | build/ 10 | ios/.generated/ 11 | ios/Flutter/Generated.xcconfig 12 | ios/Runner/GeneratedPluginRegistrant.* 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.4] - Oct 23, 2018 2 | 3 | * Fixed bug showing 60mins when approaching 0. 4 | 5 | ### [1.0.3] - Aug 01, 2018 6 | 7 | * Fixed bug returning false from void function 8 | 9 | ## [1.0.2] - Jul 25, 2018 10 | 11 | * Fixed initial duration when exceeding 1h 12 | 13 | ## [1.0.1] - Jun 26, 2018 14 | 15 | * initial release. 16 | 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Chris Harris 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Duration Picker for flutter 2 | 3 | A little widget for picking durations. Heavily inspired from the Material Design time picker widget. 4 | 5 | **This repo is unmaintained, please check out the fork here: https://github.com/juliansteenbakker/duration_picker** 6 | 7 | 8 | 9 | ## Example Usage: 10 | 11 | ```yaml 12 | dependencies: 13 | flutter_duration_picker: "^1.0.0" 14 | ``` 15 | 16 | ```dart 17 | import 'package:flutter/material.dart'; 18 | import 'package:flutter_duration_picker/flutter_duration_picker.dart'; 19 | 20 | void main() => runApp(new MyApp()); 21 | 22 | class MyApp extends StatelessWidget { 23 | @override 24 | Widget build(BuildContext context) { 25 | return new MaterialApp( 26 | title: 'Duration Picker Demo', 27 | theme: new ThemeData( 28 | primarySwatch: Colors.blue, 29 | ), 30 | home: new MyHomePage(title: 'Duration Picker Demo'), 31 | ); 32 | } 33 | } 34 | 35 | class MyHomePage extends StatefulWidget { 36 | MyHomePage({Key key, this.title}) : super(key: key); 37 | 38 | final String title; 39 | 40 | @override 41 | _MyHomePageState createState() => new _MyHomePageState(); 42 | } 43 | 44 | class _MyHomePageState extends State { 45 | Duration _duration = Duration(hours: 0, minutes: 0); 46 | @override 47 | Widget build(BuildContext context) { 48 | return new Scaffold( 49 | appBar: new AppBar( 50 | title: new Text(widget.title), 51 | ), 52 | body: new Center( 53 | child: new Column( 54 | mainAxisAlignment: MainAxisAlignment.center, 55 | children: [ 56 | new Expanded( 57 | // Use it from the context of a stateful widget, passing in 58 | // and saving the duration as a state variable. 59 | child: DurationPicker( 60 | duration: _duration, 61 | onChange: (val) { 62 | this.setState(() => _duration = val); 63 | }, 64 | snapToMins: 5.0, 65 | )) 66 | ], 67 | ), 68 | ), 69 | floatingActionButton: Builder( 70 | builder: (BuildContext context) => new FloatingActionButton( 71 | onPressed: () async { 72 | // Use it as a dialog, passing in an optional initial time 73 | // and returning a promise that resolves to the duration 74 | // chosen when the dialog is accepted. Null when cancelled. 75 | Duration resultingDuration = await showDurationPicker( 76 | context: context, 77 | initialTime: new Duration(minutes: 30), 78 | ); 79 | Scaffold.of(context).showSnackBar(new SnackBar( 80 | content: new Text("Chose duration: $resultingDuration"))); 81 | }, 82 | tooltip: 'Popup Duration Picker', 83 | child: new Icon(Icons.add), 84 | )), 85 | ); 86 | } 87 | } 88 | 89 | ``` 90 | 91 | -------------------------------------------------------------------------------- /example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example.gif -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 4cd5870ecef50fbf4fd7e681cf327897f0695abe 8 | channel: master 9 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | throw new GradleException("versionCode not found. Define flutter.versionCode in the local.properties file.") 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | throw new GradleException("versionName not found. Define flutter.versionName in the local.properties file.") 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.example" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.example; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/example.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/example_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 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 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | /* End PBXFrameworksBuildPhase section */ 72 | 73 | /* Begin PBXGroup section */ 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 78 | 3B80C3931E831B6300D905FE /* App.framework */, 79 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 80 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 81 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 82 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 83 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 84 | ); 85 | name = Flutter; 86 | sourceTree = ""; 87 | }; 88 | 97C146E51CF9000F007C117D = { 89 | isa = PBXGroup; 90 | children = ( 91 | 9740EEB11CF90186004384FC /* Flutter */, 92 | 97C146F01CF9000F007C117D /* Runner */, 93 | 97C146EF1CF9000F007C117D /* Products */, 94 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 97C146EF1CF9000F007C117D /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146EE1CF9000F007C117D /* Runner.app */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 97C146F01CF9000F007C117D /* Runner */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 110 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 111 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 112 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 113 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 114 | 97C147021CF9000F007C117D /* Info.plist */, 115 | 97C146F11CF9000F007C117D /* Supporting Files */, 116 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 117 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 118 | ); 119 | path = Runner; 120 | sourceTree = ""; 121 | }; 122 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 97C146F21CF9000F007C117D /* main.m */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 97C146ED1CF9000F007C117D /* Runner */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 136 | buildPhases = ( 137 | 9740EEB61CF901F6004384FC /* Run Script */, 138 | 97C146EA1CF9000F007C117D /* Sources */, 139 | 97C146EB1CF9000F007C117D /* Frameworks */, 140 | 97C146EC1CF9000F007C117D /* Resources */, 141 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 142 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 0910; 160 | ORGANIZATIONNAME = "The Chromium Authors"; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 3.2"; 169 | developmentRegion = English; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 194 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 195 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 196 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | /* End PBXResourcesBuildPhase section */ 201 | 202 | /* Begin PBXShellScriptBuildPhase section */ 203 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 204 | isa = PBXShellScriptBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | inputPaths = ( 209 | ); 210 | name = "Thin Binary"; 211 | outputPaths = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | shellPath = /bin/sh; 215 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 216 | }; 217 | 9740EEB61CF901F6004384FC /* Run Script */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputPaths = ( 223 | ); 224 | name = "Run Script"; 225 | outputPaths = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | shellPath = /bin/sh; 229 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 230 | }; 231 | /* End PBXShellScriptBuildPhase section */ 232 | 233 | /* Begin PBXSourcesBuildPhase section */ 234 | 97C146EA1CF9000F007C117D /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 239 | 97C146F31CF9000F007C117D /* main.m in Sources */, 240 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | /* End PBXSourcesBuildPhase section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 97C146FB1CF9000F007C117D /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 97C147001CF9000F007C117D /* Base */, 259 | ); 260 | name = LaunchScreen.storyboard; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 97C147031CF9000F007C117D /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 269 | buildSettings = { 270 | ALWAYS_SEARCH_USER_PATHS = NO; 271 | CLANG_ANALYZER_NONNULL = YES; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_COMMA = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 281 | CLANG_WARN_EMPTY_BODY = YES; 282 | CLANG_WARN_ENUM_CONVERSION = YES; 283 | CLANG_WARN_INFINITE_RECURSION = YES; 284 | CLANG_WARN_INT_CONVERSION = YES; 285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 286 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 289 | CLANG_WARN_STRICT_PROTOTYPES = YES; 290 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 291 | CLANG_WARN_UNREACHABLE_CODE = YES; 292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 294 | COPY_PHASE_STRIP = NO; 295 | DEBUG_INFORMATION_FORMAT = dwarf; 296 | ENABLE_STRICT_OBJC_MSGSEND = YES; 297 | ENABLE_TESTABILITY = YES; 298 | GCC_C_LANGUAGE_STANDARD = gnu99; 299 | GCC_DYNAMIC_NO_PIC = NO; 300 | GCC_NO_COMMON_BLOCKS = YES; 301 | GCC_OPTIMIZATION_LEVEL = 0; 302 | GCC_PREPROCESSOR_DEFINITIONS = ( 303 | "DEBUG=1", 304 | "$(inherited)", 305 | ); 306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 308 | GCC_WARN_UNDECLARED_SELECTOR = YES; 309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 310 | GCC_WARN_UNUSED_FUNCTION = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 313 | MTL_ENABLE_DEBUG_INFO = YES; 314 | ONLY_ACTIVE_ARCH = YES; 315 | SDKROOT = iphoneos; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | 97C147041CF9000F007C117D /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 97C147061CF9000F007C117D /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 371 | buildSettings = { 372 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 373 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 374 | ENABLE_BITCODE = NO; 375 | FRAMEWORK_SEARCH_PATHS = ( 376 | "$(inherited)", 377 | "$(PROJECT_DIR)/Flutter", 378 | ); 379 | INFOPLIST_FILE = Runner/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 381 | LIBRARY_SEARCH_PATHS = ( 382 | "$(inherited)", 383 | "$(PROJECT_DIR)/Flutter", 384 | ); 385 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | VERSIONING_SYSTEM = "apple-generic"; 388 | }; 389 | name = Debug; 390 | }; 391 | 97C147071CF9000F007C117D /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 394 | buildSettings = { 395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 396 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 397 | ENABLE_BITCODE = NO; 398 | FRAMEWORK_SEARCH_PATHS = ( 399 | "$(inherited)", 400 | "$(PROJECT_DIR)/Flutter", 401 | ); 402 | INFOPLIST_FILE = Runner/Info.plist; 403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 404 | LIBRARY_SEARCH_PATHS = ( 405 | "$(inherited)", 406 | "$(PROJECT_DIR)/Flutter", 407 | ); 408 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | VERSIONING_SYSTEM = "apple-generic"; 411 | }; 412 | name = Release; 413 | }; 414 | /* End XCBuildConfiguration section */ 415 | 416 | /* Begin XCConfigurationList section */ 417 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 418 | isa = XCConfigurationList; 419 | buildConfigurations = ( 420 | 97C147031CF9000F007C117D /* Debug */, 421 | 97C147041CF9000F007C117D /* Release */, 422 | ); 423 | defaultConfigurationIsVisible = 0; 424 | defaultConfigurationName = Release; 425 | }; 426 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 427 | isa = XCConfigurationList; 428 | buildConfigurations = ( 429 | 97C147061CF9000F007C117D /* Debug */, 430 | 97C147071CF9000F007C117D /* Release */, 431 | ); 432 | defaultConfigurationIsVisible = 0; 433 | defaultConfigurationName = Release; 434 | }; 435 | /* End XCConfigurationList section */ 436 | }; 437 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 438 | } 439 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 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 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdharris/flutter_duration_picker/9774e1a44b93e1b2079e1d76b015b550d4a00164/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_duration_picker/flutter_duration_picker.dart'; 3 | 4 | void main() => runApp(new MyApp()); 5 | 6 | class MyApp extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return new MaterialApp( 10 | title: 'Duration Picker Demo', 11 | theme: new ThemeData( 12 | primarySwatch: Colors.blue, 13 | ), 14 | home: new MyHomePage(title: 'Duration Picker Demo'), 15 | ); 16 | } 17 | } 18 | 19 | class MyHomePage extends StatefulWidget { 20 | MyHomePage({Key key, this.title}) : super(key: key); 21 | 22 | final String title; 23 | 24 | @override 25 | _MyHomePageState createState() => new _MyHomePageState(); 26 | } 27 | 28 | class _MyHomePageState extends State { 29 | Duration _duration = Duration(hours: 0, minutes: 0); 30 | @override 31 | Widget build(BuildContext context) { 32 | return new Scaffold( 33 | appBar: new AppBar( 34 | title: new Text(widget.title), 35 | ), 36 | body: new Center( 37 | child: new Column( 38 | mainAxisAlignment: MainAxisAlignment.center, 39 | children: [ 40 | new Expanded( 41 | child: DurationPicker( 42 | duration: _duration, 43 | onChange: (val) { 44 | this.setState(() => _duration = val); 45 | }, 46 | snapToMins: 5.0, 47 | )) 48 | ], 49 | ), 50 | ), 51 | floatingActionButton: Builder( 52 | builder: (BuildContext context) => new FloatingActionButton( 53 | onPressed: () async { 54 | Duration resultingDuration = await showDurationPicker( 55 | context: context, 56 | initialTime: new Duration(minutes: 30), 57 | ); 58 | Scaffold.of(context).showSnackBar(new SnackBar( 59 | content: new Text("Chose duration: $resultingDuration"))); 60 | }, 61 | tooltip: 'Popup Duration Picker', 62 | child: new Icon(Icons.add), 63 | )), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /example/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.5" 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 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_duration_picker: 73 | dependency: "direct main" 74 | description: 75 | path: ".." 76 | relative: true 77 | source: path 78 | version: "1.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+1" 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.5" 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 | json_rpc_2: 141 | dependency: transitive 142 | description: 143 | name: json_rpc_2 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "2.0.8" 147 | kernel: 148 | dependency: transitive 149 | description: 150 | name: kernel 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.3.0-alpha.12" 154 | logging: 155 | dependency: transitive 156 | description: 157 | name: logging 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.11.3+1" 161 | matcher: 162 | dependency: transitive 163 | description: 164 | name: matcher 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.12.2" 168 | meta: 169 | dependency: transitive 170 | description: 171 | name: meta 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.1.5" 175 | mime: 176 | dependency: transitive 177 | description: 178 | name: mime 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.9.6+1" 182 | multi_server_socket: 183 | dependency: transitive 184 | description: 185 | name: multi_server_socket 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.0.1" 189 | node_preamble: 190 | dependency: transitive 191 | description: 192 | name: node_preamble 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.4.2" 196 | package_config: 197 | dependency: transitive 198 | description: 199 | name: package_config 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.0.3" 203 | package_resolver: 204 | dependency: transitive 205 | description: 206 | name: package_resolver 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.0.3" 210 | path: 211 | dependency: transitive 212 | description: 213 | name: path 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.6.1" 217 | plugin: 218 | dependency: transitive 219 | description: 220 | name: plugin 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "0.2.0+2" 224 | pool: 225 | dependency: transitive 226 | description: 227 | name: pool 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.3.5" 231 | pub_semver: 232 | dependency: transitive 233 | description: 234 | name: pub_semver 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "1.4.1" 238 | quiver: 239 | dependency: transitive 240 | description: 241 | name: quiver 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "0.29.0+1" 245 | shelf: 246 | dependency: transitive 247 | description: 248 | name: shelf 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "0.7.3+1" 252 | shelf_packages_handler: 253 | dependency: transitive 254 | description: 255 | name: shelf_packages_handler 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.0.3" 259 | shelf_static: 260 | dependency: transitive 261 | description: 262 | name: shelf_static 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "0.2.7+1" 266 | shelf_web_socket: 267 | dependency: transitive 268 | description: 269 | name: shelf_web_socket 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "0.2.2+2" 273 | sky_engine: 274 | dependency: transitive 275 | description: flutter 276 | source: sdk 277 | version: "0.0.99" 278 | source_map_stack_trace: 279 | dependency: transitive 280 | description: 281 | name: source_map_stack_trace 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "1.1.4" 285 | source_maps: 286 | dependency: transitive 287 | description: 288 | name: source_maps 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "0.10.5" 292 | source_span: 293 | dependency: transitive 294 | description: 295 | name: source_span 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.4.0" 299 | stack_trace: 300 | dependency: transitive 301 | description: 302 | name: stack_trace 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.9.2" 306 | stream_channel: 307 | dependency: transitive 308 | description: 309 | name: stream_channel 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.6.7+1" 313 | string_scanner: 314 | dependency: transitive 315 | description: 316 | name: string_scanner 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.0.2" 320 | term_glyph: 321 | dependency: transitive 322 | description: 323 | name: term_glyph 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "1.0.0" 327 | test: 328 | dependency: transitive 329 | description: 330 | name: test 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "0.12.41" 334 | typed_data: 335 | dependency: transitive 336 | description: 337 | name: typed_data 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "1.1.5" 341 | utf: 342 | dependency: transitive 343 | description: 344 | name: utf 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "0.9.0+4" 348 | vector_math: 349 | dependency: transitive 350 | description: 351 | name: vector_math 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "2.0.6" 355 | vm_service_client: 356 | dependency: transitive 357 | description: 358 | name: vm_service_client 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "0.2.4+3" 362 | watcher: 363 | dependency: transitive 364 | description: 365 | name: watcher 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "0.9.7+8" 369 | web_socket_channel: 370 | dependency: transitive 371 | description: 372 | name: web_socket_channel 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "1.0.8" 376 | yaml: 377 | dependency: transitive 378 | description: 379 | name: yaml 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "2.1.14" 383 | sdks: 384 | dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.62.0.flutter-4b2d60cb18" 385 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Example using Flutter Duration Picker 3 | 4 | version: 1.0.0 5 | 6 | dependencies: 7 | flutter: 8 | sdk: flutter 9 | flutter_duration_picker: 10 | path: ../ 11 | 12 | dev_dependencies: 13 | flutter_test: 14 | sdk: flutter 15 | 16 | 17 | flutter: 18 | uses-material-design: true -------------------------------------------------------------------------------- /flutter_duration_picker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lib/flutter_duration_picker.dart: -------------------------------------------------------------------------------- 1 | library flutter_duration_picker; 2 | 3 | import 'dart:async'; 4 | import 'dart:math' as math; 5 | 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter/services.dart'; 9 | import 'package:flutter/widgets.dart'; 10 | 11 | const Duration _kDialAnimateDuration = const Duration(milliseconds: 200); 12 | 13 | const double _kDurationPickerWidthPortrait = 328.0; 14 | const double _kDurationPickerWidthLandscape = 512.0; 15 | 16 | const double _kDurationPickerHeightPortrait = 380.0; 17 | const double _kDurationPickerHeightLandscape = 304.0; 18 | 19 | const double _kTwoPi = 2 * math.pi; 20 | const double _kPiByTwo = math.pi / 2; 21 | 22 | const double _kCircleTop = _kPiByTwo; 23 | //const double _kCircleBottom = 3 * math.pi / 2; 24 | //const double _kCircleRight = 0.0; 25 | //const double _kCircleRightComplete = _kTwoPi; 26 | //const double _kCircleLeft = math.pi; 27 | 28 | class _DialPainter extends CustomPainter { 29 | const _DialPainter({ 30 | @required this.context, 31 | @required this.labels, 32 | @required this.backgroundColor, 33 | @required this.accentColor, 34 | @required this.theta, 35 | @required this.textDirection, 36 | @required this.selectedValue, 37 | @required this.pct, 38 | @required this.multiplier, 39 | @required this.minuteHand, 40 | }); 41 | 42 | final List labels; 43 | final Color backgroundColor; 44 | final Color accentColor; 45 | final double theta; 46 | final TextDirection textDirection; 47 | final int selectedValue; 48 | final BuildContext context; 49 | 50 | final double pct; 51 | final int multiplier; 52 | final int minuteHand; 53 | 54 | @override 55 | void paint(Canvas canvas, Size size) { 56 | const double _epsilon = .001; 57 | const double _sweep = _kTwoPi - _epsilon; 58 | const double _startAngle = -math.pi / 2.0; 59 | 60 | final double radius = size.shortestSide / 2.0; 61 | final Offset center = new Offset(size.width / 2.0, size.height / 2.0); 62 | final Offset centerPoint = center; 63 | 64 | double pctTheta = (0.25 - (theta % _kTwoPi) / _kTwoPi) % 1.0; 65 | 66 | // Draw the background outer ring 67 | canvas.drawCircle( 68 | centerPoint, radius, new Paint()..color = backgroundColor); 69 | 70 | // Draw a translucent circle for every hour 71 | for (int i = 0; i < multiplier; i = i + 1) { 72 | canvas.drawCircle(centerPoint, radius, 73 | new Paint()..color = accentColor.withOpacity((i == 0) ? 0.3 : 0.1)); 74 | } 75 | 76 | // Draw the inner background circle 77 | canvas.drawCircle( 78 | centerPoint, radius * 0.88, new Paint()..color = Theme.of(context).canvasColor); 79 | 80 | // Get the offset point for an angle value of theta, and a distance of _radius 81 | Offset getOffsetForTheta(double theta, double _radius) { 82 | return center + 83 | new Offset(_radius * math.cos(theta), -_radius * math.sin(theta)); 84 | } 85 | 86 | // Draw the handle that is used to drag and to indicate the position around the circle 87 | final Paint handlePaint = new Paint()..color = accentColor; 88 | final Offset handlePoint = getOffsetForTheta(theta, radius - 10.0); 89 | canvas.drawCircle(handlePoint, 20.0, handlePaint); 90 | 91 | // Draw the Text in the center of the circle which displays hours and mins 92 | String hours = (multiplier == 0) ? '' : "${multiplier}h "; 93 | // int minutes = (pctTheta * 60).round(); 94 | // minutes = minutes == 60 ? 0 : minutes; 95 | String minutes = "$minuteHand"; 96 | 97 | TextPainter textDurationValuePainter = new TextPainter( 98 | textAlign: TextAlign.center, 99 | text: new TextSpan( 100 | // text: '${hours}${minutes > 0 ? minutes : ""}', 101 | text: '${hours}${minutes}', 102 | style: Theme.of(context) 103 | .textTheme 104 | .display3 105 | .copyWith(fontSize: size.shortestSide * 0.15)), 106 | textDirection: TextDirection.ltr) 107 | ..layout(); 108 | Offset middleForValueText = new Offset( 109 | centerPoint.dx - (textDurationValuePainter.width / 2), 110 | centerPoint.dy - textDurationValuePainter.height / 2); 111 | textDurationValuePainter.paint(canvas, middleForValueText); 112 | 113 | TextPainter textMinPainter = new TextPainter( 114 | textAlign: TextAlign.center, 115 | text: new TextSpan( 116 | text: 'min.', //th: ${theta}', 117 | style: Theme.of(context).textTheme.body1), 118 | textDirection: TextDirection.ltr) 119 | ..layout(); 120 | textMinPainter.paint( 121 | canvas, 122 | new Offset( 123 | centerPoint.dx - (textMinPainter.width / 2), 124 | centerPoint.dy + 125 | (textDurationValuePainter.height / 2) - 126 | textMinPainter.height / 2)); 127 | 128 | // Draw an arc around the circle for the amount of the circle that has elapsed. 129 | var elapsedPainter = new Paint() 130 | ..style = PaintingStyle.stroke 131 | ..strokeCap = StrokeCap.round 132 | ..color = accentColor.withOpacity(0.3) 133 | ..isAntiAlias = true 134 | ..strokeWidth = radius * 0.12; 135 | 136 | canvas.drawArc( 137 | new Rect.fromCircle( 138 | center: centerPoint, 139 | radius: radius - radius * 0.12 / 2, 140 | ), 141 | _startAngle, 142 | _sweep * pctTheta, 143 | false, 144 | elapsedPainter, 145 | ); 146 | 147 | // Paint the labels (the minute strings) 148 | void paintLabels(List labels) { 149 | if (labels == null) return; 150 | final double labelThetaIncrement = -_kTwoPi / labels.length; 151 | double labelTheta = _kPiByTwo; 152 | 153 | for (TextPainter label in labels) { 154 | final Offset labelOffset = 155 | new Offset(-label.width / 2.0, -label.height / 2.0); 156 | 157 | label.paint( 158 | canvas, getOffsetForTheta(labelTheta, radius - 40.0) + labelOffset); 159 | 160 | labelTheta += labelThetaIncrement; 161 | } 162 | } 163 | 164 | paintLabels(labels); 165 | } 166 | 167 | @override 168 | bool shouldRepaint(_DialPainter oldPainter) { 169 | return oldPainter.labels != labels || 170 | oldPainter.backgroundColor != backgroundColor || 171 | oldPainter.accentColor != accentColor || 172 | oldPainter.theta != theta; 173 | } 174 | } 175 | 176 | class _Dial extends StatefulWidget { 177 | const _Dial( 178 | {@required this.duration, 179 | @required this.onChanged, 180 | this.snapToMins = 1.0}) 181 | : assert(duration != null); 182 | 183 | final Duration duration; 184 | final ValueChanged onChanged; 185 | 186 | /// The resolution of mins of the dial, i.e. if snapToMins = 5.0, only durations of 5min intervals will be selectable. 187 | final double snapToMins; 188 | @override 189 | _DialState createState() => new _DialState(); 190 | } 191 | 192 | class _DialState extends State<_Dial> with SingleTickerProviderStateMixin { 193 | @override 194 | void initState() { 195 | super.initState(); 196 | _thetaController = new AnimationController( 197 | duration: _kDialAnimateDuration, 198 | vsync: this, 199 | ); 200 | _thetaTween = 201 | new Tween(begin: _getThetaForDuration(widget.duration)); 202 | _theta = _thetaTween.animate(new CurvedAnimation( 203 | parent: _thetaController, curve: Curves.fastOutSlowIn)) 204 | ..addListener(() => setState(() {})); 205 | _thetaController.addStatusListener((status) { 206 | // if (status == AnimationStatus.completed && _hours != _snappedHours) { 207 | // _hours = _snappedHours; 208 | if (status == AnimationStatus.completed) { 209 | _hours = _hourHand(_turningAngle); 210 | _minutes = _minuteHand(_turningAngle); 211 | setState(() {}); 212 | } 213 | }); 214 | // _hours = widget.duration.inHours; 215 | 216 | _turningAngle = _kPiByTwo - widget.duration.inMinutes / 60.0 * _kTwoPi; 217 | _hours = _hourHand(_turningAngle); 218 | _minutes = _minuteHand(_turningAngle); 219 | 220 | } 221 | 222 | ThemeData themeData; 223 | MaterialLocalizations localizations; 224 | MediaQueryData media; 225 | 226 | @override 227 | void didChangeDependencies() { 228 | super.didChangeDependencies(); 229 | assert(debugCheckHasMediaQuery(context)); 230 | themeData = Theme.of(context); 231 | localizations = MaterialLocalizations.of(context); 232 | media = MediaQuery.of(context); 233 | } 234 | 235 | @override 236 | void dispose() { 237 | _thetaController.dispose(); 238 | super.dispose(); 239 | } 240 | 241 | Tween _thetaTween; 242 | Animation _theta; 243 | AnimationController _thetaController; 244 | 245 | double _pct = 0.0; 246 | int _hours = 0; 247 | // int _snappedHours = 0; 248 | bool _dragging = false; 249 | int _minutes = 0; 250 | double _turningAngle = 0.0; 251 | 252 | 253 | static double _nearest(double target, double a, double b) { 254 | return ((target - a).abs() < (target - b).abs()) ? a : b; 255 | } 256 | 257 | void _animateTo(double targetTheta) { 258 | final double currentTheta = _theta.value; 259 | double beginTheta = 260 | _nearest(targetTheta, currentTheta, currentTheta + _kTwoPi); 261 | beginTheta = _nearest(targetTheta, beginTheta, currentTheta - _kTwoPi); 262 | _thetaTween 263 | ..begin = beginTheta 264 | ..end = targetTheta; 265 | _thetaController 266 | ..value = 0.0 267 | ..forward(); 268 | } 269 | 270 | double _getThetaForDuration(Duration duration) { 271 | // final double fractionalRotation = (duration.inMinutes / 60); 272 | // var theta = (_kPiByTwo - fractionalRotation * _kTwoPi) % _kTwoPi; 273 | // return theta; 274 | 275 | return (_kPiByTwo - (duration.inMinutes % 60) / 60.0 * _kTwoPi) % _kTwoPi; 276 | } 277 | 278 | Duration _getTimeForTheta(double theta) { 279 | return _angleToDuration(_turningAngle); 280 | // double fractionalRotation = (0.25 - (theta / _kTwoPi)); 281 | // fractionalRotation = fractionalRotation < 0 282 | // ? 1 - fractionalRotation.abs() 283 | // : fractionalRotation; 284 | // int mins = (fractionalRotation * 60).round(); 285 | // if (widget.snapToMins != null) { 286 | // mins = ((mins / widget.snapToMins).round() * widget.snapToMins).round(); 287 | // } 288 | // if (mins == 60) { 289 | // _snappedHours = _hours + 1; 290 | // mins = 0; 291 | // return new Duration(hours: _snappedHours, minutes: mins); 292 | // } else { 293 | // _snappedHours = _hours; 294 | // return new Duration(hours: _hours, minutes: mins); 295 | // } 296 | } 297 | 298 | Duration _notifyOnChangedIfNeeded() { 299 | // final Duration current = _getTimeForTheta(_theta.value); 300 | // var d = Duration(hours: _hours, minutes: current.inMinutes % 60); 301 | _hours = _hourHand(_turningAngle); 302 | _minutes = _minuteHand(_turningAngle); 303 | 304 | var d = _angleToDuration(_turningAngle); 305 | 306 | widget.onChanged(d); 307 | 308 | return d; 309 | } 310 | 311 | void _updateThetaForPan() { 312 | setState(() { 313 | final Offset offset = _position - _center; 314 | final double angle = 315 | (math.atan2(offset.dx, offset.dy) - _kPiByTwo) % _kTwoPi; 316 | 317 | // Stop accidental abrupt pans from making the dial seem like it starts from 1h. 318 | // (happens when wanting to pan from 0 clockwise, but when doing so quickly, one actually pans from before 0 (e.g. setting the duration to 59mins, and then crossing 0, which would then mean 1h 1min). 319 | if (angle >= _kCircleTop && 320 | _theta.value <= _kCircleTop && 321 | _theta.value >= 0.1 && // to allow the radians sign change at 15mins. 322 | _hours == 0) return; 323 | 324 | _thetaTween 325 | ..begin = angle 326 | ..end = angle; 327 | }); 328 | } 329 | 330 | Offset _position; 331 | Offset _center; 332 | 333 | void _handlePanStart(DragStartDetails details) { 334 | assert(!_dragging); 335 | _dragging = true; 336 | final RenderBox box = context.findRenderObject(); 337 | _position = box.globalToLocal(details.globalPosition); 338 | _center = box.size.center(Offset.zero); 339 | 340 | //_updateThetaForPan(); 341 | _notifyOnChangedIfNeeded(); 342 | } 343 | 344 | void _handlePanUpdate(DragUpdateDetails details) { 345 | double oldTheta = _theta.value; 346 | _position += details.delta; 347 | _updateThetaForPan(); 348 | double newTheta = _theta.value; 349 | 350 | // _updateRotations(oldTheta, newTheta); 351 | _updateTurningAngle(oldTheta, newTheta); 352 | _notifyOnChangedIfNeeded(); 353 | } 354 | 355 | // void _updateRotations(double oldTheta, double newTheta) { 356 | // // If the angle crosses clockwise through 12'o'clock 357 | // if (oldTheta > _kCircleTop && 358 | // newTheta <= _kCircleTop && 359 | // oldTheta < _kCircleLeft) { 360 | // setState(() => _hours = _hours + 1); 361 | // // If the angle cross anti-clockwise through 12'o'clock 362 | // } else if (oldTheta <= _kCircleTop && 363 | // newTheta > _kCircleTop && 364 | // newTheta < _kCircleBottom) { 365 | // if (_hours > 0) { 366 | // setState(() => _hours = _hours - 1); 367 | // } 368 | // } 369 | // } 370 | 371 | int _hourHand(double angle) { 372 | return _angleToDuration(angle).inHours.toInt(); 373 | } 374 | 375 | int _minuteHand(double angle) { 376 | // Result is in [0; 59], even if overall time is >= 1 hour 377 | return (_angleToMinutes(angle) % 60.0).toInt(); 378 | } 379 | 380 | Duration _angleToDuration(double angle) { 381 | return _minutesToDuration(_angleToMinutes(angle)); 382 | } 383 | 384 | Duration _minutesToDuration(minutes) { 385 | return Duration(hours: (minutes ~/ 60).toInt(), minutes: (minutes % 60.0).toInt()); 386 | } 387 | 388 | double _angleToMinutes(double angle) { 389 | // Coordinate transformation from mathematical COS to dial COS 390 | double dialAngle = _kPiByTwo - angle; 391 | 392 | // Turn dial angle into minutes, may go beyond 60 minutes (multiple turns) 393 | return dialAngle / _kTwoPi * 60.0; 394 | } 395 | 396 | void _updateTurningAngle(double oldTheta, double newTheta) { 397 | // Register any angle by which the user has turned the dial. 398 | // 399 | // The resulting turning angle fully captures the state of the dial, 400 | // including multiple turns (= full hours). The [_turningAngle] is in 401 | // mathematical coordinate system, i.e. 3-o-clock position being zero, and 402 | // increasing counter clock wise. 403 | 404 | // From positive to negative (in mathematical COS) 405 | if (newTheta > 1.5 * math.pi && oldTheta < 0.5 * math.pi) { 406 | _turningAngle = _turningAngle - ((_kTwoPi - newTheta) + oldTheta); 407 | } 408 | // From negative to positive (in mathematical COS) 409 | else if (newTheta < 0.5 * math.pi && oldTheta > 1.5 * math.pi) { 410 | _turningAngle = _turningAngle + ((_kTwoPi - oldTheta) + newTheta); 411 | } 412 | else { 413 | _turningAngle = _turningAngle + (newTheta - oldTheta); 414 | } 415 | } 416 | 417 | void _handlePanEnd(DragEndDetails details) { 418 | assert(_dragging); 419 | _dragging = false; 420 | _position = null; 421 | _center = null; 422 | //_notifyOnChangedIfNeeded(); 423 | _animateTo(_getThetaForDuration(widget.duration)); 424 | } 425 | 426 | void _handleTapUp(TapUpDetails details) { 427 | final RenderBox box = context.findRenderObject(); 428 | _position = box.globalToLocal(details.globalPosition); 429 | _center = box.size.center(Offset.zero); 430 | _updateThetaForPan(); 431 | _notifyOnChangedIfNeeded(); 432 | 433 | _animateTo(_getThetaForDuration(_getTimeForTheta(_theta.value))); 434 | _dragging = false; 435 | _position = null; 436 | _center = null; 437 | } 438 | 439 | List _buildMinutes(TextTheme textTheme) { 440 | final TextStyle style = textTheme.subhead; 441 | 442 | const List _minuteMarkerValues = const [ 443 | const Duration(hours: 0, minutes: 0), 444 | const Duration(hours: 0, minutes: 5), 445 | const Duration(hours: 0, minutes: 10), 446 | const Duration(hours: 0, minutes: 15), 447 | const Duration(hours: 0, minutes: 20), 448 | const Duration(hours: 0, minutes: 25), 449 | const Duration(hours: 0, minutes: 30), 450 | const Duration(hours: 0, minutes: 35), 451 | const Duration(hours: 0, minutes: 40), 452 | const Duration(hours: 0, minutes: 45), 453 | const Duration(hours: 0, minutes: 50), 454 | const Duration(hours: 0, minutes: 55), 455 | ]; 456 | 457 | final List labels = []; 458 | for (Duration duration in _minuteMarkerValues) { 459 | var painter = new TextPainter( 460 | text: new TextSpan(style: style, text: duration.inMinutes.toString()), 461 | textDirection: TextDirection.ltr, 462 | )..layout(); 463 | labels.add(painter); 464 | } 465 | return labels; 466 | } 467 | 468 | @override 469 | Widget build(BuildContext context) { 470 | Color backgroundColor; 471 | switch (themeData.brightness) { 472 | case Brightness.light: 473 | backgroundColor = Colors.grey[200]; 474 | break; 475 | case Brightness.dark: 476 | backgroundColor = themeData.backgroundColor; 477 | break; 478 | } 479 | 480 | final ThemeData theme = Theme.of(context); 481 | 482 | int selectedDialValue; 483 | _hours = _hourHand(_turningAngle); 484 | _minutes = _minuteHand(_turningAngle); 485 | 486 | return new GestureDetector( 487 | excludeFromSemantics: true, 488 | onPanStart: _handlePanStart, 489 | onPanUpdate: _handlePanUpdate, 490 | onPanEnd: _handlePanEnd, 491 | onTapUp: _handleTapUp, 492 | child: new CustomPaint( 493 | painter: new _DialPainter( 494 | pct: _pct, 495 | multiplier: _hours, 496 | minuteHand: _minutes, 497 | context: context, 498 | selectedValue: selectedDialValue, 499 | labels: _buildMinutes(theme.textTheme), 500 | backgroundColor: backgroundColor, 501 | accentColor: themeData.accentColor, 502 | theta: _theta.value, 503 | textDirection: Directionality.of(context), 504 | ), 505 | )); 506 | } 507 | } 508 | 509 | /// A duration picker designed to appear inside a popup dialog. 510 | /// 511 | /// Pass this widget to [showDialog]. The value returned by [showDialog] is the 512 | /// selected [Duration] if the user taps the "OK" button, or null if the user 513 | /// taps the "CANCEL" button. The selected time is reported by calling 514 | /// [Navigator.pop]. 515 | class _DurationPickerDialog extends StatefulWidget { 516 | /// Creates a duration picker. 517 | /// 518 | /// [initialTime] must not be null. 519 | const _DurationPickerDialog( 520 | {Key key, @required this.initialTime, this.snapToMins}) 521 | : assert(initialTime != null), 522 | super(key: key); 523 | 524 | /// The duration initially selected when the dialog is shown. 525 | final Duration initialTime; 526 | final double snapToMins; 527 | 528 | @override 529 | _DurationPickerDialogState createState() => new _DurationPickerDialogState(); 530 | } 531 | 532 | class _DurationPickerDialogState extends State<_DurationPickerDialog> { 533 | @override 534 | void initState() { 535 | super.initState(); 536 | _selectedDuration = widget.initialTime; 537 | } 538 | 539 | @override 540 | void didChangeDependencies() { 541 | super.didChangeDependencies(); 542 | localizations = MaterialLocalizations.of(context); 543 | } 544 | 545 | Duration get selectedDuration => _selectedDuration; 546 | Duration _selectedDuration; 547 | 548 | MaterialLocalizations localizations; 549 | 550 | void _handleTimeChanged(Duration value) { 551 | setState(() { 552 | _selectedDuration = value; 553 | }); 554 | } 555 | 556 | void _handleCancel() { 557 | Navigator.pop(context); 558 | } 559 | 560 | void _handleOk() { 561 | Navigator.pop(context, _selectedDuration); 562 | } 563 | 564 | @override 565 | Widget build(BuildContext context) { 566 | assert(debugCheckHasMediaQuery(context)); 567 | final ThemeData theme = Theme.of(context); 568 | 569 | final Widget picker = new Padding( 570 | padding: const EdgeInsets.all(16.0), 571 | child: new AspectRatio( 572 | aspectRatio: 1.0, 573 | child: new _Dial( 574 | duration: _selectedDuration, 575 | onChanged: _handleTimeChanged, 576 | snapToMins: widget.snapToMins, 577 | ))); 578 | 579 | final Widget actions = new ButtonTheme.bar( 580 | child: new ButtonBar(children: [ 581 | new FlatButton( 582 | child: new Text(localizations.cancelButtonLabel), 583 | onPressed: _handleCancel), 584 | new FlatButton( 585 | child: new Text(localizations.okButtonLabel), onPressed: _handleOk), 586 | ])); 587 | 588 | final Dialog dialog = new Dialog(child: new OrientationBuilder( 589 | builder: (BuildContext context, Orientation orientation) { 590 | final Widget pickerAndActions = new Container( 591 | color: theme.dialogBackgroundColor, 592 | child: new Column( 593 | mainAxisSize: MainAxisSize.min, 594 | children: [ 595 | new Expanded( 596 | child: 597 | picker), // picker grows and shrinks with the available space 598 | actions, 599 | ], 600 | ), 601 | ); 602 | 603 | assert(orientation != null); 604 | switch (orientation) { 605 | case Orientation.portrait: 606 | return new SizedBox( 607 | width: _kDurationPickerWidthPortrait, 608 | height: _kDurationPickerHeightPortrait, 609 | child: new Column( 610 | mainAxisSize: MainAxisSize.min, 611 | crossAxisAlignment: CrossAxisAlignment.stretch, 612 | children: [ 613 | new Expanded( 614 | child: pickerAndActions, 615 | ), 616 | ])); 617 | case Orientation.landscape: 618 | return new SizedBox( 619 | width: _kDurationPickerWidthLandscape, 620 | height: _kDurationPickerHeightLandscape, 621 | child: new Row( 622 | mainAxisSize: MainAxisSize.min, 623 | crossAxisAlignment: CrossAxisAlignment.stretch, 624 | children: [ 625 | new Flexible( 626 | child: pickerAndActions, 627 | ), 628 | ])); 629 | } 630 | return null; 631 | })); 632 | 633 | return new Theme( 634 | data: theme.copyWith( 635 | dialogBackgroundColor: Colors.transparent, 636 | ), 637 | child: dialog, 638 | ); 639 | } 640 | 641 | @override 642 | void dispose() { 643 | super.dispose(); 644 | } 645 | } 646 | 647 | /// Shows a dialog containing the duration picker. 648 | /// 649 | /// The returned Future resolves to the duration selected by the user when the user 650 | /// closes the dialog. If the user cancels the dialog, null is returned. 651 | /// 652 | /// To show a dialog with [initialTime] equal to the current time: 653 | /// 654 | /// ```dart 655 | /// showDurationPicker( 656 | /// initialTime: new Duration.now(), 657 | /// context: context, 658 | /// ); 659 | /// ``` 660 | Future showDurationPicker( 661 | {@required BuildContext context, 662 | @required Duration initialTime, 663 | double snapToMins}) async { 664 | assert(context != null); 665 | assert(initialTime != null); 666 | 667 | return await showDialog( 668 | context: context, 669 | builder: (BuildContext context) => 670 | new _DurationPickerDialog(initialTime: initialTime, snapToMins: snapToMins), 671 | ); 672 | } 673 | 674 | class DurationPicker extends StatelessWidget { 675 | final Duration duration; 676 | final ValueChanged onChange; 677 | final double snapToMins; 678 | 679 | final double width; 680 | final double height; 681 | 682 | DurationPicker( 683 | {this.duration = const Duration(minutes: 0), 684 | @required this.onChange, 685 | this.snapToMins, 686 | this.width, 687 | this.height}); 688 | 689 | @override 690 | Widget build(BuildContext context) { 691 | return SizedBox( 692 | width: width ?? _kDurationPickerWidthPortrait / 1.5, 693 | height: height ?? _kDurationPickerHeightPortrait / 1.5, 694 | child: Column( 695 | mainAxisSize: MainAxisSize.min, 696 | crossAxisAlignment: CrossAxisAlignment.stretch, 697 | children: [ 698 | Expanded( 699 | child: _Dial( 700 | duration: duration, 701 | onChanged: onChange, 702 | snapToMins: snapToMins, 703 | ), 704 | ), 705 | ])); 706 | } 707 | } 708 | -------------------------------------------------------------------------------- /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.5" 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 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | front_end: 78 | dependency: transitive 79 | description: 80 | name: front_end 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.1.0-alpha.12" 84 | glob: 85 | dependency: transitive 86 | description: 87 | name: glob 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.1.5" 91 | html: 92 | dependency: transitive 93 | description: 94 | name: html 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.13.3+1" 98 | http: 99 | dependency: transitive 100 | description: 101 | name: http 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.11.3+16" 105 | http_multi_server: 106 | dependency: transitive 107 | description: 108 | name: http_multi_server 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "2.0.5" 112 | http_parser: 113 | dependency: transitive 114 | description: 115 | name: http_parser 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "3.1.2" 119 | io: 120 | dependency: transitive 121 | description: 122 | name: io 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "0.3.2+1" 126 | js: 127 | dependency: transitive 128 | description: 129 | name: js 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.6.1" 133 | json_rpc_2: 134 | dependency: transitive 135 | description: 136 | name: json_rpc_2 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.0.8" 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" 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+1" 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.2" 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.3" 203 | path: 204 | dependency: transitive 205 | description: 206 | name: path 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.6.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.5" 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+1" 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+1" 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+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.7+1" 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.41" 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 | vm_service_client: 349 | dependency: transitive 350 | description: 351 | name: vm_service_client 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "0.2.4+3" 355 | watcher: 356 | dependency: transitive 357 | description: 358 | name: watcher 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "0.9.7+8" 362 | web_socket_channel: 363 | dependency: transitive 364 | description: 365 | name: web_socket_channel 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "1.0.8" 369 | yaml: 370 | dependency: transitive 371 | description: 372 | name: yaml 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "2.1.14" 376 | sdks: 377 | dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.62.0.flutter-4b2d60cb18" 378 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_duration_picker 2 | description: A widget for picking durations, inspired by Material Time Picker. 3 | version: 1.0.4 4 | author: Chris Harris 5 | homepage: https://github.com/cdharris/flutter_duration_picker 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | 11 | dev_dependencies: 12 | flutter_test: 13 | sdk: flutter 14 | 15 | 16 | environment: 17 | sdk: ">=1.19.0 <3.0.0" 18 | flutter: ">=0.1.4 <2.0.0" 19 | -------------------------------------------------------------------------------- /test/flutter_duration_picker_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | --------------------------------------------------------------------------------