├── .dart_tool ├── version ├── package_config_subset └── package_config.json ├── test └── csc_picker_test.dart ├── example ├── ios │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ └── .gitignore ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ └── values │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── altafrazzaque │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── README.md ├── .gitignore ├── test │ └── widget_test.dart ├── pubspec.yaml ├── pubspec.lock └── lib │ └── main.dart ├── .idea ├── .gitignore ├── vcs.xml ├── libraries │ ├── Flutter_Plugins.xml │ ├── Dart_SDK.xml │ └── Dart_Packages.xml ├── misc.xml ├── modules.xml └── caches │ └── deviceStreaming.xml ├── screenshot ├── vertical_layout.gif └── horizontal_layout.gif ├── .gitignore ├── AUTHORS ├── .metadata ├── pubspec.yaml ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── csc_picker.iml ├── LICENSE ├── CHANGELOG.md ├── .packages ├── lib ├── model │ └── select_status_model.dart ├── dropdown_with_search.dart └── csc_picker.dart ├── CODE_OF_CONDUCT.md ├── pubspec.lock └── README.md /.dart_tool/version: -------------------------------------------------------------------------------- 1 | 3.7.3 -------------------------------------------------------------------------------- /test/csc_picker_test.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /screenshot/vertical_layout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/screenshot/vertical_layout.gif -------------------------------------------------------------------------------- /screenshot/horizontal_layout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/screenshot/horizontal_layout.gif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/caches/deviceStreaming.xml 2 | /.idea/libraries/Dart_Packages.xml 3 | /.idea/caches/deviceStreaming.xml 4 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/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/altafc22/csc_picker/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altafc22/csc_picker/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Below is a list of people and organizations that have contributed 2 | # to the Dart project. Names should be added to the list like so: 3 | # 4 | # Name/Organization 5 | 6 | Google Inc. 7 | 8 | Altaf Razzaque -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /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: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/android/app/src/main/kotlin/com/altafrazzaque/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.altafrazzaque.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | import androidx.annotation.NonNull 6 | import io.flutter.embedding.android.FlutterActivity 7 | import io.flutter.embedding.engine.FlutterEngine 8 | import io.flutter.plugins.GeneratedPluginRegistrant; 9 | 10 | class MainActivity: FlutterActivity() { 11 | } 12 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: csc_picker 2 | description: A flutter package to display list of Countries, States and Cities depends on Selected, also you can search country, state, and city all around the world. 3 | version: 0.2.7 4 | homepage: https://github.com/altafc22/csc_picker 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=1.17.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | flutter: 19 | 20 | assets: 21 | - lib/assets/ 22 | -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | Country State City Picker 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /csc_picker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021, the Dart project authors. All rights reserved. 2 | Redistribution and use in source and binary forms, with or without 3 | modification, are permitted provided that the following conditions are 4 | met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of Google Inc. nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 29 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.altafrazzaque.example" 42 | minSdkVersion 16 43 | targetSdkVersion 29 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.2.7] - 2021/05/14 2 | * Added filterCountry - you can select only those countries which you to display in dropdown 3 | 4 | ## [0.2.6] - 2021/05/14 5 | * Introduce the `currentCountry`, `currentState`, and `currentCity` properties to allow previously selected values to remain 6 | * Sort `CSCPicker` constructor first 7 | * Move `super.initState` before other calls in `csc_picker.dart` 8 | * Fix some typos, method names 9 | * Fix some async method types 10 | 11 | ## [0.2.4 - 0.2.5] - 2021/05/06 12 | * Now you can select default country in csc picker 13 | * Documentation updated 14 | 15 | ## [0.2.1 - 0.2.3] - 2021/04/05 16 | * dropdownDialogRadius option is added to change the dilogbox corner raduis 17 | * searchBarRadius option is added to change the searchbar corner raduis 18 | * selected item clear bug resolved 19 | * code optimized 20 | 21 | ## [0.2.0] - 2021/04/01 22 | * Added Dropdown Decoration options 23 | * Added Text Style options 24 | * Now support Null Safety 25 | 26 | ## [0.1.0] - 2021/03/24 27 | * Removed unwanter lines of code 28 | 29 | ## [0.0.9] - 2021/03/23 30 | * Removed showFlag parameter 31 | * Added new parameter flagState to Enable (get flat with country name) / Disable (Disable flag) / ShowInDropdownOnly (display flag in dropdown only) 32 | * Performance Optimised 33 | * Minor bugs removed 34 | 35 | ## [0.0.6 - 0.0.8] - 2021/03/18 36 | * Added new feature to enable disable state and city dropdown 37 | * Supports Flutter Web 38 | * Performance Optimised 39 | * Minor bugs removed 40 | 41 | ## [0.0.5] - 2021/03/10 42 | * Updated for flutter 2.0.1 43 | * Deprecated widgets removed. 44 | 45 | ## [0.0.4] - 2021/03/04 46 | * Code Formatted and optimised. 47 | * API Documentation Updated. 48 | 49 | ## [0.0.3] - 2021/03/02 50 | * Code Formatted and optimised. 51 | * Documentation Added. 52 | 53 | ## [0.0.2] - 2021/02/28 54 | * Search bug resolved. 55 | 56 | ## [0.0.1] - 2021/02/28 57 | * Initial Release. 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.packages: -------------------------------------------------------------------------------- 1 | # This file is deprecated. Tools should instead consume 2 | # `.dart_tool/package_config.json`. 3 | # 4 | # For more info see: https://dart.dev/go/dot-packages-deprecation 5 | # 6 | # Generated by pub on 2021-09-20 19:24:13.462661. 7 | async:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.8.1/lib/ 8 | boolean_selector:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/ 9 | characters:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/ 10 | charcode:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.3.1/lib/ 11 | clock:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib/ 12 | collection:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/ 13 | fake_async:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/ 14 | flutter:file:///Users/altafrazzaque/Documents/flutter/packages/flutter/lib/ 15 | flutter_test:file:///Users/altafrazzaque/Documents/flutter/packages/flutter_test/lib/ 16 | matcher:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/ 17 | meta:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/ 18 | path:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib/ 19 | sky_engine:file:///Users/altafrazzaque/Documents/flutter/bin/cache/pkg/sky_engine/lib/ 20 | source_span:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1/lib/ 21 | stack_trace:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/ 22 | stream_channel:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/ 23 | string_scanner:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/ 24 | term_glyph:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/ 25 | test_api:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.2/lib/ 26 | typed_data:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/ 27 | vector_math:file:///Users/altafrazzaque/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/ 28 | csc_picker:lib/ 29 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /lib/model/select_status_model.dart: -------------------------------------------------------------------------------- 1 | class Country { 2 | int? id; 3 | String? name; 4 | String? emoji; 5 | String? emojiU; 6 | String? iso2; 7 | String? iso3; 8 | String? frenchname; 9 | int? countrycode; 10 | List? state; 11 | 12 | Country( 13 | {this.id, 14 | this.name, 15 | this.emoji, 16 | this.emojiU, 17 | this.state, 18 | this.iso2, 19 | this.iso3, 20 | this.frenchname, 21 | this.countrycode}); 22 | 23 | Country.fromJson(Map json) { 24 | id = json['id']; 25 | name = json['name']; 26 | emoji = json['emoji']; 27 | emojiU = json['emojiU']; 28 | iso2 = json['iso2']; 29 | iso3 = json['iso3']; 30 | countrycode = json['countrycode']; 31 | frenchname = json['frenchname']; 32 | if (json['state'] != null) { 33 | state = []; 34 | json['state'].forEach((v) { 35 | state!.add(new Region.fromJson(v)); 36 | }); 37 | } 38 | } 39 | 40 | Map toJson() { 41 | final Map data = new Map(); 42 | data['id'] = this.id; 43 | data['name'] = this.name; 44 | data['emoji'] = this.emoji; 45 | data['emojiU'] = this.emojiU; 46 | data['iso2'] = this.iso2; 47 | data['iso3'] = this.iso3; 48 | data['countrycode'] = this.countrycode; 49 | data['frenchname'] = this.frenchname; 50 | if (this.state != null) { 51 | data['state'] = this.state!.map((v) => v.toJson()).toList(); 52 | } 53 | return data; 54 | } 55 | } 56 | 57 | class Region { 58 | int? id; 59 | String? name; 60 | int? countryId; 61 | List? city; 62 | 63 | Region({this.id, this.name, this.countryId, this.city}); 64 | 65 | Region.fromJson(Map json) { 66 | id = json['id']; 67 | name = json['name']; 68 | countryId = json['country_id']; 69 | if (json['city'] != null) { 70 | city = []; 71 | json['city'].forEach((v) { 72 | city!.add(new City.fromJson(v)); 73 | }); 74 | } 75 | } 76 | 77 | Map toJson() { 78 | final Map data = new Map(); 79 | data['id'] = this.id; 80 | data['name'] = this.name; 81 | data['country_id'] = this.countryId; 82 | if (this.city != null) { 83 | data['city'] = this.city!.map((v) => v.toJson()).toList(); 84 | } 85 | return data; 86 | } 87 | } 88 | 89 | class City { 90 | int? id; 91 | String? name; 92 | int? stateId; 93 | 94 | City({this.id, this.name, this.stateId}); 95 | 96 | City.fromJson(Map json) { 97 | id = json['id']; 98 | name = json['name']; 99 | stateId = json['state_id']; 100 | } 101 | 102 | Map toJson() { 103 | final Map data = new Map(); 104 | data['id'] = this.id; 105 | data['name'] = this.name; 106 | data['state_id'] = this.stateId; 107 | return data; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /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/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Country State City Picker 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | 27 | csc_picker: 28 | path: ../ 29 | 30 | # The following adds the Cupertino Icons font to your application. 31 | # Use with the CupertinoIcons class for iOS style icons. 32 | cupertino_icons: ^1.0.0 33 | 34 | dev_dependencies: 35 | flutter_test: 36 | sdk: flutter 37 | 38 | # For information on the generic Dart part of this file, see the 39 | # following page: https://dart.dev/tools/pub/pubspec 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | # assets: 51 | # - images/a_dot_burr.jpeg 52 | # - images/a_dot_ham.jpeg 53 | 54 | # An image asset can refer to one or more resolution-specific "variants", see 55 | # https://flutter.dev/assets-and-images/#resolution-aware. 56 | 57 | # For details regarding adding assets from package dependencies, see 58 | # https://flutter.dev/assets-and-images/#from-packages 59 | 60 | # To add custom fonts to your application, add a fonts section here, 61 | # in this "flutter" section. Each entry in this list should have a 62 | # "family" key with the font family name, and a "fonts" key with a 63 | # list giving the asset and other descriptors for the font. For 64 | # example: 65 | # fonts: 66 | # - family: Schyler 67 | # fonts: 68 | # - asset: fonts/Schyler-Regular.ttf 69 | # - asset: fonts/Schyler-Italic.ttf 70 | # style: italic 71 | # - family: Trajan Pro 72 | # fonts: 73 | # - asset: fonts/TrajanPro.ttf 74 | # - asset: fonts/TrajanPro_Bold.ttf 75 | # weight: 700 76 | # 77 | # For details regarding fonts from package dependencies, 78 | # see https://flutter.dev/custom-fonts/#from-packages 79 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at altafc22@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /.dart_tool/package_config_subset: -------------------------------------------------------------------------------- 1 | async 2 | 2.18 3 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/async-2.10.0/ 4 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/async-2.10.0/lib/ 5 | boolean_selector 6 | 2.17 7 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/ 8 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/lib/ 9 | characters 10 | 2.12 11 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/characters-1.2.1/ 12 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/characters-1.2.1/lib/ 13 | clock 14 | 2.12 15 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/clock-1.1.1/ 16 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/clock-1.1.1/lib/ 17 | collection 18 | 2.12 19 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/collection-1.17.0/ 20 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/ 21 | fake_async 22 | 2.12 23 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/fake_async-1.3.1/ 24 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/fake_async-1.3.1/lib/ 25 | js 26 | 2.16 27 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/js-0.6.5/ 28 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/js-0.6.5/lib/ 29 | matcher 30 | 2.18 31 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/matcher-0.12.13/ 32 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/ 33 | material_color_utilities 34 | 2.13 35 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0/ 36 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0/lib/ 37 | meta 38 | 2.12 39 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/meta-1.8.0/ 40 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/meta-1.8.0/lib/ 41 | path 42 | 2.12 43 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/path-1.8.2/ 44 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/path-1.8.2/lib/ 45 | source_span 46 | 2.14 47 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/source_span-1.9.1/ 48 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/source_span-1.9.1/lib/ 49 | stack_trace 50 | 2.18 51 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/ 52 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/lib/ 53 | stream_channel 54 | 2.14 55 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/ 56 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/lib/ 57 | string_scanner 58 | 2.18 59 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/ 60 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/lib/ 61 | term_glyph 62 | 2.12 63 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/ 64 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/lib/ 65 | test_api 66 | 2.18 67 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/test_api-0.4.16/ 68 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/test_api-0.4.16/lib/ 69 | vector_math 70 | 2.14 71 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/vector_math-2.1.4/ 72 | file:///Users/eagyeman/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/ 73 | csc_picker 74 | 2.12 75 | file:///Users/eagyeman/Documents/Projects/env/csc_picker/ 76 | file:///Users/eagyeman/Documents/Projects/env/csc_picker/lib/ 77 | sky_engine 78 | 2.12 79 | file:///Users/eagyeman/Documents/Tools/flutter/bin/cache/pkg/sky_engine/ 80 | file:///Users/eagyeman/Documents/Tools/flutter/bin/cache/pkg/sky_engine/lib/ 81 | flutter 82 | 2.17 83 | file:///Users/eagyeman/Documents/Tools/flutter/packages/flutter/ 84 | file:///Users/eagyeman/Documents/Tools/flutter/packages/flutter/lib/ 85 | flutter_test 86 | 2.17 87 | file:///Users/eagyeman/Documents/Tools/flutter/packages/flutter_test/ 88 | file:///Users/eagyeman/Documents/Tools/flutter/packages/flutter_test/lib/ 89 | 2 90 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /.dart_tool/package_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "configVersion": 2, 3 | "packages": [ 4 | { 5 | "name": "async", 6 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/async-2.10.0", 7 | "packageUri": "lib/", 8 | "languageVersion": "2.18" 9 | }, 10 | { 11 | "name": "boolean_selector", 12 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1", 13 | "packageUri": "lib/", 14 | "languageVersion": "2.17" 15 | }, 16 | { 17 | "name": "characters", 18 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/characters-1.2.1", 19 | "packageUri": "lib/", 20 | "languageVersion": "2.12" 21 | }, 22 | { 23 | "name": "clock", 24 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/clock-1.1.1", 25 | "packageUri": "lib/", 26 | "languageVersion": "2.12" 27 | }, 28 | { 29 | "name": "collection", 30 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/collection-1.17.0", 31 | "packageUri": "lib/", 32 | "languageVersion": "2.12" 33 | }, 34 | { 35 | "name": "fake_async", 36 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/fake_async-1.3.1", 37 | "packageUri": "lib/", 38 | "languageVersion": "2.12" 39 | }, 40 | { 41 | "name": "flutter", 42 | "rootUri": "file:///Users/eagyeman/Documents/Tools/flutter/packages/flutter", 43 | "packageUri": "lib/", 44 | "languageVersion": "2.17" 45 | }, 46 | { 47 | "name": "flutter_test", 48 | "rootUri": "file:///Users/eagyeman/Documents/Tools/flutter/packages/flutter_test", 49 | "packageUri": "lib/", 50 | "languageVersion": "2.17" 51 | }, 52 | { 53 | "name": "js", 54 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/js-0.6.5", 55 | "packageUri": "lib/", 56 | "languageVersion": "2.16" 57 | }, 58 | { 59 | "name": "matcher", 60 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/matcher-0.12.13", 61 | "packageUri": "lib/", 62 | "languageVersion": "2.18" 63 | }, 64 | { 65 | "name": "material_color_utilities", 66 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0", 67 | "packageUri": "lib/", 68 | "languageVersion": "2.13" 69 | }, 70 | { 71 | "name": "meta", 72 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/meta-1.8.0", 73 | "packageUri": "lib/", 74 | "languageVersion": "2.12" 75 | }, 76 | { 77 | "name": "path", 78 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/path-1.8.2", 79 | "packageUri": "lib/", 80 | "languageVersion": "2.12" 81 | }, 82 | { 83 | "name": "sky_engine", 84 | "rootUri": "file:///Users/eagyeman/Documents/Tools/flutter/bin/cache/pkg/sky_engine", 85 | "packageUri": "lib/", 86 | "languageVersion": "2.12" 87 | }, 88 | { 89 | "name": "source_span", 90 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/source_span-1.9.1", 91 | "packageUri": "lib/", 92 | "languageVersion": "2.14" 93 | }, 94 | { 95 | "name": "stack_trace", 96 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/stack_trace-1.11.0", 97 | "packageUri": "lib/", 98 | "languageVersion": "2.18" 99 | }, 100 | { 101 | "name": "stream_channel", 102 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/stream_channel-2.1.1", 103 | "packageUri": "lib/", 104 | "languageVersion": "2.14" 105 | }, 106 | { 107 | "name": "string_scanner", 108 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/string_scanner-1.2.0", 109 | "packageUri": "lib/", 110 | "languageVersion": "2.18" 111 | }, 112 | { 113 | "name": "term_glyph", 114 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/term_glyph-1.2.1", 115 | "packageUri": "lib/", 116 | "languageVersion": "2.12" 117 | }, 118 | { 119 | "name": "test_api", 120 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/test_api-0.4.16", 121 | "packageUri": "lib/", 122 | "languageVersion": "2.18" 123 | }, 124 | { 125 | "name": "vector_math", 126 | "rootUri": "file:///Users/eagyeman/.pub-cache/hosted/pub.dev/vector_math-2.1.4", 127 | "packageUri": "lib/", 128 | "languageVersion": "2.14" 129 | }, 130 | { 131 | "name": "csc_picker", 132 | "rootUri": "../", 133 | "packageUri": "lib/", 134 | "languageVersion": "2.12" 135 | } 136 | ], 137 | "generated": "2023-03-29T13:56:23.457779Z", 138 | "generator": "pub", 139 | "generatorVersion": "2.19.2" 140 | } 141 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_test: 58 | dependency: "direct dev" 59 | description: flutter 60 | source: sdk 61 | version: "0.0.0" 62 | js: 63 | dependency: transitive 64 | description: 65 | name: js 66 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 67 | url: "https://pub.dev" 68 | source: hosted 69 | version: "0.6.5" 70 | matcher: 71 | dependency: transitive 72 | description: 73 | name: matcher 74 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "0.12.13" 78 | material_color_utilities: 79 | dependency: transitive 80 | description: 81 | name: material_color_utilities 82 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "0.2.0" 86 | meta: 87 | dependency: transitive 88 | description: 89 | name: meta 90 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "1.8.0" 94 | path: 95 | dependency: transitive 96 | description: 97 | name: path 98 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "1.8.2" 102 | sky_engine: 103 | dependency: transitive 104 | description: flutter 105 | source: sdk 106 | version: "0.0.99" 107 | source_span: 108 | dependency: transitive 109 | description: 110 | name: source_span 111 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 112 | url: "https://pub.dev" 113 | source: hosted 114 | version: "1.9.1" 115 | stack_trace: 116 | dependency: transitive 117 | description: 118 | name: stack_trace 119 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 120 | url: "https://pub.dev" 121 | source: hosted 122 | version: "1.11.0" 123 | stream_channel: 124 | dependency: transitive 125 | description: 126 | name: stream_channel 127 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "2.1.1" 131 | string_scanner: 132 | dependency: transitive 133 | description: 134 | name: string_scanner 135 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "1.2.0" 139 | term_glyph: 140 | dependency: transitive 141 | description: 142 | name: term_glyph 143 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "1.2.1" 147 | test_api: 148 | dependency: transitive 149 | description: 150 | name: test_api 151 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "0.4.16" 155 | vector_math: 156 | dependency: transitive 157 | description: 158 | name: vector_math 159 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "2.1.4" 163 | sdks: 164 | dart: ">=2.18.0 <3.0.0" 165 | flutter: ">=1.17.0" 166 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | csc_picker: 45 | dependency: "direct main" 46 | description: 47 | path: ".." 48 | relative: true 49 | source: path 50 | version: "0.2.7" 51 | cupertino_icons: 52 | dependency: "direct main" 53 | description: 54 | name: cupertino_icons 55 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 56 | url: "https://pub.dev" 57 | source: hosted 58 | version: "1.0.5" 59 | fake_async: 60 | dependency: transitive 61 | description: 62 | name: fake_async 63 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 64 | url: "https://pub.dev" 65 | source: hosted 66 | version: "1.3.1" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | js: 78 | dependency: transitive 79 | description: 80 | name: js 81 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 82 | url: "https://pub.dev" 83 | source: hosted 84 | version: "0.6.5" 85 | matcher: 86 | dependency: transitive 87 | description: 88 | name: matcher 89 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "0.12.13" 93 | material_color_utilities: 94 | dependency: transitive 95 | description: 96 | name: material_color_utilities 97 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "0.2.0" 101 | meta: 102 | dependency: transitive 103 | description: 104 | name: meta 105 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "1.8.0" 109 | path: 110 | dependency: transitive 111 | description: 112 | name: path 113 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "1.8.2" 117 | sky_engine: 118 | dependency: transitive 119 | description: flutter 120 | source: sdk 121 | version: "0.0.99" 122 | source_span: 123 | dependency: transitive 124 | description: 125 | name: source_span 126 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 127 | url: "https://pub.dev" 128 | source: hosted 129 | version: "1.9.1" 130 | stack_trace: 131 | dependency: transitive 132 | description: 133 | name: stack_trace 134 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 135 | url: "https://pub.dev" 136 | source: hosted 137 | version: "1.11.0" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "2.1.1" 146 | string_scanner: 147 | dependency: transitive 148 | description: 149 | name: string_scanner 150 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.2.0" 154 | term_glyph: 155 | dependency: transitive 156 | description: 157 | name: term_glyph 158 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.2.1" 162 | test_api: 163 | dependency: transitive 164 | description: 165 | name: test_api 166 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "0.4.16" 170 | vector_math: 171 | dependency: transitive 172 | description: 173 | name: vector_math 174 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "2.1.4" 178 | sdks: 179 | dart: ">=2.18.0 <3.0.0" 180 | flutter: ">=1.17.0" 181 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:csc_picker/csc_picker.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | /// This is a implementation of the Country State City Picker. 5 | void main() { 6 | runApp(MyApp()); 7 | } 8 | 9 | class MyApp extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | title: 'CSC Picker', 14 | theme: ThemeData( 15 | primarySwatch: Colors.blue, 16 | visualDensity: VisualDensity.adaptivePlatformDensity, 17 | ), 18 | home: MyHomePage(title: 'CSC Picker'), 19 | ); 20 | } 21 | } 22 | 23 | class MyHomePage extends StatefulWidget { 24 | MyHomePage({Key key, this.title}) : super(key: key); 25 | 26 | final String title; 27 | 28 | @override 29 | _MyHomePageState createState() => _MyHomePageState(); 30 | } 31 | 32 | class _MyHomePageState extends State { 33 | /// Variables to store country state city data in onChanged method. 34 | String countryValue = ""; 35 | String stateValue = ""; 36 | String cityValue = ""; 37 | String address = ""; 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | GlobalKey _cscPickerKey = GlobalKey(); 42 | 43 | return Scaffold( 44 | appBar: AppBar( 45 | title: Text(widget.title), 46 | ), 47 | body: Center( 48 | child: Container( 49 | padding: EdgeInsets.symmetric(horizontal: 20), 50 | height: 600, 51 | child: Column( 52 | children: [ 53 | ///Adding CSC Picker Widget in app 54 | CSCPicker( 55 | ///Enable disable state dropdown [OPTIONAL PARAMETER] 56 | showStates: true, 57 | 58 | /// Enable disable city drop down [OPTIONAL PARAMETER] 59 | showCities: true, 60 | 61 | ///Enable (get flag with country name) / Disable (Disable flag) / ShowInDropdownOnly (display flag in dropdown only) [OPTIONAL PARAMETER] 62 | flagState: CountryFlag.DISABLE, 63 | 64 | ///Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabledDropdownDecoration) 65 | dropdownDecoration: BoxDecoration( 66 | borderRadius: BorderRadius.all(Radius.circular(10)), 67 | color: Colors.white, 68 | border: 69 | Border.all(color: Colors.grey.shade300, width: 1)), 70 | 71 | ///Disabled Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabled dropdownDecoration) 72 | disabledDropdownDecoration: BoxDecoration( 73 | borderRadius: BorderRadius.all(Radius.circular(10)), 74 | color: Colors.grey.shade300, 75 | border: 76 | Border.all(color: Colors.grey.shade300, width: 1)), 77 | 78 | ///placeholders for dropdown search field 79 | countrySearchPlaceholder: "Country", 80 | stateSearchPlaceholder: "State", 81 | citySearchPlaceholder: "City", 82 | 83 | ///labels for dropdown 84 | countryDropdownLabel: "Country", 85 | stateDropdownLabel: "State", 86 | cityDropdownLabel: "City", 87 | 88 | ///Default Country 89 | ///defaultCountry: CscCountry.India, 90 | 91 | ///Country Filter [OPTIONAL PARAMETER] 92 | countryFilter: [CscCountry.India,CscCountry.United_States,CscCountry.Canada], 93 | 94 | ///Disable country dropdown (Note: use it with default country) 95 | //disableCountry: true, 96 | 97 | ///selected item style [OPTIONAL PARAMETER] 98 | selectedItemStyle: TextStyle( 99 | color: Colors.black, 100 | fontSize: 14, 101 | ), 102 | 103 | ///DropdownDialog Heading style [OPTIONAL PARAMETER] 104 | dropdownHeadingStyle: TextStyle( 105 | color: Colors.black, 106 | fontSize: 17, 107 | fontWeight: FontWeight.bold), 108 | 109 | ///DropdownDialog Item style [OPTIONAL PARAMETER] 110 | dropdownItemStyle: TextStyle( 111 | color: Colors.black, 112 | fontSize: 14, 113 | ), 114 | 115 | ///Dialog box radius [OPTIONAL PARAMETER] 116 | dropdownDialogRadius: 10.0, 117 | 118 | ///Search bar radius [OPTIONAL PARAMETER] 119 | searchBarRadius: 10.0, 120 | 121 | ///triggers once country selected in dropdown 122 | onCountryChanged: (value) { 123 | setState(() { 124 | ///store value in country variable 125 | countryValue = value; 126 | }); 127 | }, 128 | 129 | ///triggers once state selected in dropdown 130 | onStateChanged: (value) { 131 | setState(() { 132 | ///store value in state variable 133 | stateValue = value; 134 | }); 135 | }, 136 | 137 | ///triggers once city selected in dropdown 138 | onCityChanged: (value) { 139 | setState(() { 140 | ///store value in city variable 141 | cityValue = value; 142 | }); 143 | }, 144 | 145 | ///Show only specific countries using country filter 146 | // countryFilter: ["United States", "Canada", "Mexico"], 147 | ), 148 | 149 | ///print newly selected country state and city in Text Widget 150 | TextButton( 151 | onPressed: () { 152 | setState(() { 153 | address = "$cityValue, $stateValue, $countryValue"; 154 | }); 155 | }, 156 | child: Text("Print Data")), 157 | Text(address) 158 | ], 159 | )), 160 | ), 161 | ); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # csc_picker 2 | ![version](https://img.shields.io/badge/version-0.2.6-blue.svg) ![version](https://img.shields.io/badge/NullSefety-True-brightgreen) 3 | 4 | A flutter package to display a country, states, and cities. In addition it gives the possibility to select a list of countries, States and Cities depends on Selected, also you can search country, state, and city all around the world. 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
Horizontal LayoutVertical Layout
14 |
15 | 16 | ## How to Use 17 | 18 | To use this Package, add `csc_picker` as a [dependency in your pubspec.yaml](https://flutter.io/platform-plugins/). 19 | 20 | ```dart 21 | CSCPicker( 22 | onCountryChanged: (value) { 23 | setState(() { 24 | countryValue = value; 25 | }); 26 | }, 27 | onStateChanged:(value) { 28 | setState(() { 29 | stateValue = value; 30 | }); 31 | }, 32 | onCityChanged:(value) { 33 | setState(() { 34 | cityValue = value; 35 | }); 36 | }, 37 | ), 38 | ``` 39 | you will get feedback in onChanged functions 40 | 41 | ### Parameters 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |
ParametersTypeDescription
flagStateCountryFlagEnable (get flag with country name) / Disable (Disable flag) / ShowInDropdownOnly (display flag in dropdown only)
layoutLayoutToggle dropdown layout (Horizontal / Vertical)
showStatesBoolean Enable disable States dropdown (true / false)
showCitiesBoolean Enable disable Cities dropdown (true / false)
dropdownDecorationBoxDecorationDropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabledDropdownDecoration)
disabledDropdownDecorationBoxDecorationDisabled Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabled dropdownDecoration)
selectedItemStyleTextStyleTo change selected item style
dropdownHeadingStyleTextStyleTo change DropdownDialog Heading style
dropdownItemStyleTextStyleTo change DropdownDialog Item style
dropdownDialogRadiusdoubleTo change DropdownDialogBox radius
searchBarRadiusdoubleTo change search bar radius
defaultCountryCscCountryTo select default country
disableCountryBooleanDisable country dropdown (Note: use it with default country)
countryFilterList of CscCountryShow only countries in dropdown that you want
countrySearchPlaceholderStringPlaceholder for country search field
stateSearchPlaceholderStringPlaceholder for state search field
citySearchPlaceholderStringPlaceholder for city search field
countryDropdownLabelStringLabel/Title for country dropdown
countryDropdownLabelStringLabel/Title for state dropdown
countryDropdownLabelStringLabel/Title for city dropdown
67 | 68 | ### Example 69 | 70 | ```dart 71 | import 'package:csc_picker/csc_picker.dart'; 72 | import 'package:flutter/material.dart'; 73 | 74 | /// This is a implementation of the Country State City Picker. 75 | void main() { 76 | runApp(MyApp()); 77 | } 78 | 79 | class MyApp extends StatelessWidget { 80 | @override 81 | Widget build(BuildContext context) { 82 | return MaterialApp( 83 | title: 'CSC Picker', 84 | theme: ThemeData( 85 | primarySwatch: Colors.blue, 86 | visualDensity: VisualDensity.adaptivePlatformDensity, 87 | ), 88 | home: MyHomePage(title: 'CSC Picker'), 89 | ); 90 | } 91 | } 92 | 93 | class MyHomePage extends StatefulWidget { 94 | MyHomePage({Key key, this.title}) : super(key: key); 95 | 96 | final String title; 97 | 98 | @override 99 | _MyHomePageState createState() => _MyHomePageState(); 100 | } 101 | 102 | class _MyHomePageState extends State { 103 | /// Variables to store country state city data in onChanged method. 104 | String countryValue = ""; 105 | String stateValue = ""; 106 | String cityValue = ""; 107 | String address = ""; 108 | 109 | @override 110 | Widget build(BuildContext context) { 111 | 112 | GlobalKey _cscPickerKey = GlobalKey(); 113 | 114 | return Scaffold( 115 | appBar: AppBar( 116 | title: Text(widget.title), 117 | ), 118 | body: Center( 119 | child: Container( 120 | padding: EdgeInsets.symmetric(horizontal: 20), 121 | height: 600, 122 | child: Column( 123 | children: [ 124 | ///Adding CSC Picker Widget in app 125 | CSCPicker( 126 | ///Enable disable state dropdown [OPTIONAL PARAMETER] 127 | showStates: true, 128 | 129 | /// Enable disable city drop down [OPTIONAL PARAMETER] 130 | showCities: true, 131 | 132 | ///Enable (get flag with country name) / Disable (Disable flag) / ShowInDropdownOnly (display flag in dropdown only) [OPTIONAL PARAMETER] 133 | flagState: CountryFlag.DISABLE, 134 | 135 | ///Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabledDropdownDecoration) 136 | dropdownDecoration: BoxDecoration( 137 | borderRadius: BorderRadius.all(Radius.circular(10)), 138 | color: Colors.white, 139 | border: 140 | Border.all(color: Colors.grey.shade300, width: 1)), 141 | 142 | ///Disabled Dropdown box decoration to style your dropdown selector [OPTIONAL PARAMETER] (USE with disabled dropdownDecoration) 143 | disabledDropdownDecoration: BoxDecoration( 144 | borderRadius: BorderRadius.all(Radius.circular(10)), 145 | color: Colors.grey.shade300, 146 | border: 147 | Border.all(color: Colors.grey.shade300, width: 1)), 148 | 149 | ///placeholders for dropdown search field 150 | countrySearchPlaceholder: "Country", 151 | stateSearchPlaceholder: "State", 152 | citySearchPlaceholder: "City", 153 | 154 | ///labels for dropdown 155 | countryDropdownLabel: "*Country", 156 | stateDropdownLabel: "*State", 157 | cityDropdownLabel: "*City", 158 | 159 | ///Default Country 160 | //defaultCountry: CscCountry.India, 161 | 162 | ///Disable country dropdown (Note: use it with default country) 163 | //disableCountry: true, 164 | 165 | ///Country Filter [OPTIONAL PARAMETER] 166 | countryFilter: [CscCountry.India,CscCountry.United_States,CscCountry.Canada], 167 | 168 | ///selected item style [OPTIONAL PARAMETER] 169 | selectedItemStyle: TextStyle( 170 | color: Colors.black, 171 | fontSize: 14, 172 | ), 173 | 174 | ///DropdownDialog Heading style [OPTIONAL PARAMETER] 175 | dropdownHeadingStyle: TextStyle( 176 | color: Colors.black, 177 | fontSize: 17, 178 | fontWeight: FontWeight.bold), 179 | 180 | ///DropdownDialog Item style [OPTIONAL PARAMETER] 181 | dropdownItemStyle: TextStyle( 182 | color: Colors.black, 183 | fontSize: 14, 184 | ), 185 | 186 | ///Dialog box radius [OPTIONAL PARAMETER] 187 | dropdownDialogRadius: 10.0, 188 | 189 | ///Search bar radius [OPTIONAL PARAMETER] 190 | searchBarRadius: 10.0, 191 | 192 | ///triggers once country selected in dropdown 193 | onCountryChanged: (value) { 194 | setState(() { 195 | ///store value in country variable 196 | countryValue = value; 197 | }); 198 | }, 199 | 200 | ///triggers once state selected in dropdown 201 | onStateChanged: (value) { 202 | setState(() { 203 | ///store value in state variable 204 | stateValue = value; 205 | }); 206 | }, 207 | 208 | ///triggers once city selected in dropdown 209 | onCityChanged: (value) { 210 | setState(() { 211 | ///store value in city variable 212 | cityValue = value; 213 | }); 214 | }, 215 | ), 216 | 217 | ///print newly selected country state and city in Text Widget 218 | TextButton( 219 | onPressed: () { 220 | setState(() { 221 | address = "$cityValue, $stateValue, $countryValue"; 222 | }); 223 | }, 224 | child: Text("Print Data")), 225 | Text(address) 226 | ], 227 | )), 228 | ), 229 | ); 230 | } 231 | } 232 | ``` 233 | 234 | ### Special Thanks to 235 | - Okoh Emmanuel, country_state_city_picker [country_state_city_picker](https://github.com/prof22/country_state_city_picker) 236 | - Darshan Gada, countries-states-cities-database [countries-states-cities-database](https://github.com/dr5hn/countries-states-cities-database) 237 | -------------------------------------------------------------------------------- /lib/dropdown_with_search.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DropdownWithSearch extends StatelessWidget { 4 | final String title; 5 | final String placeHolder; 6 | final T selected; 7 | final List items; 8 | final EdgeInsets? selectedItemPadding; 9 | final TextStyle? selectedItemStyle; 10 | final TextStyle? dropdownHeadingStyle; 11 | final TextStyle? itemStyle; 12 | final BoxDecoration? decoration, disabledDecoration; 13 | final double? searchBarRadius; 14 | final double? dialogRadius; 15 | final bool disabled; 16 | final String label; 17 | //final EdgeInsetsGeometry? selectedItemPadding; 18 | 19 | final Function onChanged; 20 | 21 | const DropdownWithSearch( 22 | {Key? key, 23 | required this.title, 24 | required this.placeHolder, 25 | required this.items, 26 | required this.selected, 27 | required this.onChanged, 28 | this.selectedItemPadding, 29 | this.selectedItemStyle, 30 | this.dropdownHeadingStyle, 31 | this.itemStyle, 32 | this.decoration, 33 | this.disabledDecoration, 34 | this.searchBarRadius, 35 | this.dialogRadius, 36 | required this.label, 37 | this.disabled = false}) 38 | : super(key: key); 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return AbsorbPointer( 43 | absorbing: disabled, 44 | child: GestureDetector( 45 | onTap: () { 46 | showDialog( 47 | context: context, 48 | builder: (context) => SearchDialog( 49 | placeHolder: placeHolder, 50 | title: title, 51 | searchInputRadius: searchBarRadius, 52 | dialogRadius: dialogRadius, 53 | titleStyle: dropdownHeadingStyle, 54 | itemStyle: itemStyle, 55 | items: items)).then((value) { 56 | onChanged(value); 57 | /* if(value!=null) 58 | { 59 | onChanged(value); 60 | _lastSelected = value; 61 | } 62 | else { 63 | print("Value NULL $value $_lastSelected"); 64 | onChanged(_lastSelected); 65 | }*/ 66 | }); 67 | }, 68 | child: Container( 69 | padding: selectedItemPadding ?? EdgeInsets.symmetric(horizontal: 8, vertical: 8), 70 | decoration: !disabled 71 | ? decoration != null 72 | ? decoration 73 | : BoxDecoration( 74 | borderRadius: BorderRadius.all(Radius.circular(5)), 75 | color: Colors.white, 76 | border: Border.all(color: Colors.grey.shade300, width: 1)) 77 | : disabledDecoration != null 78 | ? disabledDecoration 79 | : BoxDecoration( 80 | borderRadius: BorderRadius.all(Radius.circular(5)), 81 | color: Colors.grey.shade300, 82 | border: 83 | Border.all(color: Colors.grey.shade300, width: 1)), 84 | child: Row( 85 | children: [ 86 | Expanded( 87 | child: Text(selected.toString(), 88 | overflow: TextOverflow.ellipsis, 89 | style: selectedItemStyle != null 90 | ? selectedItemStyle 91 | : TextStyle(fontSize: 14))), 92 | Icon(Icons.keyboard_arrow_down_rounded) 93 | ], 94 | ), 95 | ), 96 | ), 97 | ); 98 | } 99 | } 100 | 101 | class SearchDialog extends StatefulWidget { 102 | final String title; 103 | final String placeHolder; 104 | final List items; 105 | final TextStyle? titleStyle; 106 | final TextStyle? itemStyle; 107 | final double? searchInputRadius; 108 | 109 | final double? dialogRadius; 110 | 111 | const SearchDialog( 112 | {Key? key, 113 | required this.title, 114 | required this.placeHolder, 115 | required this.items, 116 | this.titleStyle, 117 | this.searchInputRadius, 118 | this.dialogRadius, 119 | this.itemStyle}) 120 | : super(key: key); 121 | 122 | @override 123 | _SearchDialogState createState() => _SearchDialogState(); 124 | } 125 | 126 | class _SearchDialogState extends State { 127 | TextEditingController textController = TextEditingController(); 128 | late List filteredList; 129 | 130 | @override 131 | void initState() { 132 | filteredList = widget.items; 133 | textController.addListener(() { 134 | setState(() { 135 | if (textController.text.isEmpty) { 136 | filteredList = widget.items; 137 | } else { 138 | filteredList = widget.items 139 | .where((element) => element 140 | .toString() 141 | .toLowerCase() 142 | .contains(textController.text.toLowerCase())) 143 | .toList(); 144 | } 145 | }); 146 | }); 147 | super.initState(); 148 | } 149 | 150 | @override 151 | void dispose() { 152 | textController.dispose(); 153 | super.dispose(); 154 | } 155 | 156 | @override 157 | Widget build(BuildContext context) { 158 | return CustomDialog( 159 | shape: RoundedRectangleBorder( 160 | borderRadius: widget.dialogRadius != null 161 | ? BorderRadius.circular(widget.dialogRadius!) 162 | : BorderRadius.circular(14)), 163 | child: ClipRRect( 164 | borderRadius: BorderRadius.circular(12.0), 165 | child: Column( 166 | crossAxisAlignment: CrossAxisAlignment.stretch, 167 | children: [ 168 | Row( 169 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 170 | children: [ 171 | Container( 172 | margin: EdgeInsets.symmetric(horizontal: 16), 173 | child: Text( 174 | widget.title, 175 | style: widget.titleStyle != null 176 | ? widget.titleStyle 177 | : TextStyle(fontSize: 16, fontWeight: FontWeight.w500), 178 | ), 179 | ), 180 | IconButton( 181 | icon: Icon(Icons.close), 182 | onPressed: () { 183 | FocusScope.of(context).unfocus(); 184 | Navigator.pop(context); 185 | }) 186 | /*Align( 187 | alignment: Alignment.centerRight, 188 | child: TextButton( 189 | onPressed: () { 190 | FocusScope.of(context).unfocus(); 191 | Navigator.pop(context); 192 | }, 193 | child: Text( 194 | 'Close', 195 | style: widget.titleStyle != null 196 | ? widget.titleStyle 197 | : TextStyle(fontSize: 14, fontWeight: FontWeight.w500), 198 | )), 199 | )*/ 200 | ], 201 | ), 202 | SizedBox(height: 5), 203 | Container( 204 | margin: EdgeInsets.symmetric(horizontal: 16), 205 | child: TextField( 206 | autofocus: true, 207 | decoration: InputDecoration( 208 | isDense: true, 209 | prefixIcon: Icon(Icons.search), 210 | hintText: widget.placeHolder, 211 | focusedBorder: OutlineInputBorder( 212 | borderRadius: BorderRadius.all( 213 | widget.searchInputRadius != null 214 | ? Radius.circular(widget.searchInputRadius!) 215 | : Radius.circular(5)), 216 | borderSide: const BorderSide( 217 | color: Colors.black26, 218 | ), 219 | ), 220 | enabledBorder: OutlineInputBorder( 221 | borderRadius: BorderRadius.all( 222 | widget.searchInputRadius != null 223 | ? Radius.circular(widget.searchInputRadius!) 224 | : Radius.circular(5)), 225 | borderSide: const BorderSide(color: Colors.black12), 226 | ), 227 | ), 228 | style: widget.itemStyle != null 229 | ? widget.itemStyle 230 | : TextStyle(fontSize: 14), 231 | controller: textController, 232 | ), 233 | ), 234 | SizedBox(height: 5), 235 | Expanded( 236 | child: ClipRRect( 237 | borderRadius: BorderRadius.all(widget.dialogRadius != null 238 | ? Radius.circular(widget.dialogRadius!) 239 | : Radius.circular(5)), 240 | //borderRadius: widget.dialogRadius!=null?BorderRadius.circular(widget.dropDownRadius!):BorderRadius.circular(14), 241 | child: ListView.builder( 242 | itemCount: filteredList.length, 243 | itemBuilder: (context, index) { 244 | return InkWell( 245 | onTap: () { 246 | FocusScope.of(context).unfocus(); 247 | Navigator.pop(context, filteredList[index]); 248 | }, 249 | child: Padding( 250 | padding: const EdgeInsets.symmetric( 251 | vertical: 10, horizontal: 18), 252 | child: Text( 253 | filteredList[index].toString(), 254 | style: widget.itemStyle != null 255 | ? widget.itemStyle 256 | : TextStyle(fontSize: 14), 257 | ), 258 | )); 259 | }), 260 | ), 261 | ), 262 | ], 263 | ), 264 | ), 265 | ); 266 | } 267 | } 268 | 269 | class CustomDialog extends StatelessWidget { 270 | /// Creates a dialog. 271 | /// 272 | /// Typically used in conjunction with [showDialog]. 273 | const CustomDialog({ 274 | Key? key, 275 | this.child, 276 | this.insetAnimationDuration = const Duration(milliseconds: 100), 277 | this.insetAnimationCurve = Curves.decelerate, 278 | this.shape, 279 | this.constraints = const BoxConstraints( 280 | minWidth: 280.0, minHeight: 280.0, maxHeight: 400.0, maxWidth: 400.0), 281 | }) : super(key: key); 282 | 283 | /// The widget below this widget in the tree. 284 | /// 285 | /// {@macro flutter.widgets.child} 286 | final Widget? child; 287 | 288 | /// The duration of the animation to show when the system keyboard intrudes 289 | /// into the space that the dialog is placed in. 290 | /// 291 | /// Defaults to 100 milliseconds. 292 | final Duration insetAnimationDuration; 293 | 294 | /// The curve to use for the animation shown when the system keyboard intrudes 295 | /// into the space that the dialog is placed in. 296 | /// 297 | /// Defaults to [Curves.fastOutSlowIn]. 298 | final Curve insetAnimationCurve; 299 | 300 | /// {@template flutter.material.dialog.shape} 301 | /// The shape of this dialog's border. 302 | /// 303 | /// Defines the dialog's [Material.shape]. 304 | /// 305 | /// The default shape is a [RoundedRectangleBorder] with a radius of 2.0. 306 | /// {@endtemplate} 307 | final ShapeBorder? shape; 308 | final BoxConstraints constraints; 309 | 310 | Color _getColor(BuildContext context) { 311 | return Theme.of(context).dialogBackgroundColor; 312 | } 313 | 314 | // TODO(johnsonmh): Update default dialog border radius to 4.0 to match material spec. 315 | static const RoundedRectangleBorder _defaultDialogShape = 316 | RoundedRectangleBorder( 317 | borderRadius: BorderRadius.all(Radius.circular(2.0))); 318 | 319 | @override 320 | Widget build(BuildContext context) { 321 | final DialogTheme dialogTheme = DialogTheme.of(context); 322 | return AnimatedPadding( 323 | padding: MediaQuery.of(context).viewInsets + 324 | const EdgeInsets.symmetric(horizontal: 22.0, vertical: 24.0), 325 | duration: insetAnimationDuration, 326 | curve: insetAnimationCurve, 327 | child: MediaQuery.removeViewInsets( 328 | removeLeft: true, 329 | removeTop: true, 330 | removeRight: true, 331 | removeBottom: true, 332 | context: context, 333 | child: Center( 334 | child: ConstrainedBox( 335 | constraints: constraints, 336 | child: Material( 337 | elevation: 15.0, 338 | color: _getColor(context), 339 | type: MaterialType.card, 340 | child: child, 341 | shape: shape ?? dialogTheme.shape ?? _defaultDialogShape, 342 | ), 343 | ), 344 | ), 345 | ), 346 | ); 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /.idea/caches/deviceStreaming.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 339 | 340 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.altafrazzaque.example; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.altafrazzaque.example; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.altafrazzaque.example; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /lib/csc_picker.dart: -------------------------------------------------------------------------------- 1 | library csc_picker; 2 | 3 | import 'package:csc_picker/dropdown_with_search.dart'; 4 | import 'package:flutter/services.dart' show rootBundle; 5 | import 'dart:convert'; 6 | import 'package:flutter/material.dart'; 7 | import 'model/select_status_model.dart'; 8 | 9 | enum Layout { vertical, horizontal } 10 | 11 | enum CountryFlag { SHOW_IN_DROP_DOWN_ONLY, ENABLE, DISABLE } 12 | 13 | enum CscCountry { 14 | Afghanistan, 15 | Aland_Islands, 16 | Albania, 17 | Algeria, 18 | American_Samoa, 19 | Andorra, 20 | Angola, 21 | Anguilla, 22 | Antarctica, 23 | Antigua_And_Barbuda, 24 | Argentina, 25 | Armenia, 26 | Aruba, 27 | Australia, 28 | Austria, 29 | Azerbaijan, 30 | Bahamas_The, 31 | Bahrain, 32 | Bangladesh, 33 | Barbados, 34 | Belarus, 35 | Belgium, 36 | Belize, 37 | Benin, 38 | Bermuda, 39 | Bhutan, 40 | Bolivia, 41 | Bosnia_and_Herzegovina, 42 | Botswana, 43 | Bouvet_Island, 44 | Brazil, 45 | British_Indian_Ocean_Territory, 46 | Brunei, 47 | Bulgaria, 48 | Burkina_Faso, 49 | Burundi, 50 | Cambodia, 51 | Cameroon, 52 | Canada, 53 | Cape_Verde, 54 | Cayman_Islands, 55 | Central_African_Republic, 56 | Chad, 57 | Chile, 58 | China, 59 | Christmas_Island, 60 | Cocos_Keeling_Islands, 61 | Colombia, 62 | Comoros, 63 | Congo, 64 | Congo_The_Democratic_Republic_Of_The, 65 | Cook_Islands, 66 | Costa_Rica, 67 | Cote_D_Ivoire_Ivory_Coast, 68 | Croatia_Hrvatska, 69 | Cuba, 70 | Cyprus, 71 | Czech_Republic, 72 | Denmark, 73 | Djibouti, 74 | Dominica, 75 | Dominican_Republic, 76 | East_Timor, 77 | Ecuador, 78 | Egypt, 79 | El_Salvador, 80 | Equatorial_Guinea, 81 | Eritrea, 82 | Estonia, 83 | Ethiopia, 84 | Falkland_Islands, 85 | Faroe_Islands, 86 | Fiji_Islands, 87 | Finland, 88 | France, 89 | French_Guiana, 90 | French_Polynesia, 91 | French_Southern_Territories, 92 | Gabon, 93 | Gambia_The, 94 | Georgia, 95 | Germany, 96 | Ghana, 97 | Gibraltar, 98 | Greece, 99 | Greenland, 100 | Grenada, 101 | Guadeloupe, 102 | Guam, 103 | Guatemala, 104 | Guernsey_and_Alderney, 105 | Guinea, 106 | Guinea_Bissau, 107 | Guyana, 108 | Haiti, 109 | Heard_Island_and_McDonald_Islands, 110 | Honduras, 111 | Hong_Kong_S_A_R, 112 | Hungary, 113 | Iceland, 114 | India, 115 | Indonesia, 116 | Iran, 117 | Iraq, 118 | Ireland, 119 | Israel, 120 | Italy, 121 | Jamaica, 122 | Japan, 123 | Jersey, 124 | Jordan, 125 | Kazakhstan, 126 | Kenya, 127 | Kiribati, 128 | Korea_North, 129 | Korea_South, 130 | Kuwait, 131 | Kyrgyzstan, 132 | Laos, 133 | Latvia, 134 | Lebanon, 135 | Lesotho, 136 | Liberia, 137 | Libya, 138 | Liechtenstein, 139 | Lithuania, 140 | Luxembourg, 141 | Macau_S_A_R, 142 | Macedonia, 143 | Madagascar, 144 | Malawi, 145 | Malaysia, 146 | Maldives, 147 | Mali, 148 | Malta, 149 | Man_Isle_of, 150 | Marshall_Islands, 151 | Martinique, 152 | Mauritania, 153 | Mauritius, 154 | Mayotte, 155 | Mexico, 156 | Micronesia, 157 | Moldova, 158 | Monaco, 159 | Mongolia, 160 | Montenegro, 161 | Montserrat, 162 | Morocco, 163 | Mozambique, 164 | Myanmar, 165 | Namibia, 166 | Nauru, 167 | Nepal, 168 | Bonaire_Sint_Eustatius_and_Saba, 169 | Netherlands_The, 170 | New_Caledonia, 171 | New_Zealand, 172 | Nicaragua, 173 | Niger, 174 | Nigeria, 175 | Niue, 176 | Norfolk_Island, 177 | Northern_Mariana_Islands, 178 | Norway, 179 | Oman, 180 | Pakistan, 181 | Palau, 182 | Palestinian_Territory_Occupied, 183 | Panama, 184 | Papua_new_Guinea, 185 | Paraguay, 186 | Peru, 187 | Philippines, 188 | Pitcairn_Island, 189 | Poland, 190 | Portugal, 191 | Puerto_Rico, 192 | Qatar, 193 | Reunion, 194 | Romania, 195 | Russia, 196 | Rwanda, 197 | Saint_Helena, 198 | Saint_Kitts_And_Nevis, 199 | Saint_Lucia, 200 | Saint_Pierre_and_Miquelon, 201 | Saint_Vincent_And_The_Grenadines, 202 | Saint_Barthelemy, 203 | Saint_Martin_French_part, 204 | Samoa, 205 | San_Marino, 206 | Sao_Tome_and_Principe, 207 | Saudi_Arabia, 208 | Senegal, 209 | Serbia, 210 | Seychelles, 211 | Sierra_Leone, 212 | Singapore, 213 | Slovakia, 214 | Slovenia, 215 | Solomon_Islands, 216 | Somalia, 217 | South_Africa, 218 | South_Georgia, 219 | South_Sudan, 220 | Spain, 221 | Sri_Lanka, 222 | Sudan, 223 | Suriname, 224 | Svalbard_And_Jan_Mayen_Islands, 225 | Swaziland, 226 | Sweden, 227 | Switzerland, 228 | Syria, 229 | Taiwan, 230 | Tajikistan, 231 | Tanzania, 232 | Thailand, 233 | Togo, 234 | Tokelau, 235 | Tonga, 236 | Trinidad_And_Tobago, 237 | Tunisia, 238 | Turkey, 239 | Turkmenistan, 240 | Turks_And_Caicos_Islands, 241 | Tuvalu, 242 | Uganda, 243 | Ukraine, 244 | United_Arab_Emirates, 245 | United_Kingdom, 246 | United_States, 247 | United_States_Minor_Outlying_Islands, 248 | Uruguay, 249 | Uzbekistan, 250 | Vanuatu, 251 | Vatican_City_State_Holy_See, 252 | Venezuela, 253 | Vietnam, 254 | Virgin_Islands_British, 255 | Virgin_Islands_US, 256 | Wallis_And_Futuna_Islands, 257 | Western_Sahara, 258 | Yemen, 259 | Zambia, 260 | Zimbabwe, 261 | Kosovo, 262 | Curacao, 263 | Sint_Maarten_Dutch_part 264 | } 265 | 266 | const Map Countries = { 267 | CscCountry.Afghanistan: 0, 268 | CscCountry.Aland_Islands: 1, 269 | CscCountry.Albania: 2, 270 | CscCountry.Algeria: 3, 271 | CscCountry.American_Samoa: 4, 272 | CscCountry.Andorra: 5, 273 | CscCountry.Angola: 6, 274 | CscCountry.Anguilla: 7, 275 | CscCountry.Antarctica: 8, 276 | CscCountry.Antigua_And_Barbuda: 9, 277 | CscCountry.Argentina: 10, 278 | CscCountry.Armenia: 11, 279 | CscCountry.Aruba: 12, 280 | CscCountry.Australia: 13, 281 | CscCountry.Austria: 14, 282 | CscCountry.Azerbaijan: 15, 283 | CscCountry.Bahamas_The: 16, 284 | CscCountry.Bahrain: 17, 285 | CscCountry.Bangladesh: 18, 286 | CscCountry.Barbados: 19, 287 | CscCountry.Belarus: 20, 288 | CscCountry.Belgium: 21, 289 | CscCountry.Belize: 22, 290 | CscCountry.Benin: 23, 291 | CscCountry.Bermuda: 24, 292 | CscCountry.Bhutan: 25, 293 | CscCountry.Bolivia: 26, 294 | CscCountry.Bosnia_and_Herzegovina: 27, 295 | CscCountry.Botswana: 28, 296 | CscCountry.Bouvet_Island: 29, 297 | CscCountry.Brazil: 30, 298 | CscCountry.British_Indian_Ocean_Territory: 31, 299 | CscCountry.Brunei: 32, 300 | CscCountry.Bulgaria: 33, 301 | CscCountry.Burkina_Faso: 34, 302 | CscCountry.Burundi: 35, 303 | CscCountry.Cambodia: 36, 304 | CscCountry.Cameroon: 37, 305 | CscCountry.Canada: 38, 306 | CscCountry.Cape_Verde: 39, 307 | CscCountry.Cayman_Islands: 40, 308 | CscCountry.Central_African_Republic: 41, 309 | CscCountry.Chad: 42, 310 | CscCountry.Chile: 43, 311 | CscCountry.China: 44, 312 | CscCountry.Christmas_Island: 45, 313 | CscCountry.Cocos_Keeling_Islands: 46, 314 | CscCountry.Colombia: 47, 315 | CscCountry.Comoros: 48, 316 | CscCountry.Congo: 49, 317 | CscCountry.Congo_The_Democratic_Republic_Of_The: 50, 318 | CscCountry.Cook_Islands: 51, 319 | CscCountry.Costa_Rica: 52, 320 | CscCountry.Cote_D_Ivoire_Ivory_Coast: 53, 321 | CscCountry.Croatia_Hrvatska: 54, 322 | CscCountry.Cuba: 55, 323 | CscCountry.Cyprus: 56, 324 | CscCountry.Czech_Republic: 57, 325 | CscCountry.Denmark: 58, 326 | CscCountry.Djibouti: 59, 327 | CscCountry.Dominica: 60, 328 | CscCountry.Dominican_Republic: 61, 329 | CscCountry.East_Timor: 62, 330 | CscCountry.Ecuador: 63, 331 | CscCountry.Egypt: 64, 332 | CscCountry.El_Salvador: 65, 333 | CscCountry.Equatorial_Guinea: 66, 334 | CscCountry.Eritrea: 67, 335 | CscCountry.Estonia: 68, 336 | CscCountry.Ethiopia: 69, 337 | CscCountry.Falkland_Islands: 70, 338 | CscCountry.Faroe_Islands: 71, 339 | CscCountry.Fiji_Islands: 72, 340 | CscCountry.Finland: 73, 341 | CscCountry.France: 74, 342 | CscCountry.French_Guiana: 75, 343 | CscCountry.French_Polynesia: 76, 344 | CscCountry.French_Southern_Territories: 77, 345 | CscCountry.Gabon: 78, 346 | CscCountry.Gambia_The: 79, 347 | CscCountry.Georgia: 80, 348 | CscCountry.Germany: 81, 349 | CscCountry.Ghana: 82, 350 | CscCountry.Gibraltar: 83, 351 | CscCountry.Greece: 84, 352 | CscCountry.Greenland: 85, 353 | CscCountry.Grenada: 86, 354 | CscCountry.Guadeloupe: 87, 355 | CscCountry.Guam: 88, 356 | CscCountry.Guatemala: 89, 357 | CscCountry.Guernsey_and_Alderney: 90, 358 | CscCountry.Guinea: 91, 359 | CscCountry.Guinea_Bissau: 92, 360 | CscCountry.Guyana: 93, 361 | CscCountry.Haiti: 94, 362 | CscCountry.Heard_Island_and_McDonald_Islands: 95, 363 | CscCountry.Honduras: 96, 364 | CscCountry.Hong_Kong_S_A_R: 97, 365 | CscCountry.Hungary: 98, 366 | CscCountry.Iceland: 99, 367 | CscCountry.India: 100, 368 | CscCountry.Indonesia: 101, 369 | CscCountry.Iran: 102, 370 | CscCountry.Iraq: 103, 371 | CscCountry.Ireland: 104, 372 | CscCountry.Israel: 105, 373 | CscCountry.Italy: 106, 374 | CscCountry.Jamaica: 107, 375 | CscCountry.Japan: 108, 376 | CscCountry.Jersey: 109, 377 | CscCountry.Jordan: 110, 378 | CscCountry.Kazakhstan: 111, 379 | CscCountry.Kenya: 112, 380 | CscCountry.Kiribati: 113, 381 | CscCountry.Korea_North: 114, 382 | CscCountry.Korea_South: 115, 383 | CscCountry.Kuwait: 116, 384 | CscCountry.Kyrgyzstan: 117, 385 | CscCountry.Laos: 118, 386 | CscCountry.Latvia: 119, 387 | CscCountry.Lebanon: 120, 388 | CscCountry.Lesotho: 121, 389 | CscCountry.Liberia: 122, 390 | CscCountry.Libya: 123, 391 | CscCountry.Liechtenstein: 124, 392 | CscCountry.Lithuania: 125, 393 | CscCountry.Luxembourg: 126, 394 | CscCountry.Macau_S_A_R: 127, 395 | CscCountry.Macedonia: 128, 396 | CscCountry.Madagascar: 129, 397 | CscCountry.Malawi: 130, 398 | CscCountry.Malaysia: 131, 399 | CscCountry.Maldives: 132, 400 | CscCountry.Mali: 133, 401 | CscCountry.Malta: 134, 402 | CscCountry.Man_Isle_of: 135, 403 | CscCountry.Marshall_Islands: 136, 404 | CscCountry.Martinique: 137, 405 | CscCountry.Mauritania: 138, 406 | CscCountry.Mauritius: 139, 407 | CscCountry.Mayotte: 140, 408 | CscCountry.Mexico: 141, 409 | CscCountry.Micronesia: 142, 410 | CscCountry.Moldova: 143, 411 | CscCountry.Monaco: 144, 412 | CscCountry.Mongolia: 145, 413 | CscCountry.Montenegro: 146, 414 | CscCountry.Montserrat: 147, 415 | CscCountry.Morocco: 148, 416 | CscCountry.Mozambique: 149, 417 | CscCountry.Myanmar: 150, 418 | CscCountry.Namibia: 151, 419 | CscCountry.Nauru: 152, 420 | CscCountry.Nepal: 153, 421 | CscCountry.Bonaire_Sint_Eustatius_and_Saba: 154, 422 | CscCountry.Netherlands_The: 155, 423 | CscCountry.New_Caledonia: 156, 424 | CscCountry.New_Zealand: 157, 425 | CscCountry.Nicaragua: 158, 426 | CscCountry.Niger: 159, 427 | CscCountry.Nigeria: 160, 428 | CscCountry.Niue: 161, 429 | CscCountry.Norfolk_Island: 162, 430 | CscCountry.Northern_Mariana_Islands: 163, 431 | CscCountry.Norway: 164, 432 | CscCountry.Oman: 165, 433 | CscCountry.Pakistan: 166, 434 | CscCountry.Palau: 167, 435 | CscCountry.Palestinian_Territory_Occupied: 168, 436 | CscCountry.Panama: 169, 437 | CscCountry.Papua_new_Guinea: 170, 438 | CscCountry.Paraguay: 171, 439 | CscCountry.Peru: 172, 440 | CscCountry.Philippines: 173, 441 | CscCountry.Pitcairn_Island: 174, 442 | CscCountry.Poland: 175, 443 | CscCountry.Portugal: 176, 444 | CscCountry.Puerto_Rico: 177, 445 | CscCountry.Qatar: 178, 446 | CscCountry.Reunion: 179, 447 | CscCountry.Romania: 180, 448 | CscCountry.Russia: 181, 449 | CscCountry.Rwanda: 182, 450 | CscCountry.Saint_Helena: 183, 451 | CscCountry.Saint_Kitts_And_Nevis: 184, 452 | CscCountry.Saint_Lucia: 185, 453 | CscCountry.Saint_Pierre_and_Miquelon: 186, 454 | CscCountry.Saint_Vincent_And_The_Grenadines: 187, 455 | CscCountry.Saint_Barthelemy: 188, 456 | CscCountry.Saint_Martin_French_part: 189, 457 | CscCountry.Samoa: 190, 458 | CscCountry.San_Marino: 191, 459 | CscCountry.Sao_Tome_and_Principe: 192, 460 | CscCountry.Saudi_Arabia: 193, 461 | CscCountry.Senegal: 194, 462 | CscCountry.Serbia: 195, 463 | CscCountry.Seychelles: 196, 464 | CscCountry.Sierra_Leone: 197, 465 | CscCountry.Singapore: 198, 466 | CscCountry.Slovakia: 199, 467 | CscCountry.Slovenia: 200, 468 | CscCountry.Solomon_Islands: 201, 469 | CscCountry.Somalia: 202, 470 | CscCountry.South_Africa: 203, 471 | CscCountry.South_Georgia: 204, 472 | CscCountry.South_Sudan: 205, 473 | CscCountry.Spain: 206, 474 | CscCountry.Sri_Lanka: 207, 475 | CscCountry.Sudan: 208, 476 | CscCountry.Suriname: 209, 477 | CscCountry.Svalbard_And_Jan_Mayen_Islands: 210, 478 | CscCountry.Swaziland: 211, 479 | CscCountry.Sweden: 212, 480 | CscCountry.Switzerland: 213, 481 | CscCountry.Syria: 214, 482 | CscCountry.Taiwan: 215, 483 | CscCountry.Tajikistan: 216, 484 | CscCountry.Tanzania: 217, 485 | CscCountry.Thailand: 218, 486 | CscCountry.Togo: 219, 487 | CscCountry.Tokelau: 220, 488 | CscCountry.Tonga: 221, 489 | CscCountry.Trinidad_And_Tobago: 222, 490 | CscCountry.Tunisia: 223, 491 | CscCountry.Turkey: 224, 492 | CscCountry.Turkmenistan: 225, 493 | CscCountry.Turks_And_Caicos_Islands: 226, 494 | CscCountry.Tuvalu: 227, 495 | CscCountry.Uganda: 228, 496 | CscCountry.Ukraine: 229, 497 | CscCountry.United_Arab_Emirates: 230, 498 | CscCountry.United_Kingdom: 231, 499 | CscCountry.United_States: 232, 500 | CscCountry.United_States_Minor_Outlying_Islands: 233, 501 | CscCountry.Uruguay: 234, 502 | CscCountry.Uzbekistan: 235, 503 | CscCountry.Vanuatu: 236, 504 | CscCountry.Vatican_City_State_Holy_See: 237, 505 | CscCountry.Venezuela: 238, 506 | CscCountry.Vietnam: 239, 507 | CscCountry.Virgin_Islands_British: 240, 508 | CscCountry.Virgin_Islands_US: 241, 509 | CscCountry.Wallis_And_Futuna_Islands: 242, 510 | CscCountry.Western_Sahara: 243, 511 | CscCountry.Yemen: 244, 512 | CscCountry.Zambia: 245, 513 | CscCountry.Zimbabwe: 246, 514 | CscCountry.Kosovo: 247, 515 | CscCountry.Curacao: 248, 516 | CscCountry.Sint_Maarten_Dutch_part: 249, 517 | }; 518 | 519 | class CSCPicker extends StatefulWidget { 520 | ///CSC Picker Constructor 521 | const CSCPicker({ 522 | Key? key, 523 | this.onCountryChanged, 524 | this.onStateChanged, 525 | this.onCityChanged, 526 | this.selectedItemStyle, 527 | this.dropdownHeadingStyle, 528 | this.dropdownItemStyle, 529 | this.dropdownDecoration, 530 | this.disabledDropdownDecoration, 531 | this.searchBarRadius, 532 | this.dropdownDialogRadius, 533 | this.flagState = CountryFlag.ENABLE, 534 | this.layout = Layout.horizontal, 535 | this.showStates = true, 536 | this.showCities = true, 537 | this.defaultCountry, 538 | this.currentCountry, 539 | this.currentState, 540 | this.currentCity, 541 | this.disableCountry = false, 542 | this.countrySearchPlaceholder = "Search Country", 543 | this.stateSearchPlaceholder = "Search State", 544 | this.citySearchPlaceholder = "Search City", 545 | this.countryDropdownLabel = "Country", 546 | this.stateDropdownLabel = "State", 547 | this.cityDropdownLabel = "City", 548 | 549 | this.countryFilter, this.selectedItemPadding, 550 | this.countryFilter, 551 | }) : super(key: key); 552 | 553 | final ValueChanged? onCountryChanged; 554 | final ValueChanged? onStateChanged; 555 | final ValueChanged? onCityChanged; 556 | 557 | final String? currentCountry; 558 | final String? currentState; 559 | final String? currentCity; 560 | 561 | final bool disableCountry; 562 | 563 | ///Parameters to change style of CSC Picker 564 | final TextStyle? selectedItemStyle, dropdownHeadingStyle, dropdownItemStyle; 565 | final BoxDecoration? dropdownDecoration, disabledDropdownDecoration; 566 | final bool showStates, showCities; 567 | final CountryFlag flagState; 568 | final Layout layout; 569 | final double? searchBarRadius; 570 | final double? dropdownDialogRadius; 571 | 572 | final CscCountry? defaultCountry; 573 | 574 | final String countrySearchPlaceholder; 575 | final String stateSearchPlaceholder; 576 | final String citySearchPlaceholder; 577 | 578 | final String countryDropdownLabel; 579 | final String stateDropdownLabel; 580 | final String cityDropdownLabel; 581 | 582 | final EdgeInsets? selectedItemPadding; 583 | 584 | final List? countryFilter; 585 | 586 | @override 587 | CSCPickerState createState() => CSCPickerState(); 588 | } 589 | 590 | class CSCPickerState extends State { 591 | List _cities = []; 592 | List _country = []; 593 | List _states = []; 594 | List _countryFilter = []; 595 | 596 | String _selectedCity = 'City'; 597 | String? _selectedCountry; 598 | String _selectedState = 'State'; 599 | var responses; 600 | 601 | @override 602 | void initState() { 603 | super.initState(); 604 | setDefaults(); 605 | if (widget.countryFilter != null) { 606 | _countryFilter = widget.countryFilter!; 607 | } 608 | getCountries(); 609 | _selectedCity = widget.cityDropdownLabel; 610 | _selectedState = widget.stateDropdownLabel; 611 | } 612 | 613 | Future setDefaults() async { 614 | if (widget.currentCountry != null) { 615 | setState(() => _selectedCountry = widget.currentCountry); 616 | await getStates(); 617 | } 618 | 619 | if (widget.currentState != null) { 620 | setState(() => _selectedState = widget.currentState!); 621 | await getCities(); 622 | } 623 | 624 | if (widget.currentCity != null) { 625 | setState(() => _selectedCity = widget.currentCity!); 626 | } 627 | } 628 | 629 | void _setDefaultCountry() { 630 | if (widget.defaultCountry != null) { 631 | print(_country[Countries[widget.defaultCountry]!]); 632 | _onSelectedCountry(_country[Countries[widget.defaultCountry]!]!); 633 | } 634 | } 635 | 636 | ///Read JSON country data from assets 637 | Future getResponse() async { 638 | var res = await rootBundle 639 | .loadString('packages/csc_picker/lib/assets/country.json'); 640 | return jsonDecode(res); 641 | } 642 | 643 | ///get countries from json response 644 | Future> getCountries() async { 645 | _country.clear(); 646 | var countries = await getResponse() as List; 647 | if (_countryFilter.isNotEmpty) { 648 | _countryFilter.forEach((element) { 649 | var result = countries[Countries[element]!]; 650 | if(result!=null) addCountryToList(result); 651 | }); 652 | } else { 653 | countries.forEach((data) { 654 | addCountryToList(data); 655 | }); 656 | } 657 | _setDefaultCountry(); 658 | return _country; 659 | } 660 | 661 | ///Add a country to country list 662 | void addCountryToList(data) { 663 | var model = Country(); 664 | model.name = data['name']; 665 | model.emoji = data['emoji']; 666 | if (!mounted) return; 667 | setState(() { 668 | widget.flagState == CountryFlag.ENABLE || 669 | widget.flagState == CountryFlag.SHOW_IN_DROP_DOWN_ONLY 670 | ? _country.add(model.emoji! + 671 | " " + 672 | model.name!) /* : _country.add(model.name)*/ 673 | : _country.add(model.name); 674 | }); 675 | } 676 | 677 | ///get states from json response 678 | Future> getStates() async { 679 | _states.clear(); 680 | //print(_selectedCountry); 681 | var response = await getResponse(); 682 | var takeState = widget.flagState == CountryFlag.ENABLE || 683 | widget.flagState == CountryFlag.SHOW_IN_DROP_DOWN_ONLY 684 | ? response 685 | .map((map) => Country.fromJson(map)) 686 | .where( 687 | (item) => item.emoji + " " + item.name == _selectedCountry) 688 | .map((item) => item.state) 689 | .toList() 690 | : response 691 | .map((map) => Country.fromJson(map)) 692 | .where((item) => item.name == _selectedCountry) 693 | .map((item) => item.state) 694 | .toList(); 695 | var states = takeState as List; 696 | states.forEach((f) { 697 | if (!mounted) return; 698 | setState(() { 699 | var name = f.map((item) => item.name).toList(); 700 | for (var stateName in name) { 701 | //print(stateName.toString()); 702 | _states.add(stateName.toString()); 703 | } 704 | }); 705 | }); 706 | _states.sort((a, b) => a!.compareTo(b!)); 707 | return _states; 708 | } 709 | 710 | ///get cities from json response 711 | Future> getCities() async { 712 | _cities.clear(); 713 | var response = await getResponse(); 714 | var takeCity = widget.flagState == CountryFlag.ENABLE || 715 | widget.flagState == CountryFlag.SHOW_IN_DROP_DOWN_ONLY 716 | ? response 717 | .map((map) => Country.fromJson(map)) 718 | .where( 719 | (item) => item.emoji + " " + item.name == _selectedCountry) 720 | .map((item) => item.state) 721 | .toList() 722 | : response 723 | .map((map) => Country.fromJson(map)) 724 | .where((item) => item.name == _selectedCountry) 725 | .map((item) => item.state) 726 | .toList(); 727 | var cities = takeCity as List; 728 | cities.forEach((f) { 729 | var name = f.where((item) => item.name == _selectedState); 730 | var cityName = name.map((item) => item.city).toList(); 731 | cityName.forEach((ci) { 732 | if (!mounted) return; 733 | setState(() { 734 | var citiesName = ci.map((item) => item.name).toList(); 735 | for (var cityName in citiesName) { 736 | //print(cityName.toString()); 737 | _cities.add(cityName.toString()); 738 | } 739 | }); 740 | }); 741 | }); 742 | _cities.sort((a, b) => a!.compareTo(b!)); 743 | return _cities; 744 | } 745 | 746 | ///get methods to catch newly selected country state and city and populate state based on country, and city based on state 747 | void _onSelectedCountry(String value) { 748 | if (!mounted) return; 749 | setState(() { 750 | if (widget.flagState == CountryFlag.SHOW_IN_DROP_DOWN_ONLY) { 751 | try { 752 | this.widget.onCountryChanged!(value.substring(6).trim()); 753 | } catch (e) {} 754 | } else 755 | this.widget.onCountryChanged!(value); 756 | //code added in if condition 757 | if (value != _selectedCountry) { 758 | _states.clear(); 759 | _cities.clear(); 760 | _selectedState = widget.stateDropdownLabel; 761 | _selectedCity = widget.cityDropdownLabel; 762 | this.widget.onStateChanged!(null); 763 | this.widget.onCityChanged!(null); 764 | _selectedCountry = value; 765 | getStates(); 766 | } else { 767 | this.widget.onStateChanged!(_selectedState); 768 | this.widget.onCityChanged!(_selectedCity); 769 | } 770 | }); 771 | } 772 | 773 | void _onSelectedState(String value) { 774 | if (!mounted) return; 775 | setState(() { 776 | this.widget.onStateChanged!(value); 777 | //code added in if condition 778 | if (value != _selectedState) { 779 | _cities.clear(); 780 | _selectedCity = widget.cityDropdownLabel; 781 | this.widget.onCityChanged!(null); 782 | _selectedState = value; 783 | getCities(); 784 | } else { 785 | this.widget.onCityChanged!(_selectedCity); 786 | } 787 | }); 788 | } 789 | 790 | void _onSelectedCity(String value) { 791 | if (!mounted) return; 792 | setState(() { 793 | //code added in if condition 794 | if (value != _selectedCity) { 795 | _selectedCity = value; 796 | this.widget.onCityChanged!(value); 797 | } 798 | }); 799 | } 800 | 801 | @override 802 | Widget build(BuildContext context) { 803 | return Column( 804 | children: [ 805 | widget.layout == Layout.vertical 806 | ? Column( 807 | mainAxisAlignment: MainAxisAlignment.center, 808 | children: [ 809 | countryDropdown(), 810 | SizedBox( 811 | height: 10.0, 812 | ), 813 | widget.showStates 814 | ? stateDropdown() 815 | : Container(), 816 | SizedBox( 817 | height: 10.0, 818 | ), 819 | widget.showStates && widget.showCities 820 | ? cityDropdown() 821 | : Container() 822 | ], 823 | ) 824 | : Column( 825 | children: [ 826 | Row( 827 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 828 | children: [ 829 | Expanded(child: countryDropdown()), 830 | widget.showStates 831 | ? SizedBox( 832 | width: 10.0, 833 | ) 834 | : Container(), 835 | widget.showStates 836 | ? Expanded(child: stateDropdown()) 837 | : Container(), 838 | ], 839 | ), 840 | SizedBox( 841 | height: 10.0, 842 | ), 843 | widget.showStates && widget.showCities 844 | ? cityDropdown() 845 | : Container() 846 | ], 847 | ), 848 | ], 849 | ); 850 | } 851 | 852 | ///filter Country Data according to user input 853 | Future> getCountryData(filter) async { 854 | var filteredList = _country 855 | .where( 856 | (country) => country!.toLowerCase().contains(filter.toLowerCase())) 857 | .toList(); 858 | if (filteredList.isEmpty) 859 | return _country; 860 | else 861 | return filteredList; 862 | } 863 | 864 | ///filter Sate Data according to user input 865 | Future> getStateData(filter) async { 866 | var filteredList = _states 867 | .where((state) => state!.toLowerCase().contains(filter.toLowerCase())) 868 | .toList(); 869 | if (filteredList.isEmpty) 870 | return _states; 871 | else 872 | return filteredList; 873 | } 874 | 875 | ///filter City Data according to user input 876 | Future> getCityData(filter) async { 877 | var filteredList = _cities 878 | .where((city) => city!.toLowerCase().contains(filter.toLowerCase())) 879 | .toList(); 880 | if (filteredList.isEmpty) 881 | return _cities; 882 | else 883 | return filteredList; 884 | } 885 | 886 | ///Country Dropdown Widget 887 | Widget countryDropdown() { 888 | return DropdownWithSearch( 889 | title: widget.countryDropdownLabel, 890 | placeHolder: widget.countrySearchPlaceholder, 891 | selectedItemStyle: widget.selectedItemStyle, 892 | dropdownHeadingStyle: widget.dropdownHeadingStyle, 893 | selectedItemPadding: widget.selectedItemPadding, 894 | itemStyle: widget.dropdownItemStyle, 895 | decoration: widget.dropdownDecoration, 896 | disabledDecoration: widget.disabledDropdownDecoration, 897 | disabled: _country.length == 0 || widget.disableCountry ? true : false, 898 | dialogRadius: widget.dropdownDialogRadius, 899 | searchBarRadius: widget.searchBarRadius, 900 | label: widget.countrySearchPlaceholder, 901 | items: _country.map((String? dropDownStringItem) { 902 | return dropDownStringItem; 903 | }).toList(), 904 | selected: _selectedCountry != null 905 | ? _selectedCountry 906 | : widget.countryDropdownLabel, 907 | //selected: _selectedCountry != null ? _selectedCountry : "Country", 908 | //onChanged: (value) => _onSelectedCountry(value), 909 | onChanged: (value) { 910 | print("countryChanged $value $_selectedCountry"); 911 | if (value != null) { 912 | _onSelectedCountry(value); 913 | } 914 | }, 915 | ); 916 | } 917 | 918 | ///State Dropdown Widget 919 | Widget stateDropdown() { 920 | return DropdownWithSearch( 921 | title: widget.stateDropdownLabel, 922 | placeHolder: widget.stateSearchPlaceholder, 923 | disabled: _states.length == 0 ? true : false, 924 | items: _states.map((String? dropDownStringItem) { 925 | return dropDownStringItem; 926 | }).toList(), 927 | selectedItemStyle: widget.selectedItemStyle, 928 | dropdownHeadingStyle: widget.dropdownHeadingStyle, 929 | itemStyle: widget.dropdownItemStyle, 930 | decoration: widget.dropdownDecoration, 931 | selectedItemPadding: widget.selectedItemPadding, 932 | dialogRadius: widget.dropdownDialogRadius, 933 | searchBarRadius: widget.searchBarRadius, 934 | disabledDecoration: widget.disabledDropdownDecoration, 935 | selected: _selectedState, 936 | label: widget.stateSearchPlaceholder, 937 | //onChanged: (value) => _onSelectedState(value), 938 | onChanged: (value) { 939 | //print("stateChanged $value $_selectedState"); 940 | value != null 941 | ? _onSelectedState(value) 942 | : _onSelectedState(_selectedState); 943 | }, 944 | ); 945 | } 946 | 947 | ///City Dropdown Widget 948 | Widget cityDropdown() { 949 | return DropdownWithSearch( 950 | title: widget.cityDropdownLabel, 951 | placeHolder: widget.citySearchPlaceholder, 952 | disabled: _cities.length == 0 ? true : false, 953 | items: _cities.map((String? dropDownStringItem) { 954 | return dropDownStringItem; 955 | }).toList(), 956 | selectedItemStyle: widget.selectedItemStyle, 957 | dropdownHeadingStyle: widget.dropdownHeadingStyle, 958 | itemStyle: widget.dropdownItemStyle, 959 | selectedItemPadding: widget.selectedItemPadding, 960 | decoration: widget.dropdownDecoration, 961 | dialogRadius: widget.dropdownDialogRadius, 962 | searchBarRadius: widget.searchBarRadius, 963 | disabledDecoration: widget.disabledDropdownDecoration, 964 | selected: _selectedCity, 965 | label: widget.citySearchPlaceholder, 966 | //onChanged: (value) => _onSelectedCity(value), 967 | onChanged: (value) { 968 | //print("cityChanged $value $_selectedCity"); 969 | value != null ? _onSelectedCity(value) : _onSelectedCity(_selectedCity); 970 | }, 971 | ); 972 | } 973 | } 974 | --------------------------------------------------------------------------------