├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ └── com │ │ │ └── lanars │ │ │ └── flutter │ │ │ └── directselectflutter │ │ │ └── MainActivity.kt │ │ └── res │ │ ├── drawable │ │ └── launch_background.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── 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 │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── direct-select-android.gif ├── direct-select-ios.gif ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ └── 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.yaml └── test │ └── widget_test.dart ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── direct_select_container.dart ├── direct_select_item.dart └── direct_select_list.dart ├── pubspec.yaml └── res └── values └── strings_en.arb /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | project.pbxproj 73 | example/android/app/.settings/org.eclipse.buildship.core.prefs 74 | example/android/app/.project 75 | example/android/app/.classpath 76 | example/android/.settings/org.eclipse.buildship.core.prefs 77 | example/android/.project 78 | android/.settings/org.eclipse.buildship.core.prefs 79 | android/.project 80 | -------------------------------------------------------------------------------- /.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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.1.1] - 2021.05.14 2 | 3 | * Fix [#25](https://github.com/LanarsInc/direct-select-flutter/issues/25) 4 | 5 | ## [1.1.0] - 2021.03.10 6 | 7 | * Migrate to null safety 8 | 9 | ## [1.0.7] - 2020.12.02 10 | 11 | * Remove redundant dependencies 12 | * Update dart docs 13 | 14 | ## [1.0.6] - 2020.05.05 15 | 16 | * Fix update of selected item 17 | 18 | ## [1.0.5+1] - 2020.04.27 19 | 20 | * Update dependencies to latest version 21 | * Fix spelling 22 | * Get rid of deprecated method call 'inheritFromWidgetOfExactType' 23 | 24 | ## [1.0.5] - 2019.10.18 25 | 26 | * Throw exception if dsl not extends dsl listener 27 | * Add listener to notify that user must hold instead of just tap 28 | * Add optional decoration param to DSL Container 29 | 30 | ## [1.0.4] - 2019.07.08 31 | 32 | * Choice screen color can be set up using theme 33 | 34 | ## [1.0.3] - 2019.05.31 35 | 36 | * Improve code formatting, fixed immutable issues. 37 | * Improve documentation 38 | 39 | ## [1.0.2] - 2019.03.20 40 | 41 | * Horizontal scroll problem fix 42 | * Scale down small overlay problem resolved 43 | 44 | ## [1.0.0] - 2019.03.13 45 | 46 | * Initial Open Source release. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2019, LanarsInc 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # direct-select-flutter 2 | DirectSelect is a selection widget with an ethereal, full-screen modal popup displaying the available choices when the widget is interact with. 3 | Inspired by [dribble shot](https://dribbble.com/shots/3876250-DirectSelect-Dropdown-ux). 4 | 5 | Made in [lanars.com](https://lanars.com). 6 | 7 | [![pub package](https://img.shields.io/pub/v/direct_select_flutter.svg)](https://pub.dev/packages/direct_select_flutter) 8 | 9 | Awesome Flutter 10 | 11 | 12 | # iOS 13 | 14 | 15 | 16 | # Android 17 | 18 | 19 | 20 | # Usage 21 | 22 | Create DirectSelectList and fill it with items using itemBuilder 23 | ```dart 24 | final dsl = DirectSelectList( 25 | values: _cities, 26 | defaultItemIndex: 3, 27 | itemBuilder: (String value) => getDropDownMenuItem(value), 28 | focusedItemDecoration: _getDslDecoration(), 29 | onItemSelectedListener: (item, index, context) { 30 | Scaffold.of(context).showSnackBar(SnackBar(content: Text(item))); 31 | }); 32 | ``` 33 | Create items like this 34 | ```dart 35 | DirectSelectItem getDropDownMenuItem(String value) { 36 | return DirectSelectItem( 37 | itemHeight: 56, 38 | value: value, 39 | itemBuilder: (context, value) { 40 | return Text(value); 41 | }); 42 | } 43 | ``` 44 | Create decorations for focused items 45 | ```dart 46 | _getDslDecoration() { 47 | return BoxDecoration( 48 | border: BorderDirectional( 49 | bottom: BorderSide(width: 1, color: Colors.black12), 50 | top: BorderSide(width: 1, color: Colors.black12), 51 | ), 52 | ); 53 | } 54 | ``` 55 | Create DirectSelectContainer and fill it with your data 56 | ```dart 57 | Scaffold( 58 | appBar: appBar, 59 | body: DirectSelectContainer( 60 | child: Padding( 61 | padding: const EdgeInsets.all(16.0), 62 | child: Column( 63 | mainAxisSize: MainAxisSize.min, 64 | verticalDirection: VerticalDirection.down, 65 | children: [ 66 | SizedBox(height: 150.0), 67 | Padding( 68 | padding: const EdgeInsets.all(8.0), 69 | child: Column( 70 | children: [ 71 | Container( 72 | alignment: AlignmentDirectional.centerStart, 73 | margin: EdgeInsets.only(left: 4), 74 | child: Text("City"), 75 | ), 76 | Padding( 77 | padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), 78 | child: Card( 79 | child: Row( 80 | mainAxisSize: MainAxisSize.max, 81 | children: [ 82 | Expanded( 83 | child: Padding( 84 | child: DirectSelectList( 85 | values: _cities, 86 | defaultItemIndex: 3, 87 | itemBuilder: (String value) => getDropDownMenuItem(value), 88 | focusedItemDecoration: _getDslDecoration(), 89 | onItemSelectedListener: (item, index, context) { 90 | Scaffold.of(context).showSnackBar(SnackBar(content: Text(item))); 91 | }), 92 | padding: EdgeInsets.only(left: 12))), 93 | Padding( 94 | padding: EdgeInsets.only(right: 8), 95 | child: Icon( 96 | Icons.unfold_more, 97 | color: Colors.black38, 98 | ), 99 | ) 100 | ], 101 | ), 102 | ), 103 | ), 104 | ], 105 | ), 106 | ), 107 | ], 108 | ), 109 | ), 110 | ), 111 | ); 112 | ``` 113 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 27 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.lanars.flutter.directselectflutter" 42 | minSdkVersion 16 43 | targetSdkVersion 27 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/lanars/flutter/directselectflutter/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.lanars.flutter.directselectflutter 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /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/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | *generated/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | -------------------------------------------------------------------------------- /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: 4feefa3c9a2176ca7383246c4c01b36254fbec85 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | Demonstrates how to use the flutter_direct_select. 4 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.example" 37 | minSdkVersion 16 38 | targetSdkVersion 28 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/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/direct-select-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/example/direct-select-android.gif -------------------------------------------------------------------------------- /example/direct-select-ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/example/direct-select-ios.gif -------------------------------------------------------------------------------- /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 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 0910; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | ENABLE_BITCODE = NO; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | LIBRARY_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Debug; 456 | }; 457 | 97C147071CF9000F007C117D /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/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.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/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:direct_select_flutter/direct_select_container.dart'; 2 | import 'package:direct_select_flutter/direct_select_item.dart'; 3 | import 'package:direct_select_flutter/direct_select_list.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | void main() => runApp(MyApp()); 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | title: 'Flutter Demo', 13 | theme: ThemeData( 14 | primarySwatch: Colors.blue, 15 | ), 16 | home: MyHomePage(title: 'Flutter Demo Home Page'), 17 | ); 18 | } 19 | } 20 | 21 | class MyHomePage extends StatefulWidget { 22 | MyHomePage({Key? key, required this.title}) : super(key: key); 23 | 24 | final String title; 25 | 26 | @override 27 | _MyHomePageState createState() => _MyHomePageState(); 28 | } 29 | 30 | List _meals = [ 31 | "Breakfast1", 32 | "Breakfast2", 33 | "Lunch1", 34 | "Lunch2", 35 | "Dinner1", 36 | "Dinner2", 37 | ]; 38 | 39 | class _MyHomePageState extends State { 40 | List _food = ["Chicken", "Pork", "Vegetables", "Cheese", "Bread"]; 41 | 42 | List _foodVariants = [ 43 | "Chicken grilled", 44 | "Pork grilled", 45 | "Vegetables as is", 46 | "Cheese as is", 47 | "Bread tasty" 48 | ]; 49 | 50 | List _portionSize = [ 51 | "Small portion", 52 | "Medium portion", 53 | "Large portion", 54 | "Huge portion" 55 | ]; 56 | 57 | List _numbers = ["1.0", "2.0", "3.0", "4.0", "5.0", "6.0", "7.0"]; 58 | 59 | int selectedFoodVariants = 0; 60 | int selectedPortionCounts = 0; 61 | int selectedPortionSize = 0; 62 | 63 | DirectSelectItem getDropDownMenuItem(String value) { 64 | return DirectSelectItem( 65 | itemHeight: 56, 66 | value: value, 67 | itemBuilder: (context, value) { 68 | return Text(value); 69 | }); 70 | } 71 | 72 | _getDslDecoration() { 73 | return BoxDecoration( 74 | border: BorderDirectional( 75 | bottom: BorderSide(width: 1, color: Colors.black12), 76 | top: BorderSide(width: 1, color: Colors.black12), 77 | ), 78 | ); 79 | } 80 | 81 | final GlobalKey scaffoldKey = GlobalKey(); 82 | 83 | @override 84 | Widget build(BuildContext context) { 85 | final appBar = PreferredSize( 86 | child: Container( 87 | decoration: BoxDecoration( 88 | color: Color.fromRGBO(246, 247, 249, 1), 89 | border: BorderDirectional( 90 | bottom: BorderSide(width: 1, color: Colors.black12))), 91 | child: Padding( 92 | padding: EdgeInsets.only(left: 16, bottom: 24), 93 | child: Column( 94 | verticalDirection: VerticalDirection.up, 95 | children: [ 96 | Container( 97 | alignment: AlignmentDirectional.centerStart, 98 | child: Text("Add Food", 99 | style: TextStyle( 100 | fontSize: 26, 101 | color: Colors.black, 102 | fontWeight: FontWeight.bold))), 103 | Container( 104 | alignment: AlignmentDirectional.centerStart, 105 | child: Text("Journal", 106 | style: TextStyle( 107 | fontSize: 12, 108 | color: Colors.black38, 109 | fontWeight: FontWeight.bold))) 110 | ])), 111 | ), 112 | preferredSize: Size.fromHeight(90)); 113 | 114 | return Scaffold( 115 | appBar: appBar, 116 | key: scaffoldKey, 117 | body: DirectSelectContainer( 118 | child: SingleChildScrollView( 119 | child: Padding( 120 | padding: const EdgeInsets.all(16.0), 121 | child: Column( 122 | mainAxisSize: MainAxisSize.min, 123 | verticalDirection: VerticalDirection.down, 124 | children: [ 125 | SizedBox(height: 20.0), 126 | Container( 127 | padding: const EdgeInsets.only(left: 8.0), 128 | alignment: AlignmentDirectional.centerStart, 129 | margin: EdgeInsets.only(left: 4), 130 | child: Column( 131 | children: [ 132 | Text(_foodVariants[selectedFoodVariants], 133 | style: TextStyle( 134 | fontSize: 26, fontWeight: FontWeight.bold)) 135 | ], 136 | )), 137 | Container( 138 | padding: const EdgeInsets.only(left: 8.0), 139 | alignment: AlignmentDirectional.centerStart, 140 | margin: EdgeInsets.only(left: 4), 141 | child: Column( 142 | children: [ 143 | Text(_numbers[selectedPortionCounts] + 144 | " " + 145 | _portionSize[selectedPortionSize]) 146 | ], 147 | )), 148 | SizedBox(height: 5.0), 149 | _getFoodContainsRow(), 150 | SizedBox(height: 20.0), 151 | Padding( 152 | padding: const EdgeInsets.all(8.0), 153 | child: Column( 154 | children: [ 155 | MealSelector(data: _meals, label: "To which meal?"), 156 | SizedBox(height: 20.0), 157 | MealSelector( 158 | data: _food, label: "Search our database by name"), 159 | Padding( 160 | padding: EdgeInsets.fromLTRB(0, 8, 0, 0), 161 | child: Container( 162 | decoration: _getShadowDecoration(), 163 | child: Card( 164 | child: Row( 165 | mainAxisSize: MainAxisSize.max, 166 | children: [ 167 | Expanded( 168 | child: Padding( 169 | child: DirectSelectList( 170 | values: _foodVariants, 171 | onUserTappedListener: () { 172 | _showScaffold(); 173 | }, 174 | defaultItemIndex: 175 | selectedFoodVariants, 176 | itemBuilder: (String value) => 177 | getDropDownMenuItem(value), 178 | focusedItemDecoration: 179 | _getDslDecoration(), 180 | onItemSelectedListener: 181 | (item, index, context) { 182 | setState(() { 183 | selectedFoodVariants = index; 184 | }); 185 | }), 186 | padding: EdgeInsets.only(left: 22))), 187 | Padding( 188 | padding: EdgeInsets.only(right: 8), 189 | child: _getDropdownIcon(), 190 | ) 191 | ], 192 | )), 193 | ), 194 | ), 195 | SizedBox(height: 15.0), 196 | Container( 197 | padding: const EdgeInsets.fromLTRB(0, 16, 0, 0), 198 | margin: EdgeInsets.only(left: 4), 199 | alignment: AlignmentDirectional.centerStart, 200 | child: Text("How Much?")), 201 | Row(children: [ 202 | Expanded( 203 | flex: 2, 204 | child: Container( 205 | decoration: _getShadowDecoration(), 206 | child: Card( 207 | child: Row( 208 | crossAxisAlignment: CrossAxisAlignment.center, 209 | mainAxisSize: MainAxisSize.max, 210 | children: [ 211 | Expanded( 212 | child: Padding( 213 | child: DirectSelectList( 214 | onUserTappedListener: () { 215 | _showScaffold(); 216 | }, 217 | values: _numbers, 218 | defaultItemIndex: 219 | selectedPortionCounts, 220 | itemBuilder: (String value) => 221 | getDropDownMenuItem(value), 222 | focusedItemDecoration: 223 | _getDslDecoration(), 224 | onItemSelectedListener: 225 | (item, index, context) { 226 | setState(() { 227 | selectedPortionCounts = index; 228 | }); 229 | }), 230 | padding: EdgeInsets.only(left: 22))), 231 | ], 232 | )), 233 | )), 234 | Expanded( 235 | flex: 8, 236 | child: Container( 237 | decoration: _getShadowDecoration(), 238 | child: Card( 239 | child: Row( 240 | mainAxisSize: MainAxisSize.max, 241 | children: [ 242 | Expanded( 243 | child: Padding( 244 | child: DirectSelectList( 245 | values: _portionSize, 246 | defaultItemIndex: 247 | selectedPortionSize, 248 | itemBuilder: (String value) => 249 | getDropDownMenuItem(value), 250 | focusedItemDecoration: 251 | _getDslDecoration(), 252 | onItemSelectedListener: 253 | (item, index, context) { 254 | setState(() { 255 | selectedPortionSize = index; 256 | }); 257 | }), 258 | padding: EdgeInsets.only(left: 22))), 259 | Padding( 260 | padding: EdgeInsets.only(right: 8), 261 | child: _getDropdownIcon(), 262 | ) 263 | ], 264 | )), 265 | )), 266 | ]), 267 | Row(children: [ 268 | Expanded( 269 | child: RaisedButton( 270 | child: const Text('ADD TO JOURNAL', 271 | style: TextStyle(color: Colors.blueAccent)), 272 | onPressed: () {}, 273 | )) 274 | ]), 275 | ], 276 | ), 277 | ), 278 | ], 279 | ), 280 | ), 281 | ), 282 | ), 283 | ); 284 | } 285 | 286 | void _showScaffold() { 287 | final snackBar = SnackBar(content: Text('Hold and drag instead of tap')); 288 | scaffoldKey.currentState?.showSnackBar(snackBar); 289 | } 290 | 291 | Icon _getDropdownIcon() { 292 | return Icon( 293 | Icons.unfold_more, 294 | color: Colors.blueAccent, 295 | ); 296 | } 297 | 298 | BoxDecoration _getShadowDecoration() { 299 | return BoxDecoration( 300 | boxShadow: [ 301 | new BoxShadow( 302 | color: Colors.black.withOpacity(0.06), 303 | spreadRadius: 4, 304 | offset: new Offset(0.0, 0.0), 305 | blurRadius: 15.0, 306 | ), 307 | ], 308 | ); 309 | } 310 | } 311 | 312 | class MealSelector extends StatelessWidget { 313 | final buttonPadding = const EdgeInsets.fromLTRB(0, 8, 0, 0); 314 | 315 | final List data; 316 | final String label; 317 | 318 | MealSelector({required this.data, required this.label}); 319 | 320 | @override 321 | Widget build(BuildContext context) { 322 | return Column( 323 | children: [ 324 | Container( 325 | alignment: AlignmentDirectional.centerStart, 326 | margin: EdgeInsets.only(left: 4), 327 | child: Text(label)), 328 | Padding( 329 | padding: buttonPadding, 330 | child: Container( 331 | decoration: _getShadowDecoration(), 332 | child: Card( 333 | child: Row( 334 | mainAxisSize: MainAxisSize.max, 335 | children: [ 336 | Expanded( 337 | child: Padding( 338 | child: DirectSelectList( 339 | values: data, 340 | defaultItemIndex: 0, 341 | itemBuilder: (String value) => 342 | getDropDownMenuItem(value), 343 | focusedItemDecoration: _getDslDecoration(), 344 | ), 345 | padding: EdgeInsets.only(left: 12))), 346 | Padding( 347 | padding: EdgeInsets.only(right: 8), 348 | child: _getDropdownIcon(), 349 | ) 350 | ], 351 | )), 352 | ), 353 | ), 354 | ], 355 | ); 356 | } 357 | 358 | DirectSelectItem getDropDownMenuItem(String value) { 359 | return DirectSelectItem( 360 | itemHeight: 56, 361 | value: value, 362 | itemBuilder: (context, value) { 363 | return Text(value); 364 | }); 365 | } 366 | 367 | _getDslDecoration() { 368 | return BoxDecoration( 369 | border: BorderDirectional( 370 | bottom: BorderSide(width: 1, color: Colors.black12), 371 | top: BorderSide(width: 1, color: Colors.black12), 372 | ), 373 | ); 374 | } 375 | 376 | BoxDecoration _getShadowDecoration() { 377 | return BoxDecoration( 378 | boxShadow: [ 379 | new BoxShadow( 380 | color: Colors.black.withOpacity(0.06), 381 | spreadRadius: 4, 382 | offset: new Offset(0.0, 0.0), 383 | blurRadius: 15.0, 384 | ), 385 | ], 386 | ); 387 | } 388 | 389 | Icon _getDropdownIcon() { 390 | return Icon( 391 | Icons.unfold_more, 392 | color: Colors.blueAccent, 393 | ); 394 | } 395 | } 396 | 397 | Widget _getFoodContainsRow() { 398 | final cardSize = 80.0; 399 | final cardColor = Colors.blueGrey[100]; 400 | return Padding( 401 | padding: EdgeInsets.only(left: 8, right: 8), 402 | child: Row( 403 | children: [ 404 | Expanded( 405 | child: Container( 406 | child: Center(child: Text("226")), 407 | height: cardSize, 408 | margin: EdgeInsets.only(right: 3), 409 | decoration: BoxDecoration( 410 | color: cardColor, 411 | borderRadius: BorderRadius.only( 412 | topLeft: const Radius.circular(10.0), 413 | bottomLeft: const Radius.circular(10.0)))), 414 | ), 415 | Expanded( 416 | child: Container( 417 | child: Center(child: Text("41")), 418 | height: cardSize, 419 | margin: EdgeInsets.only(right: 3), 420 | decoration: BoxDecoration(color: cardColor)), 421 | ), 422 | Expanded( 423 | child: Container( 424 | child: Center(child: Text("0")), 425 | height: cardSize, 426 | margin: EdgeInsets.only(right: 3), 427 | decoration: BoxDecoration(color: cardColor)), 428 | ), 429 | Expanded( 430 | child: Container( 431 | child: Center(child: Text("4.5")), 432 | height: cardSize, 433 | decoration: BoxDecoration( 434 | color: cardColor, 435 | borderRadius: BorderRadius.only( 436 | topRight: const Radius.circular(10.0), 437 | bottomRight: const Radius.circular(10.0)))), 438 | ), 439 | ], 440 | ), 441 | ); 442 | } 443 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | direct_select_flutter: 13 | path: ../ 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | flutter: 20 | uses-material-design: true 21 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | void main() { 11 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 12 | //todo 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | flutter_direct_select 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 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/direct_select_container.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:direct_select_flutter/direct_select_list.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/rendering.dart'; 6 | import 'package:flutter/widgets.dart'; 7 | import 'package:rect_getter/rect_getter.dart'; 8 | 9 | /// Root widget for direct select. 10 | /// This widget displays lists of direct selects. 11 | /// Usage Example 12 | /// 13 | /// return Scaffold( 14 | /// body: DirectSelectContainer( 15 | /// child: Padding( 16 | /// padding: const EdgeInsets.all(16.0), 17 | /// child: Column( 18 | /// mainAxisSize: MainAxisSize.min, 19 | /// verticalDirection: VerticalDirection.down, 20 | /// children: [ 21 | /// SizedBox(height: 150.0), 22 | /// Padding( 23 | /// padding: const EdgeInsets.all(8.0), 24 | /// child: Column( 25 | /// children: [ 26 | /// Container( 27 | /// alignment: AlignmentDirectional.centerStart, 28 | /// margin: EdgeInsets.only(left: 4), 29 | /// child: Text("City")), 30 | /// Padding( 31 | /// padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), 32 | /// child: Card( 33 | /// child: Row( 34 | /// mainAxisSize: MainAxisSize.max, 35 | /// children: [ 36 | /// Expanded( 37 | /// child: Padding( 38 | /// child: DirectSelectList( 39 | /// values: _cities, 40 | /// defaultItemIndex: 3, 41 | /// itemBuilder: (String value) => getDropDownMenuItem(value), 42 | /// focusedItemDecoration: _getDslDecoration(), 43 | /// onItemSelectedListener: (item, context) { 44 | /// Scaffold.of(context).showSnackBar(SnackBar(content: Text(item))); 45 | /// }), 46 | /// padding: EdgeInsets.only(left: 12))), 47 | /// Padding( 48 | /// padding: EdgeInsets.only(right: 8), 49 | /// child: Icon( 50 | /// Icons.unfold_more, 51 | /// color: Colors.black38, 52 | /// ), 53 | /// ) 54 | /// ], 55 | /// )), 56 | /// ), 57 | /// ], 58 | /// ), 59 | /// ), 60 | /// ], 61 | /// ), 62 | /// ), 63 | /// ), 64 | /// ); 65 | /// 66 | class DirectSelectContainer extends StatefulWidget { 67 | ///Actually content of screen 68 | final Widget child; 69 | 70 | ///How fast list is scrolled 71 | final int dragSpeedMultiplier; 72 | 73 | ///Decoration for the DSL container 74 | final Decoration? decoration; 75 | 76 | const DirectSelectContainer({ 77 | Key? key, 78 | required this.child, 79 | this.dragSpeedMultiplier = 2, 80 | this.decoration, 81 | }) : super(key: key); 82 | 83 | @override 84 | State createState() { 85 | return DirectSelectContainerState(); 86 | } 87 | 88 | static DirectSelectGestureEventListeners of(BuildContext context) { 89 | if (context.dependOnInheritedWidgetOfExactType< 90 | _InheritedContainerListeners>() == 91 | null) { 92 | throw Exception( 93 | "A DirectSelectList must inherit a DirectSelectContainer!"); 94 | } 95 | return context 96 | .dependOnInheritedWidgetOfExactType<_InheritedContainerListeners>()! 97 | .listeners; 98 | } 99 | } 100 | 101 | class DirectSelectContainerState extends State 102 | with SingleTickerProviderStateMixin 103 | implements DirectSelectGestureEventListeners { 104 | bool isOverlayVisible = false; 105 | 106 | late ScrollController _scrollController; 107 | DirectSelectList _currentList = 108 | DirectSelectList(itemBuilder: (val) => null, values: []); 109 | double _currentScrollLocation = 0; 110 | 111 | double _adjustedTopOffset = 0.0; 112 | 113 | late AnimationController fadeAnimationController; 114 | 115 | int lastSelectedItem = 0; 116 | 117 | double listPadding = 0.0; 118 | 119 | final scrollToListElementAnimationDuration = Duration(milliseconds: 200); 120 | final fadeAnimationDuration = Duration(milliseconds: 200); 121 | 122 | @override 123 | void initState() { 124 | super.initState(); 125 | 126 | fadeAnimationController = AnimationController( 127 | duration: fadeAnimationDuration, 128 | vsync: this, 129 | ); 130 | } 131 | 132 | @override 133 | Widget build(BuildContext context) { 134 | double topOffset = 0.0; 135 | RenderObject? object = context.findRenderObject(); 136 | if (object?.parentData is ContainerBoxParentData) { 137 | topOffset = (object!.parentData as ContainerBoxParentData).offset.dy; 138 | } 139 | 140 | listPadding = MediaQuery.of(context).size.height; 141 | 142 | _adjustedTopOffset = _currentScrollLocation - topOffset; 143 | _scrollController = ScrollController( 144 | initialScrollOffset: listPadding - 145 | _currentScrollLocation + 146 | topOffset + 147 | _currentList.getSelectedItemIndex() * _currentList.itemHeight()); 148 | 149 | return Stack( 150 | children: [ 151 | _InheritedContainerListeners( 152 | listeners: this, 153 | child: widget.child, 154 | ), 155 | Visibility( 156 | visible: isOverlayVisible, 157 | child: FadeTransition( 158 | opacity: fadeAnimationController 159 | .drive(CurveTween(curve: Curves.easeOut)), 160 | child: Column( 161 | children: [ 162 | Expanded( 163 | child: Stack( 164 | children: [ 165 | _getListWidget(), 166 | _getSelectionOverlayWidget(), 167 | ], 168 | ), 169 | ), 170 | ], 171 | ), 172 | ), 173 | ) 174 | ], 175 | ); 176 | } 177 | 178 | Widget _getListWidget() { 179 | var paddingLeft = 0.0; 180 | 181 | if (_currentList.items.isNotEmpty) { 182 | Rect? rect = RectGetter.getRectFromKey( 183 | _currentList.paddingItemController.paddingGlobalKey); 184 | if (rect != null) { 185 | paddingLeft = rect.left; 186 | } 187 | } 188 | 189 | final Decoration dslContainerDecoration = widget.decoration ?? 190 | BoxDecoration(color: Theme.of(context).scaffoldBackgroundColor); 191 | 192 | return Container( 193 | decoration: dslContainerDecoration, 194 | child: ListView.builder( 195 | padding: EdgeInsets.only(left: paddingLeft), 196 | controller: _scrollController, 197 | itemCount: _currentList.items.length + 2, 198 | itemBuilder: (BuildContext context, int index) { 199 | if (index == 0 || index == _currentList.items.length + 1) { 200 | return Container(height: listPadding); 201 | } 202 | final item = _currentList.items[index - 1]; 203 | final normalScale = 1.0; 204 | if (lastSelectedItem == index - 1) { 205 | item.updateScale(_calculateNewScale(normalScale)); 206 | } else { 207 | item.updateScale(normalScale); 208 | } 209 | return item; 210 | }, 211 | )); 212 | } 213 | 214 | Widget _getSelectionOverlayWidget() { 215 | return Positioned( 216 | top: _adjustedTopOffset, 217 | left: 0, 218 | right: 0, 219 | height: _currentList.itemHeight(), 220 | child: Container( 221 | height: _currentList.itemHeight(), 222 | decoration: _currentList.focusedItemDecoration != null 223 | ? _currentList.focusedItemDecoration 224 | : BoxDecoration())); 225 | } 226 | 227 | void performListDrag(double dragDy) { 228 | try { 229 | if (_scrollController.hasClients) { 230 | final currentScrollOffset = _scrollController.offset; 231 | double allowedOffset = _allowedDragDistance( 232 | currentScrollOffset + _adjustedTopOffset, 233 | dragDy * widget.dragSpeedMultiplier); 234 | if (allowedOffset != 0.0) { 235 | _scrollController.jumpTo(currentScrollOffset + allowedOffset); 236 | 237 | final scrollPixels = 238 | _scrollController.offset - listPadding + _adjustedTopOffset; 239 | final selectedItemIndex = _getCurrentListElementIndex(scrollPixels); 240 | lastSelectedItem = selectedItemIndex; 241 | 242 | _performScaleTransformation(scrollPixels, selectedItemIndex); 243 | } 244 | } 245 | } catch (e) { 246 | print(e); 247 | } 248 | } 249 | 250 | double _allowedDragDistance(double currentScrollOffset, double position) { 251 | double newPosition = currentScrollOffset + position; 252 | double endOfListPosition = 253 | (_currentList.items.length - 1) * _currentList.itemHeight() + 254 | listPadding; 255 | if (newPosition < listPadding) { 256 | return listPadding - currentScrollOffset; 257 | } else if (newPosition > endOfListPosition) { 258 | return endOfListPosition - currentScrollOffset; 259 | } else { 260 | return position; 261 | } 262 | } 263 | 264 | void _performScaleTransformation(double scrollPixels, int selectedItemIndex) { 265 | final neighbourDistance = _getNeighbourListElementDistance(scrollPixels); 266 | int neighbourIncrementDirection = 267 | neighbourScrollDirection(neighbourDistance); 268 | 269 | int neighbourIndex = lastSelectedItem + neighbourIncrementDirection; 270 | 271 | double neighbourDistanceToCurrentItem = 272 | _getNeighbourListElementDistanceToCurrentItem(neighbourDistance); 273 | 274 | if (neighbourIndex < 0 || neighbourIndex > _currentList.items.length - 1) { 275 | //incorrect neighbour index quit 276 | return; 277 | } 278 | _currentList.items[selectedItemIndex].updateOpacity(1.0); 279 | _currentList.items[neighbourIndex].updateOpacity(0.5); 280 | 281 | _currentList.items[selectedItemIndex] 282 | .updateScale(_calculateNewScale(neighbourDistanceToCurrentItem)); 283 | _currentList.items[neighbourIndex] 284 | .updateScale(_calculateNewScale(neighbourDistance.abs())); 285 | } 286 | 287 | double _calculateNewScale(double distance) => 288 | 1.0 + distance / _currentList.items[lastSelectedItem].scaleFactor; 289 | 290 | int neighbourScrollDirection(double neighbourDistance) { 291 | int neighbourScrollDirection = 0; 292 | if (neighbourDistance > 0) { 293 | neighbourScrollDirection = 1; 294 | } else { 295 | neighbourScrollDirection = -1; 296 | } 297 | return neighbourScrollDirection; 298 | } 299 | 300 | double _getNeighbourListElementDistanceToCurrentItem( 301 | double neighbourDistance) { 302 | double neighbourDistanceToCurrentItem = (1 - neighbourDistance.abs()); 303 | 304 | if (neighbourDistanceToCurrentItem > 1 || 305 | neighbourDistanceToCurrentItem < 0) { 306 | neighbourDistanceToCurrentItem = 1.0; 307 | } 308 | return neighbourDistanceToCurrentItem; 309 | } 310 | 311 | int _getCurrentListElementIndex(double scrollPixels) { 312 | int selectedElement = (scrollPixels / _currentList.itemHeight()).round(); 313 | final maxElementIndex = _currentList.items.length; 314 | 315 | if (selectedElement < 0) { 316 | selectedElement = 0; 317 | } 318 | if (selectedElement >= maxElementIndex) { 319 | selectedElement = maxElementIndex - 1; 320 | } 321 | return selectedElement; 322 | } 323 | 324 | double _getNeighbourListElementDistance(double scrollPixels) { 325 | double selectedElementDeviation = 326 | (scrollPixels / _currentList.itemHeight()); 327 | int selectedElement = _getCurrentListElementIndex(scrollPixels); 328 | return selectedElementDeviation - selectedElement; 329 | } 330 | 331 | Future toggleListOverlayVisibility( 332 | DirectSelectList visibleList, double location) async { 333 | if (isOverlayVisible) { 334 | try { 335 | await _scrollController.animateTo( 336 | listPadding - 337 | _adjustedTopOffset + 338 | lastSelectedItem * _currentList.itemHeight(), 339 | duration: scrollToListElementAnimationDuration, 340 | curve: Curves.ease, 341 | ); 342 | } catch (e) {} finally { 343 | _currentList.setSelectedItemIndex(lastSelectedItem); 344 | await Future.delayed(Duration(milliseconds: 200)); 345 | await fadeAnimationController.reverse(); 346 | setState(() { 347 | _hideListOverlay(); 348 | }); 349 | } 350 | } else { 351 | setState(() { 352 | _showListOverlay(visibleList, location); 353 | }); 354 | } 355 | } 356 | 357 | _showListOverlay(DirectSelectList visibleList, double location) async { 358 | _currentList = visibleList; 359 | _currentScrollLocation = location; 360 | lastSelectedItem = _currentList.getSelectedItemIndex(); 361 | _currentList.items[lastSelectedItem].updateOpacity(1.0); 362 | isOverlayVisible = true; 363 | await fadeAnimationController.forward(from: 0.0); 364 | } 365 | 366 | void _hideListOverlay() { 367 | _scrollController.dispose(); 368 | _currentList.items[lastSelectedItem].updateScale(1.0); 369 | _currentScrollLocation = 0; 370 | _adjustedTopOffset = 0; 371 | isOverlayVisible = false; 372 | } 373 | } 374 | 375 | class DirectSelectGestureEventListeners { 376 | toggleListOverlayVisibility(DirectSelectList list, double location) => 377 | throw 'Not implemented.'; 378 | 379 | performListDrag(double dragDy) => throw 'Not implemented'; 380 | } 381 | 382 | /// Allows Direct Select List implementations to 383 | class _InheritedContainerListeners extends InheritedWidget { 384 | final DirectSelectGestureEventListeners listeners; 385 | 386 | _InheritedContainerListeners({ 387 | Key? key, 388 | required this.listeners, 389 | required Widget child, 390 | }) : super(key: key, child: child); 391 | 392 | @override 393 | bool updateShouldNotify(_InheritedContainerListeners old) => 394 | old.listeners != listeners; 395 | } 396 | -------------------------------------------------------------------------------- /lib/direct_select_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:rect_getter/rect_getter.dart'; 5 | 6 | /// Widget that defines direct select list appearance 7 | /// Usage Example 8 | /// 9 | /// DirectSelectItem getDropDownMenuItem(String value) { 10 | /// return DirectSelectItem( 11 | /// itemHeight: 56, 12 | /// value: value, 13 | /// itemBuilder: (context, value) { 14 | /// return Text(value); 15 | /// }); 16 | /// } 17 | /// 18 | class DirectSelectItem extends StatefulWidget { 19 | ///Value of item 20 | final T value; 21 | 22 | ///Defines is this item is selected 23 | final isSelected; 24 | 25 | ///Height of items in list 26 | final double itemHeight; 27 | 28 | ///Initial item scale 29 | final scale = ValueNotifier(1.0); 30 | 31 | ///Opacity unselected item 32 | final opacity = ValueNotifier(0.5); 33 | 34 | ///the more value the MORE max scale DECREASES 35 | final scaleFactor; 36 | 37 | ///Item builder 38 | final Widget Function(BuildContext context, T value) itemBuilder; 39 | 40 | DirectSelectItem({ 41 | Key? key, 42 | this.scaleFactor = 4.0, 43 | required this.value, 44 | required this.itemBuilder, 45 | this.itemHeight = 48.0, 46 | this.isSelected = false, 47 | }) : super(key: key); 48 | 49 | @override 50 | State createState() { 51 | return DirectSelectItemState(isSelected: isSelected); 52 | } 53 | 54 | void updateScale(double scale) { 55 | this.scale.value = scale; 56 | } 57 | 58 | void updateOpacity(double opacity) { 59 | this.opacity.value = opacity; 60 | } 61 | 62 | Widget getSelectedItem(GlobalKey animatedStateKey, 63 | dynamic paddingGlobalKey) { 64 | return RectGetter( 65 | key: paddingGlobalKey, 66 | child: DirectSelectItem( 67 | value: value, 68 | key: animatedStateKey, 69 | itemHeight: itemHeight, 70 | itemBuilder: itemBuilder, 71 | isSelected: true, 72 | ), 73 | ); 74 | } 75 | } 76 | 77 | class DirectSelectItemState extends State> 78 | with SingleTickerProviderStateMixin { 79 | final bool isSelected; 80 | 81 | late AnimationController animationController; 82 | late Animation _animation; 83 | late Tween _tween; 84 | 85 | DirectSelectItemState({this.isSelected = false}); 86 | 87 | bool isScaled = false; 88 | 89 | Future runScaleTransition({required bool reverse}) { 90 | if (reverse) { 91 | return animationController.reverse(); 92 | } else { 93 | return animationController.forward(from: 0.0); 94 | } 95 | } 96 | 97 | @override 98 | void initState() { 99 | super.initState(); 100 | 101 | animationController = 102 | AnimationController(duration: Duration(milliseconds: 150), vsync: this); 103 | _tween = Tween(begin: 1.0, end: 1 + 1 / widget.scaleFactor); 104 | _animation = _tween.animate(animationController) 105 | ..addListener(() { 106 | setState(() {}); 107 | }); 108 | } 109 | 110 | @override 111 | Widget build(BuildContext context) { 112 | if (isSelected) { 113 | return Row( 114 | mainAxisSize: MainAxisSize.max, 115 | children: [ 116 | Expanded( 117 | child: Container( 118 | color: Colors.transparent, 119 | height: widget.itemHeight, 120 | alignment: AlignmentDirectional.centerStart, 121 | child: Transform.scale( 122 | scale: _animation.value, 123 | alignment: Alignment.topLeft, 124 | child: widget.itemBuilder(context, widget.value)), 125 | ), 126 | ), 127 | ], 128 | ); 129 | } else { 130 | return Material( 131 | color: Colors.transparent, 132 | child: Container( 133 | child: ValueListenableBuilder( 134 | valueListenable: widget.scale, 135 | builder: (context, value, child) { 136 | return Opacity( 137 | opacity: widget.opacity.value, 138 | child: Container( 139 | height: widget.itemHeight, 140 | child: Transform.scale( 141 | scale: value, 142 | alignment: Alignment.topLeft, 143 | child: widget.itemBuilder(context, widget.value)), 144 | alignment: AlignmentDirectional.centerStart), 145 | ); 146 | }, 147 | ), 148 | ), 149 | ); 150 | } 151 | } 152 | 153 | @override 154 | void dispose() { 155 | super.dispose(); 156 | animationController.dispose(); 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /lib/direct_select_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:direct_select_flutter/direct_select_container.dart'; 2 | import 'package:direct_select_flutter/direct_select_item.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:rect_getter/rect_getter.dart'; 6 | 7 | typedef DirectSelectItemsBuilder = DirectSelectItem? Function(T value); 8 | 9 | class PaddingItemController { 10 | var paddingGlobalKey = RectGetter.createGlobalKey(); 11 | } 12 | 13 | typedef ItemSelected = Future Function( 14 | DirectSelectList owner, double location); 15 | 16 | /// Widget that contains items and responds to user's interaction 17 | /// Usage Example 18 | /// 19 | /// final dsl2 = DirectSelectList( 20 | /// values: _numbers, 21 | /// itemBuilder: (String value) => getDropDownMenuItem(value), 22 | /// focusedItemDecoration: _getDslDecoration()); 23 | /// 24 | class DirectSelectList extends StatefulWidget { 25 | ///Item widgets 26 | final List> items; 27 | 28 | ///Current focused item overlay 29 | final Decoration? focusedItemDecoration; 30 | 31 | ///Default selected item index 32 | final int defaultItemIndex; 33 | 34 | ///Notifies state about new item selected 35 | final ValueNotifier selectedItem; 36 | 37 | ///Function to execute when item selected 38 | final Function(T value, int selectedIndex, BuildContext context)? 39 | onItemSelectedListener; 40 | 41 | ///Callback for action when user just tapped instead of hold and scroll 42 | final VoidCallback? onUserTappedListener; 43 | 44 | ///Holds [GlobalKey] for [RectGetter] 45 | final PaddingItemController paddingItemController = PaddingItemController(); 46 | 47 | DirectSelectList({ 48 | Key? key, 49 | required List values, 50 | required DirectSelectItemsBuilder itemBuilder, 51 | this.onItemSelectedListener, 52 | this.focusedItemDecoration, 53 | this.defaultItemIndex = 0, 54 | this.onUserTappedListener, 55 | }) : items = values.map((val) => itemBuilder(val)).toNotNullableList(), 56 | selectedItem = ValueNotifier(defaultItemIndex), 57 | assert(defaultItemIndex + 1 <= values.length + 1), 58 | super(key: key); 59 | 60 | @override 61 | State createState() { 62 | return DirectSelectState(); 63 | } 64 | 65 | //TODO pass item height in this class and build items with that height 66 | double itemHeight() { 67 | if (items.isNotEmpty) { 68 | return items.first.itemHeight; 69 | } 70 | return 0.0; 71 | } 72 | 73 | int getSelectedItemIndex() { 74 | return selectedItem.value; 75 | } 76 | 77 | void setSelectedItemIndex(int index) { 78 | if (index != selectedItem.value) { 79 | selectedItem.value = index; 80 | } 81 | } 82 | 83 | T getSelectedItem() { 84 | return items[selectedItem.value].value; 85 | } 86 | } 87 | 88 | class DirectSelectState extends State> { 89 | final GlobalKey animatedStateKey = 90 | GlobalKey(); 91 | 92 | late Future Function(DirectSelectList, double) onTapEventListener; 93 | late void Function(double) onDragEventListener; 94 | 95 | bool isOverlayVisible = false; 96 | int? lastSelectedItem; 97 | 98 | bool _isShowUpAnimationRunning = false; 99 | 100 | Map selectedItemWidgets = Map(); 101 | 102 | @override 103 | void initState() { 104 | super.initState(); 105 | lastSelectedItem = widget.defaultItemIndex; 106 | _updateSelectItemWidget(); 107 | } 108 | 109 | @override 110 | void didUpdateWidget(DirectSelectList oldWidget) { 111 | widget.paddingItemController.paddingGlobalKey = 112 | oldWidget.paddingItemController.paddingGlobalKey; 113 | _updateSelectItemWidget(); 114 | super.didUpdateWidget(widget); 115 | } 116 | 117 | void _updateSelectItemWidget() { 118 | selectedItemWidgets.clear(); 119 | for (int index = 0; index < widget.items.length; index++) { 120 | selectedItemWidgets.putIfAbsent( 121 | index, 122 | () => widget.items[index].getSelectedItem( 123 | animatedStateKey, 124 | widget.paddingItemController.paddingGlobalKey, 125 | ), 126 | ); 127 | } 128 | } 129 | 130 | @override 131 | void didChangeDependencies() { 132 | super.didChangeDependencies(); 133 | final dsListener = DirectSelectContainer.of(context); 134 | 135 | this.onTapEventListener = dsListener.toggleListOverlayVisibility 136 | as Future Function(DirectSelectList, double); 137 | this.onDragEventListener = 138 | dsListener.performListDrag; 139 | } 140 | 141 | @override 142 | Widget build(BuildContext context) { 143 | widget.selectedItem.addListener(() { 144 | if (widget.onItemSelectedListener != null) { 145 | widget.onItemSelectedListener?.call( 146 | widget.items[widget.selectedItem.value].value, 147 | widget.selectedItem.value, 148 | this.context); 149 | } 150 | }); 151 | 152 | bool transitionEnded = false; 153 | 154 | return ValueListenableBuilder( 155 | valueListenable: widget.selectedItem, 156 | builder: (context, value, child) { 157 | final selectedItem = selectedItemWidgets[value]; 158 | return GestureDetector( 159 | child: selectedItem, 160 | onTap: () { 161 | if (widget.onUserTappedListener != null) { 162 | widget.onUserTappedListener?.call(); 163 | } 164 | }, 165 | onTapDown: (tapDownDetails) async { 166 | if (!isOverlayVisible) { 167 | transitionEnded = false; 168 | _isShowUpAnimationRunning = true; 169 | await animatedStateKey.currentState 170 | ?.runScaleTransition(reverse: false); 171 | if (!transitionEnded) { 172 | await _showListOverlay(_getItemTopPosition(context)); 173 | _isShowUpAnimationRunning = false; 174 | lastSelectedItem = value; 175 | } 176 | } 177 | }, 178 | onTapUp: (tapUpDetails) async { 179 | await _hideListOverlay(_getItemTopPosition(context)); 180 | animatedStateKey.currentState 181 | ?.runScaleTransition(reverse: true); 182 | }, 183 | onVerticalDragEnd: (dragDetails) async { 184 | transitionEnded = true; 185 | _dragEnd(); 186 | }, 187 | onHorizontalDragEnd: (horizontalDetails) async { 188 | transitionEnded = true; 189 | _dragEnd(); 190 | }, 191 | onVerticalDragUpdate: (dragInfo) { 192 | if (!_isShowUpAnimationRunning) { 193 | _showListOverlay(dragInfo.primaryDelta); 194 | } 195 | }); 196 | }); 197 | } 198 | 199 | void _dragEnd() async { 200 | await _hideListOverlay(_getItemTopPosition(context)); 201 | animatedStateKey.currentState?.runScaleTransition(reverse: true); 202 | } 203 | 204 | double _getItemTopPosition(BuildContext context) { 205 | final RenderBox itemBox = context.findRenderObject() as RenderBox; 206 | final Rect itemRect = itemBox.localToGlobal(Offset.zero) & itemBox.size; 207 | return itemRect.top; 208 | } 209 | 210 | _hideListOverlay(double dy) async { 211 | if (isOverlayVisible) { 212 | isOverlayVisible = false; 213 | //TODO fix to prevent stuck scale if selected item is the same as previous 214 | await onTapEventListener(widget, dy); 215 | if (lastSelectedItem == widget.selectedItem.value) { 216 | animatedStateKey.currentState?.runScaleTransition(reverse: true); 217 | } 218 | } 219 | } 220 | 221 | _showListOverlay(double? dy) { 222 | if (!isOverlayVisible) { 223 | isOverlayVisible = true; 224 | onTapEventListener(widget, _getItemTopPosition(context)); 225 | } else if (dy != null) { 226 | onDragEventListener(dy); 227 | } 228 | } 229 | } 230 | 231 | extension _ListHelper on Iterable { 232 | List toNotNullableList() { 233 | var data = this.toList(); 234 | return data.contains(null) ? List.empty() : data.cast(); 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: direct_select_flutter 2 | description: Direct Select Widget Implementation inspired by https://dribbble.com/shots/3876250-DirectSelect-Dropdown-ux 3 | homepage: https://github.com/LanarsInc/direct-select-flutter 4 | version: 1.1.1 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | rect_getter: ^1.0.0 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | flutter: 19 | uses-material-design: true -------------------------------------------------------------------------------- /res/values/strings_en.arb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LanarsInc/direct-select-flutter/995bc22f3bcadf1392f3e2884b7c46143414c2b0/res/values/strings_en.arb --------------------------------------------------------------------------------