├── test └── ir_datetime_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.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── RunnerTests │ │ └── RunnerTests.swift │ └── .gitignore ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ └── Icon-maskable-512.png │ ├── manifest.json │ └── index.html ├── 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 │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── build.gradle │ └── settings.gradle ├── assets │ └── fonts │ │ └── iransansmobile.ttf ├── README.md ├── .gitignore ├── test │ └── widget_test.dart ├── .metadata ├── analysis_options.yaml ├── pubspec.yaml ├── lib │ └── main.dart └── pubspec.lock ├── banner.png ├── analysis_options.yaml ├── lib ├── src │ ├── helpers │ │ ├── print.dart │ │ ├── responsive.dart │ │ ├── time.dart │ │ └── date.dart │ ├── ir_date_picker │ │ ├── ready_views │ │ │ ├── ir_jalali_date_picker_route.dart │ │ │ ├── ir_gregorian_date_picker_route.dart │ │ │ ├── ir_jalali_date_picker_dialog.dart │ │ │ └── ir_gregorian_date_picker_dialog.dart │ │ └── core │ │ │ ├── ir_jalali_date_picker.dart │ │ │ └── ir_gregorian_date_picker.dart │ └── ir_time_picker │ │ ├── ready_views │ │ └── ir_time_picker_dialog.dart │ │ └── core │ │ └── ir_time_picker.dart └── ir_datetime_picker.dart ├── .metadata ├── .gitignore ├── LICENSE ├── pubspec.yaml ├── CHANGELOG.md └── README.md /test/ir_datetime_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 | -------------------------------------------------------------------------------- /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/banner.png -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/example/web/favicon.png -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/assets/fonts/iransansmobile.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/example/assets/fonts/iransansmobile.ttf -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_picker/HEAD/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_picker/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_picker/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_picker/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_picker/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alikhajavi74/ir_datetime_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/alikhajavi74/ir_datetime_picker/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.example; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /lib/src/helpers/print.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | /// * [mPrint] just work in debug mode. 4 | 5 | void mPrint(Object object) { 6 | if (kDebugMode) { 7 | print(object); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /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/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: 097d3313d8e2c7f901932d63e537c1acefb87800 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /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 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /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/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | Example of IRDateTimePicker package. 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://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /.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 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 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 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | plugins { 14 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false 15 | } 16 | } 17 | 18 | include ":app" 19 | 20 | apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" 21 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/ir_datetime_picker.dart: -------------------------------------------------------------------------------- 1 | /// Export main libraries for development. 2 | /// You just need to import this library and use all the features of this package. 3 | library; 4 | 5 | // Dependencies: 6 | export 'package:shamsi_date/shamsi_date.dart'; 7 | // Helpers: 8 | export 'src/helpers/date.dart'; 9 | export 'src/helpers/time.dart'; 10 | // DatePicker: 11 | export 'src/ir_date_picker/core/ir_gregorian_date_picker.dart'; 12 | export 'src/ir_date_picker/core/ir_jalali_date_picker.dart'; 13 | export 'src/ir_date_picker/ready_views/ir_gregorian_date_picker_dialog.dart'; 14 | export 'src/ir_date_picker/ready_views/ir_gregorian_date_picker_route.dart'; 15 | export 'src/ir_date_picker/ready_views/ir_jalali_date_picker_dialog.dart'; 16 | export 'src/ir_date_picker/ready_views/ir_jalali_date_picker_route.dart'; 17 | // TimePicker: 18 | export 'src/ir_time_picker/core/ir_time_picker.dart'; 19 | export 'src/ir_time_picker/ready_views/ir_time_picker_dialog.dart'; 20 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "Example of IRDateTimePicker package.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ali Khajavi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 in the flutter_test package. 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(const 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 | -------------------------------------------------------------------------------- /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: "d211f42860350d914a5ad8102f9ec32764dc6d06" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 17 | base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 18 | - platform: android 19 | create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 20 | base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 21 | - platform: ios 22 | create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 23 | base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 24 | - platform: web 25 | create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 26 | base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 27 | 28 | # User provided section 29 | 30 | # List of Local paths (relative to this file) that should be 31 | # ignored by the migrate tool. 32 | # 33 | # Files that are not part of the templates will be ignored by default. 34 | unmanaged_files: 35 | - 'lib/main.dart' 36 | - 'ios/Runner.xcodeproj/project.pbxproj' 37 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /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/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: ir_datetime_picker 2 | description: Jalali (Persian - Farsi - Shamsi) date picker & Gregorian date picker & time picker all with cupertino style and responsive UI. 3 | version: 4.1.4 4 | repository: https://github.com/alikhajavi74/ir_datetime_picker 5 | 6 | environment: 7 | sdk: '>=3.4.0 <4.0.0' 8 | flutter: '>=1.17.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | shamsi_date: ^1.0.2 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | flutter_lints: ^4.0.0 20 | 21 | # For information on the generic Dart part of this file, see the 22 | # following page: https://dart.dev/tools/pub/pubspec 23 | 24 | # The following section is specific to Flutter. 25 | flutter: 26 | 27 | # To add assets to your package, add an assets section, like this: 28 | # assets: 29 | # - images/a_dot_burr.jpeg 30 | # - images/a_dot_ham.jpeg 31 | # 32 | # For details regarding assets in packages, see 33 | # https://flutter.dev/assets-and-images/#from-packages 34 | # 35 | # An image asset can refer to one or more resolution-specific "variants", see 36 | # https://flutter.dev/assets-and-images/#resolution-aware. 37 | 38 | # To add custom fonts to your package, add a fonts section here, 39 | # in this "flutter" section. Each entry in this list should have a 40 | # "family" key with the font family name, and a "fonts" key with a 41 | # list giving the asset and other descriptors for the font. For 42 | # example: 43 | # fonts: 44 | # - family: Schyler 45 | # fonts: 46 | # - asset: fonts/Schyler-Regular.ttf 47 | # - asset: fonts/Schyler-Italic.ttf 48 | # style: italic 49 | # - family: Trajan Pro 50 | # fonts: 51 | # - asset: fonts/TrajanPro.ttf 52 | # - asset: fonts/TrajanPro_Bold.ttf 53 | # weight: 700 54 | # 55 | # For details regarding fonts in packages, see 56 | # https://flutter.dev/custom-fonts/#from-packages 57 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | def localProperties = new Properties() 8 | def localPropertiesFile = rootProject.file('local.properties') 9 | if (localPropertiesFile.exists()) { 10 | localPropertiesFile.withReader('UTF-8') { reader -> 11 | localProperties.load(reader) 12 | } 13 | } 14 | 15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 16 | if (flutterVersionCode == null) { 17 | flutterVersionCode = '1' 18 | } 19 | 20 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 21 | if (flutterVersionName == null) { 22 | flutterVersionName = '1.0' 23 | } 24 | 25 | android { 26 | namespace "com.example.example" 27 | compileSdkVersion flutter.compileSdkVersion 28 | ndkVersion flutter.ndkVersion 29 | 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.example" 38 | // You can update the following values to match your application needs. 39 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 40 | minSdkVersion flutter.minSdkVersion 41 | targetSdkVersion flutter.targetSdkVersion 42 | versionCode flutterVersionCode.toInteger() 43 | versionName flutterVersionName 44 | } 45 | 46 | buildTypes { 47 | release { 48 | // TODO: Add your own signing config for the release build. 49 | // Signing with the debug keys for now, so `flutter run --release` works. 50 | signingConfig signingConfigs.debug 51 | } 52 | } 53 | } 54 | 55 | flutter { 56 | source '../..' 57 | } 58 | -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /lib/src/helpers/responsive.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // -------------------------------------------------------------------------------------------------------------------- 4 | 5 | // Responsive top level functions: 6 | 7 | /// * [mGetPercentOfWidth] get percent of width 8 | /// ```dart 9 | /// Eg getting 60% of user device width: 10 | /// mGetPercentOfWidth(context, 60.0); 11 | /// ``` 12 | 13 | double mGetPercentOfWidth(BuildContext context, num percent) { 14 | double deviceWidth = MediaQuery.of(context).size.width; 15 | if (deviceWidth > 450) { 16 | deviceWidth = 450; 17 | } 18 | return percent * (deviceWidth / 100.0); 19 | } 20 | 21 | /// * [mGetPercentOfHeight] get percent of height 22 | /// ```dart 23 | /// Eg getting 60% of user device height: 24 | /// mGetPercentOfHeight(context, 60.0); 25 | /// ``` 26 | double mGetPercentOfHeight(BuildContext context, num percent) { 27 | double deviceHeight = MediaQuery.of(context).size.height; 28 | return percent * (deviceHeight / 100.0); 29 | } 30 | 31 | /// * [mGetResponsiveFontSize] get responsive font according to user device sizes. 32 | /// ```dart 33 | /// Eg getting 15 sp font: 34 | /// mGetResponsiveFontSize(context, 15); 35 | /// ``` 36 | double mGetResponsiveFontSize(BuildContext context, num fontSize) { 37 | double deviceHeight = MediaQuery.of(context).size.height; 38 | return (fontSize / 720.0) * deviceHeight; 39 | } 40 | 41 | // -------------------------------------------------------------------------------------------------------------------- 42 | 43 | // Responsive extention: 44 | 45 | extension MResponsive on num { 46 | /// * [percentOfHeight] same as [mGetPercentOfHeight] 47 | double percentOfHeight(BuildContext context) { 48 | return mGetPercentOfHeight(context, this); 49 | } 50 | 51 | /// * [percentOfWidth] same as [mGetPercentOfWidth] 52 | double percentOfWidth(BuildContext context) { 53 | return mGetPercentOfWidth(context, this); 54 | } 55 | 56 | /// * [responsiveFont] same as [mGetResponsiveFontSize] 57 | double responsiveFont(BuildContext context) { 58 | return mGetResponsiveFontSize(context, this); 59 | } 60 | } 61 | 62 | // -------------------------------------------------------------------------------------------------------------------- 63 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/helpers/time.dart: -------------------------------------------------------------------------------- 1 | /// [IRTimeModel] used for working with time for example in IRTimePicker when you choose your time you will take an IRTimeModel? object. 2 | /// use [IRTimeModel.fromDuration] for get [IRTimeModel] from your [Duration] object. 3 | /// use [IRTimeModel.fromString] for get [IRTimeModel] from String which must have a standard format. (e.g => 20:57:23 or 20:57) 4 | /// use [toDuration] for convert [IRTimeModel] to [Duration] object. 5 | /// use [toString] for convert [IRTimeModel] to String object. 6 | class IRTimeModel { 7 | int day; 8 | int hour; 9 | int minute; 10 | int second; 11 | 12 | IRTimeModel( 13 | {this.day = 0, required this.hour, required this.minute, this.second = 0}) 14 | : assert(0 <= hour && hour <= 23, "hour is not valid"), 15 | assert(0 <= minute && minute <= 59, "minute is not valid"), 16 | assert(0 <= second && second <= 59, "second is not valid"); 17 | 18 | factory IRTimeModel.fromDuration(Duration duration) { 19 | List splitted = duration.toString().split(":"); 20 | int hour = int.parse(splitted[0]); 21 | int minute = int.parse(splitted[1]); 22 | int second = num.parse(splitted[2]).toInt(); 23 | if (24 <= hour) { 24 | return IRTimeModel( 25 | day: (hour ~/ 24), hour: (hour % 24), minute: minute, second: second); 26 | } 27 | return IRTimeModel(hour: hour, minute: minute, second: second); 28 | } 29 | 30 | /// NOTE: [IRTimeModel.fromString] does not work with the day! 31 | factory IRTimeModel.fromString(String string) { 32 | List splitted = string.split(":"); 33 | if (splitted.length == 3) { 34 | return IRTimeModel( 35 | hour: int.parse(splitted[0]), 36 | minute: int.parse(splitted[1]), 37 | second: int.parse(splitted[2])); 38 | } 39 | return IRTimeModel( 40 | hour: int.parse(splitted[0]), minute: int.parse(splitted[1])); 41 | } 42 | 43 | Duration toDuration() { 44 | return Duration(days: day, hours: hour, minutes: minute, seconds: second); 45 | } 46 | 47 | /// Use [showSecond] to show seconds in your string time. 48 | /// NOTE: [toString] does not show the day! 49 | @override 50 | String toString({bool showSecond = false}) { 51 | StringBuffer stringBuffer = StringBuffer(); 52 | stringBuffer.write( 53 | "${hour.toString().padLeft(2, "0")}:${minute.toString().padLeft(2, "0")}"); 54 | if (showSecond) { 55 | stringBuffer.write(":${second.toString().padLeft(2, "0")}"); 56 | } 57 | return stringBuffer.toString(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 4.1.4 2 | 3 | * Update dart and flutter 4 | * Add day to IRTimeModel 5 | * change withoutSecond to showSecond in toString() for IRTimeModel objects 6 | * Update example 7 | * Update README 8 | 9 | ## 4.1.3 10 | 11 | * Update dart and flutter 12 | * Add constructor IRTimeModel.fromString() for IRTimeModel 13 | * Add withoutSecond to toString() for IRTimeModel objects 14 | 15 | ## 4.1.2 16 | 17 | * Add visibleSecondsPicker field to IRTimePicker 18 | * Update README 19 | 20 | ## 4.1.1 21 | 22 | * Format code 23 | 24 | ## 4.1.0 25 | 26 | * Add seconds picker to IRTimePicker 27 | * Update IRTimeModel 28 | * Make some optimization 29 | 30 | ## 4.0.6 31 | 32 | * Update documents 33 | * Make some optimizations 34 | 35 | ## 4.0.5 36 | 37 | * Add initialTime to IRTimePicker 38 | * Add visible/invisible for now/today buttons in ready widgets 39 | * Update example 40 | * Update README 41 | 42 | ## 4.0.4 43 | 44 | * Format code 45 | 46 | ## 4.0.3 47 | 48 | * Add visible/invisible for now/today buttons in core widgets 49 | * Add constraints for core widgets 50 | * Update example 51 | * Update README 52 | 53 | ## 4.0.2 54 | 55 | * Update README 56 | 57 | ## 4.0.1 58 | 59 | * Update README 60 | 61 | ## 4.0.0 62 | 63 | * Breaking change 64 | * Add IRGregorianDatePicker 65 | * Some changes in UI 66 | * Add some features for customization UI 67 | * Clean and optimization code 68 | * Update dart and flutter 69 | * Update example 70 | * Update demo screen 71 | * Update README 72 | * Fix responsive bug in Web or Tablet 73 | 74 | ## 3.0.3 75 | 76 | * Optimization & resolve some issues 77 | 78 | ## 3.0.2 79 | 80 | * Update project 81 | 82 | ## 3.0.1 83 | 84 | * Resolve some bugs 85 | 86 | ## 3.0.0 87 | 88 | * Add IRTimePicker 89 | * Add document 90 | * Change example and README.md 91 | 92 | ## 2.0.3 93 | 94 | * Change example and README.md 95 | 96 | ## 2.0.2 97 | 98 | * Add TodayButton 99 | * Change example and README.md 100 | * Resolve some bugs 101 | 102 | ## 2.0.1 103 | 104 | * Add IRDatePickerResponsiveDialog and its utils 105 | * Change example and README.md 106 | * Resolve some bugs 107 | 108 | ## 1.1.1 109 | 110 | * Resolve some bugs 111 | 112 | ## 1.1.0 113 | 114 | * Add example project 115 | * Make responsive IRDatePicker 116 | 117 | ## 1.0.2 118 | 119 | * Update README.md 120 | 121 | ## 1.0.1 122 | 123 | * Update README.md 124 | 125 | ## 1.0.0 126 | 127 | * Add IRDateTimePicker 128 | * Optimization and resolve some bugs 129 | 130 | ## 0.0.2 131 | 132 | * Change License. 133 | 134 | ## 0.0.1 135 | 136 | * Start project. -------------------------------------------------------------------------------- /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: Example of IRDateTimePicker package. 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=3.4.0 <4.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | 34 | flutter_localizations: 35 | sdk: flutter 36 | 37 | ir_datetime_picker: 38 | path: ../ 39 | 40 | 41 | # The following adds the Cupertino Icons font to your application. 42 | # Use with the CupertinoIcons class for iOS style icons. 43 | cupertino_icons: ^1.0.8 44 | 45 | dev_dependencies: 46 | flutter_test: 47 | sdk: flutter 48 | 49 | # The "flutter_lints" package below contains a set of recommended lints to 50 | # encourage good coding practices. The lint set provided by the package is 51 | # activated in the `analysis_options.yaml` file located at the root of your 52 | # package. See that file for information about deactivating specific lint 53 | # rules and activating additional ones. 54 | flutter_lints: ^4.0.0 55 | 56 | # For information on the generic Dart part of this file, see the 57 | # following page: https://dart.dev/tools/pub/pubspec 58 | 59 | # The following section is specific to Flutter packages. 60 | flutter: 61 | 62 | # The following line ensures that the Material Icons font is 63 | # included with your application, so that you can use the icons in 64 | # the material Icons class. 65 | uses-material-design: true 66 | 67 | # To add assets to your application, add an assets section, like this: 68 | assets: 69 | - assets/images/ 70 | - assets/fonts/ 71 | 72 | # An image asset can refer to one or more resolution-specific "variants", see 73 | # https://flutter.dev/assets-and-images/#resolution-aware 74 | 75 | # For details regarding adding assets from package dependencies, see 76 | # https://flutter.dev/assets-and-images/#from-packages 77 | 78 | # To add custom fonts to your application, add a fonts section here, 79 | # in this "flutter" section. Each entry in this list should have a 80 | # "family" key with the font family name, and a "fonts" key with a 81 | # list giving the asset and other descriptors for the font. For 82 | # example: 83 | fonts: 84 | - family: IranSans 85 | fonts: 86 | - asset: assets/fonts/iransansmobile.ttf 87 | # 88 | # For details regarding fonts from package dependencies, 89 | # see https://flutter.dev/custom-fonts/#from-packages 90 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jalali date picker - Gregorian date picker - Time picker 2 | 3 | Jalali (Persian - Farsi - Shamsi) date picker & Gregorian date picker & Time picker all with cupertino style and responsive UI. 4 | 5 | [![Version](https://img.shields.io/pub/v/ir_datetime_picker?color=007AFF)](https://pub.dev/packages/ir_datetime_picker) 6 | ![Platform](https://img.shields.io/badge/platform-android%20%7C%20ios%20%7C%20web-brightgreen) 7 | 8 | ## Banner 9 | 10 | ![IRDateTimePicker Banner](https://github.com/alikhajavi74/ir_datetime_picker/raw/master/banner.png) 11 | 12 | 13 | ## Usage 14 | 15 | Step1: add dependency to your pubspec.yaml: 16 | 17 | ```yaml 18 | 19 | dependencies: 20 | ir_datetime_picker: version 21 | 22 | ``` 23 | 24 | Step2: import library: 25 | 26 | ```dart 27 | 28 | import 'package:ir_datetime_picker/ir_datetime_picker.dart'; 29 | 30 | ``` 31 | 32 | Step3: check exmaple to use: 33 | 34 | ```dart 35 | 36 | // Simple jalali date picker using top level functions showIRJalaliDatePickerDialog or showIRJalaliDatePickerRoute: 37 | // NOTE: For create your own JalaliDatePicker use IRJalaliDatePicker widget. 38 | ElevatedButton( 39 | child: const Text("انتخاب تاریخ"), 40 | onPressed: () async { 41 | Jalali? selectedDate = await showIRJalaliDatePickerDialog( 42 | context: context, 43 | title: "انتخاب تاریخ", 44 | visibleTodayButton: true, 45 | todayButtonText: "انتخاب امروز", 46 | confirmButtonText: "تایید", 47 | initialDate: Jalali(1400, 4, 2), 48 | ); 49 | if (selectedDate != null) { 50 | setState(() { 51 | _jalaliDate = "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}"; 52 | }); 53 | } 54 | }, 55 | ), 56 | 57 | 58 | // Simple gregorian date picker using top level functions showIRGregorianDatePickerDialog or showIRGregorianDatePickerRoute: 59 | // NOTE: For create your own GregorianDatePicker use IRGregorianDatePicker widget. 60 | ElevatedButton( 61 | child: const Text("انتخاب تاریخ"), 62 | onPressed: () async { 63 | Gregorian? selectedDate = await showIRGregorianDatePickerDialog( 64 | context: context, 65 | title: "انتخاب تاریخ", 66 | visibleTodayButton: true, 67 | todayButtonText: "انتخاب امروز", 68 | confirmButtonText: "تایید", 69 | initialDate: Gregorian(2020, 7, 15), 70 | ); 71 | if (selectedDate != null) { 72 | setState(() { 73 | _gregorianDate = "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}"; 74 | }); 75 | } 76 | }, 77 | ), 78 | 79 | 80 | // Simple time picker using top level function showIRTimePickerDialog: 81 | // NOTE: For create your own TimePicker use IRTimePicker widget. 82 | ElevatedButton( 83 | child: const Text("انتخاب زمان"), 84 | onPressed: () async { 85 | IRTimeModel? selectedTime = await showIRTimePickerDialog( 86 | context: context, 87 | initialTime: IRTimeModel(hour: 18, minute: 45, second: 59), 88 | title: "انتخاب زمان", 89 | visibleSecondsPicker: true, 90 | visibleNowButton: true, 91 | nowButtonText: "انتخاب اکنون", 92 | confirmButtonText: "تایید", 93 | ); 94 | if (selectedTime != null) { 95 | setState(() { 96 | _time = selectedTime.toString(showSecond: true); 97 | Duration durationTime = selectedTime.toDuration(); 98 | if (kDebugMode) print('Duration: ${durationTime.toString()}'); 99 | if (kDebugMode) print('IRTimeModel: ${IRTimeModel.fromDuration(durationTime).toString(showSecond: true)}'); 100 | }); 101 | } 102 | }, 103 | ), 104 | 105 | 106 | // You can create your own date picker with IRJalaliDatePicker or IRGregorianDatePicker widgets: 107 | Container( 108 | color: Colors.green.withOpacity(0.1), 109 | child: IRJalaliDatePicker( 110 | initialDate: Jalali(1400, 1, 3), 111 | minYear: 1390, 112 | maxYear: 1420, 113 | visibleTodayButton: true, 114 | todayButtonText: "انتخاب اکنون", 115 | constraints: const BoxConstraints.tightFor(width: 400, height: 200), 116 | onSelected: (Jalali date) { 117 | if (kDebugMode) print(date.toString()); 118 | }, 119 | ), 120 | ), 121 | 122 | ``` 123 | 124 | ## Support 125 | 126 | If you have any issues or questions, please don't hesitate to reach out to us at Alikhajavi74@gmail.com 127 | 128 | https://github.com/alikhajavi74 -------------------------------------------------------------------------------- /lib/src/ir_date_picker/ready_views/ir_jalali_date_picker_route.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 3 | import 'package:ir_datetime_picker/src/ir_date_picker/core/ir_jalali_date_picker.dart'; 4 | import 'package:shamsi_date/shamsi_date.dart'; 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | 8 | /// * [IRJalaliDatePickerResponsiveRoute] is a ready responsive route widget that used with [showIRJalaliDatePickerRoute] top function. 9 | 10 | class IRJalaliDatePickerResponsiveRoute extends StatelessWidget { 11 | final Jalali? initialDate; 12 | final int? minYear; 13 | final int? maxYear; 14 | final String title; 15 | final bool visibleTodayButton; 16 | final String todayButtonText; 17 | final String confirmButtonText; 18 | 19 | const IRJalaliDatePickerResponsiveRoute({ 20 | super.key, 21 | this.initialDate, 22 | this.minYear, 23 | this.maxYear, 24 | required this.title, 25 | this.visibleTodayButton = true, 26 | required this.todayButtonText, 27 | required this.confirmButtonText, 28 | }); 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | final ThemeData themeData = Theme.of(context); 33 | Jalali selectedDate = initialDate ?? Jalali.now(); 34 | Widget backButton = IconButton( 35 | iconSize: 7.5.percentOfWidth(context), 36 | icon: const Icon(Icons.close), 37 | onPressed: () { 38 | Navigator.pop(context, null); 39 | }, 40 | ); 41 | Widget titleText = Text( 42 | title, 43 | style: Theme.of(context).textTheme.titleLarge?.copyWith( 44 | fontSize: 22.0.responsiveFont(context), fontWeight: FontWeight.w700), 45 | ); 46 | Widget datePicker = IRJalaliDatePicker( 47 | initialDate: initialDate, 48 | minYear: minYear, 49 | maxYear: maxYear, 50 | visibleTodayButton: visibleTodayButton, 51 | todayButtonText: todayButtonText, 52 | onSelected: (Jalali jalaliDate) { 53 | selectedDate = jalaliDate; 54 | }, 55 | ); 56 | Widget confirmButton = ConstrainedBox( 57 | constraints: BoxConstraints.tightFor( 58 | width: 50.0.percentOfWidth(context), 59 | height: 6.0.percentOfHeight(context)), 60 | child: ElevatedButton( 61 | style: ElevatedButton.styleFrom( 62 | backgroundColor: themeData.primaryColor, 63 | elevation: 6.0, 64 | shadowColor: Colors.black38, 65 | shape: 66 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)), 67 | ), 68 | child: Text( 69 | confirmButtonText, 70 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 71 | fontSize: 14.0.responsiveFont(context), 72 | fontWeight: FontWeight.w600, 73 | color: Colors.white), 74 | ), 75 | onPressed: () => Navigator.pop(context, selectedDate), 76 | ), 77 | ); 78 | return Scaffold( 79 | body: SafeArea( 80 | child: Center( 81 | child: ConstrainedBox( 82 | constraints: BoxConstraints(maxWidth: 100.percentOfWidth(context)), 83 | child: Column( 84 | children: [ 85 | const SizedBox(width: double.infinity), 86 | Align( 87 | alignment: Alignment.topRight, 88 | child: backButton, 89 | ), 90 | SizedBox(height: 2.0.percentOfHeight(context)), 91 | titleText, 92 | SizedBox(height: 10.0.percentOfHeight(context)), 93 | datePicker, 94 | const Spacer(), 95 | confirmButton, 96 | SizedBox(height: 6.0.percentOfHeight(context)), 97 | ], 98 | ), 99 | ), 100 | ), 101 | ), 102 | ); 103 | } 104 | } 105 | 106 | // -------------------------------------------------------------------------------------------------------------------- 107 | 108 | /// * [showIRJalaliDatePickerRoute] show a dialog with [IRJalaliDatePickerResponsiveRoute] widget. 109 | 110 | Future showIRJalaliDatePickerRoute( 111 | {required BuildContext context, 112 | Jalali? initialDate, 113 | int? minYear, 114 | int? maxYear, 115 | required String title, 116 | bool visibleTodayButton = true, 117 | required String todayButtonText, 118 | required String confirmButtonText}) async { 119 | Jalali? jalaliDate = await Navigator.of(context).push( 120 | MaterialPageRoute( 121 | builder: (BuildContext buildContext) => IRJalaliDatePickerResponsiveRoute( 122 | initialDate: initialDate, 123 | minYear: minYear, 124 | maxYear: maxYear, 125 | title: title, 126 | visibleTodayButton: visibleTodayButton, 127 | todayButtonText: todayButtonText, 128 | confirmButtonText: confirmButtonText, 129 | ), 130 | ), 131 | ); 132 | return jalaliDate; 133 | } 134 | 135 | // -------------------------------------------------------------------------------------------------------------------- 136 | -------------------------------------------------------------------------------- /lib/src/ir_date_picker/ready_views/ir_gregorian_date_picker_route.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 3 | import 'package:ir_datetime_picker/src/ir_date_picker/core/ir_gregorian_date_picker.dart'; 4 | import 'package:shamsi_date/shamsi_date.dart'; 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | 8 | /// * [IRGregorianDatePickerResponsiveRoute] is a ready responsive route widget that used with [showIRGregorianDatePickerRoute] top function. 9 | 10 | class IRGregorianDatePickerResponsiveRoute extends StatelessWidget { 11 | final Gregorian? initialDate; 12 | final int? minYear; 13 | final int? maxYear; 14 | final String title; 15 | final bool visibleTodayButton; 16 | final String todayButtonText; 17 | final String confirmButtonText; 18 | 19 | const IRGregorianDatePickerResponsiveRoute({ 20 | super.key, 21 | this.initialDate, 22 | this.minYear, 23 | this.maxYear, 24 | required this.title, 25 | this.visibleTodayButton = true, 26 | required this.todayButtonText, 27 | required this.confirmButtonText, 28 | }); 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | final ThemeData themeData = Theme.of(context); 33 | Gregorian selectedDate = initialDate ?? Gregorian.now(); 34 | Widget backButton = IconButton( 35 | iconSize: 7.5.percentOfWidth(context), 36 | icon: const Icon(Icons.close), 37 | onPressed: () { 38 | Navigator.pop(context, null); 39 | }, 40 | ); 41 | Widget titleText = Text( 42 | title, 43 | style: Theme.of(context).textTheme.titleLarge?.copyWith( 44 | fontSize: 22.0.responsiveFont(context), fontWeight: FontWeight.w700), 45 | ); 46 | Widget datePicker = IRGregorianDatePicker( 47 | initialDate: initialDate, 48 | minYear: minYear, 49 | maxYear: maxYear, 50 | visibleTodayButton: visibleTodayButton, 51 | todayButtonText: todayButtonText, 52 | onSelected: (Gregorian gregorianDate) { 53 | selectedDate = gregorianDate; 54 | }, 55 | ); 56 | Widget confirmButton = ConstrainedBox( 57 | constraints: BoxConstraints.tightFor( 58 | width: 50.0.percentOfWidth(context), 59 | height: 6.0.percentOfHeight(context)), 60 | child: ElevatedButton( 61 | style: ElevatedButton.styleFrom( 62 | backgroundColor: themeData.primaryColor, 63 | elevation: 6.0, 64 | shadowColor: Colors.black38, 65 | shape: 66 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)), 67 | ), 68 | child: Text( 69 | confirmButtonText, 70 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 71 | fontSize: 14.0.responsiveFont(context), 72 | fontWeight: FontWeight.w600, 73 | color: Colors.white), 74 | ), 75 | onPressed: () => Navigator.pop(context, selectedDate), 76 | ), 77 | ); 78 | return Scaffold( 79 | body: SafeArea( 80 | child: Center( 81 | child: ConstrainedBox( 82 | constraints: BoxConstraints(maxWidth: 100.percentOfWidth(context)), 83 | child: Column( 84 | children: [ 85 | const SizedBox(width: double.infinity), 86 | Align( 87 | alignment: Alignment.topRight, 88 | child: backButton, 89 | ), 90 | SizedBox(height: 2.0.percentOfHeight(context)), 91 | titleText, 92 | SizedBox(height: 10.0.percentOfHeight(context)), 93 | datePicker, 94 | const Spacer(), 95 | confirmButton, 96 | SizedBox(height: 6.0.percentOfHeight(context)), 97 | ], 98 | ), 99 | ), 100 | ), 101 | ), 102 | ); 103 | } 104 | } 105 | 106 | // -------------------------------------------------------------------------------------------------------------------- 107 | 108 | /// * [showIRGregorianDatePickerRoute] show a dialog with [IRGregorianDatePickerResponsiveRoute] widget. 109 | 110 | Future showIRGregorianDatePickerRoute( 111 | {required BuildContext context, 112 | Gregorian? initialDate, 113 | int? minYear, 114 | int? maxYear, 115 | required String title, 116 | bool visibleTodayButton = true, 117 | required String todayButtonText, 118 | required String confirmButtonText}) async { 119 | Gregorian? gregorianDate = await Navigator.of(context).push( 120 | MaterialPageRoute( 121 | builder: (BuildContext buildContext) => 122 | IRGregorianDatePickerResponsiveRoute( 123 | initialDate: initialDate, 124 | minYear: minYear, 125 | maxYear: maxYear, 126 | title: title, 127 | visibleTodayButton: visibleTodayButton, 128 | todayButtonText: todayButtonText, 129 | confirmButtonText: confirmButtonText, 130 | ), 131 | ), 132 | ); 133 | return gregorianDate; 134 | } 135 | 136 | // -------------------------------------------------------------------------------------------------------------------- 137 | -------------------------------------------------------------------------------- /lib/src/ir_time_picker/ready_views/ir_time_picker_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 3 | import 'package:ir_datetime_picker/src/helpers/time.dart'; 4 | import 'package:ir_datetime_picker/src/ir_time_picker/core/ir_time_picker.dart'; 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | 8 | /// * [IRTimePickerResponsiveDialog] is a ready responsive dialog widget that used with [showIRTimePickerDialog] top function. 9 | 10 | class IRTimePickerResponsiveDialog extends StatelessWidget { 11 | final IRTimeModel? initialTime; 12 | final String title; 13 | final bool visibleSecondsPicker; 14 | final bool visibleNowButton; 15 | final String nowButtonText; 16 | final String confirmButtonText; 17 | 18 | const IRTimePickerResponsiveDialog({ 19 | super.key, 20 | this.initialTime, 21 | required this.title, 22 | this.visibleSecondsPicker = true, 23 | this.visibleNowButton = true, 24 | required this.nowButtonText, 25 | required this.confirmButtonText, 26 | }); 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | final ThemeData themeData = Theme.of(context); 31 | DateTime now = DateTime.now(); 32 | IRTimeModel selectedTime = IRTimeModel(hour: now.hour, minute: now.minute); 33 | Widget backButton = IconButton( 34 | iconSize: 7.0.percentOfWidth(context), 35 | icon: const Icon(Icons.close), 36 | onPressed: () { 37 | Navigator.pop(context, null); 38 | }, 39 | ); 40 | Widget titleText = Text( 41 | title, 42 | style: Theme.of(context).textTheme.titleLarge?.copyWith( 43 | fontSize: 22.0.responsiveFont(context), fontWeight: FontWeight.w700), 44 | ); 45 | Widget timePicker = IRTimePicker( 46 | initialTime: initialTime, 47 | visibleSecondsPicker: visibleSecondsPicker, 48 | visibleNowButton: visibleNowButton, 49 | nowButtonText: nowButtonText, 50 | onSelected: (IRTimeModel time) { 51 | selectedTime = time; 52 | }, 53 | ); 54 | Widget submitButton = ConstrainedBox( 55 | constraints: BoxConstraints.tightFor( 56 | width: 50.0.percentOfWidth(context), 57 | height: 6.0.percentOfHeight(context)), 58 | child: ElevatedButton( 59 | style: ElevatedButton.styleFrom( 60 | backgroundColor: themeData.primaryColor, 61 | elevation: 6.0, 62 | shadowColor: Colors.black38, 63 | shape: 64 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)), 65 | ), 66 | child: Text( 67 | confirmButtonText, 68 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 69 | fontSize: 14.0.responsiveFont(context), 70 | fontWeight: FontWeight.w600, 71 | color: Colors.white), 72 | ), 73 | onPressed: () { 74 | Navigator.pop(context, selectedTime); 75 | }, 76 | ), 77 | ); 78 | return ConstrainedBox( 79 | constraints: BoxConstraints.tightFor( 80 | width: 90.0.percentOfWidth(context), 81 | height: 65.0.percentOfHeight(context), 82 | ), 83 | child: Material( 84 | borderRadius: BorderRadius.circular(15.0), 85 | color: Colors.white, 86 | elevation: 6.0, 87 | shadowColor: Colors.black38, 88 | child: Center( 89 | child: Column( 90 | mainAxisSize: MainAxisSize.min, 91 | children: [ 92 | const SizedBox(width: double.infinity), 93 | Align( 94 | alignment: Alignment.topRight, 95 | child: backButton, 96 | ), 97 | SizedBox(height: 1.5.percentOfHeight(context)), 98 | titleText, 99 | SizedBox(height: 1.5.percentOfHeight(context)), 100 | timePicker, 101 | const Spacer(), 102 | submitButton, 103 | SizedBox(height: 4.0.percentOfHeight(context)), 104 | ], 105 | ), 106 | ), 107 | ), 108 | ); 109 | } 110 | } 111 | 112 | // -------------------------------------------------------------------------------------------------------------------- 113 | 114 | /// * [showIRTimePickerDialog] show a dialog with [IRTimePickerResponsiveDialog] widget. 115 | 116 | Future showIRTimePickerDialog( 117 | {required BuildContext context, 118 | IRTimeModel? initialTime, 119 | String? title, 120 | bool visibleSecondsPicker = true, 121 | bool visibleNowButton = true, 122 | String? nowButtonText, 123 | String? confirmButtonText}) async { 124 | IRTimeModel? time = await showDialog( 125 | context: context, 126 | builder: (BuildContext buildContext) => Scaffold( 127 | backgroundColor: Colors.grey.withOpacity(0.4), 128 | body: Center( 129 | child: IRTimePickerResponsiveDialog( 130 | initialTime: initialTime, 131 | title: title ?? "انتخاب زمان", 132 | visibleSecondsPicker: visibleSecondsPicker, 133 | visibleNowButton: visibleNowButton, 134 | nowButtonText: nowButtonText ?? "انتخاب اکنون", 135 | confirmButtonText: confirmButtonText ?? "تایید", 136 | ), 137 | ), 138 | ), 139 | ); 140 | return time; 141 | } 142 | 143 | // -------------------------------------------------------------------------------------------------------------------- 144 | -------------------------------------------------------------------------------- /lib/src/ir_date_picker/ready_views/ir_jalali_date_picker_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 3 | import 'package:ir_datetime_picker/src/ir_date_picker/core/ir_jalali_date_picker.dart'; 4 | import 'package:shamsi_date/shamsi_date.dart'; 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | 8 | /// * [IRJalaliDatePickerResponsiveDialog] is a ready responsive dialog widget that used with [showIRJalaliDatePickerDialog] top function. 9 | 10 | class IRJalaliDatePickerResponsiveDialog extends StatelessWidget { 11 | final Jalali? initialDate; 12 | final int? minYear; 13 | final int? maxYear; 14 | final String title; 15 | final bool visibleTodayButton; 16 | final String todayButtonText; 17 | final String confirmButtonText; 18 | 19 | const IRJalaliDatePickerResponsiveDialog({ 20 | super.key, 21 | this.initialDate, 22 | this.minYear, 23 | this.maxYear, 24 | required this.title, 25 | this.visibleTodayButton = true, 26 | required this.todayButtonText, 27 | required this.confirmButtonText, 28 | }); 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | final ThemeData themeData = Theme.of(context); 33 | Jalali selectedDate = initialDate ?? Jalali.now(); 34 | Widget backButton = IconButton( 35 | iconSize: 7.0.percentOfWidth(context), 36 | icon: const Icon(Icons.close), 37 | onPressed: () { 38 | Navigator.pop(context, null); 39 | }, 40 | ); 41 | Widget titleText = Text( 42 | title, 43 | style: Theme.of(context).textTheme.titleLarge?.copyWith( 44 | fontSize: 22.0.responsiveFont(context), fontWeight: FontWeight.w700), 45 | ); 46 | Widget datePicker = IRJalaliDatePicker( 47 | initialDate: initialDate, 48 | minYear: minYear, 49 | maxYear: maxYear, 50 | visibleTodayButton: visibleTodayButton, 51 | todayButtonText: todayButtonText, 52 | onSelected: (Jalali jalaliDate) { 53 | selectedDate = jalaliDate; 54 | }, 55 | ); 56 | Widget confirmButton = ConstrainedBox( 57 | constraints: BoxConstraints.tightFor( 58 | width: 50.0.percentOfWidth(context), 59 | height: 6.0.percentOfHeight(context)), 60 | child: ElevatedButton( 61 | style: ElevatedButton.styleFrom( 62 | backgroundColor: themeData.primaryColor, 63 | elevation: 6.0, 64 | shadowColor: Colors.black38, 65 | shape: 66 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)), 67 | ), 68 | child: Text( 69 | confirmButtonText, 70 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 71 | fontSize: 14.0.responsiveFont(context), 72 | fontWeight: FontWeight.w600, 73 | color: Colors.white), 74 | ), 75 | onPressed: () => Navigator.pop(context, selectedDate), 76 | ), 77 | ); 78 | return ConstrainedBox( 79 | constraints: BoxConstraints.tightFor( 80 | width: 90.0.percentOfWidth(context), 81 | height: 65.0.percentOfHeight(context), 82 | ), 83 | child: Material( 84 | borderRadius: BorderRadius.circular(15.0), 85 | color: Colors.white, 86 | elevation: 6.0, 87 | shadowColor: Colors.black38, 88 | child: Center( 89 | child: Column( 90 | mainAxisSize: MainAxisSize.min, 91 | children: [ 92 | const SizedBox(width: double.infinity), 93 | Align( 94 | alignment: Alignment.topRight, 95 | child: backButton, 96 | ), 97 | SizedBox(height: 1.5.percentOfHeight(context)), 98 | titleText, 99 | SizedBox(height: 1.5.percentOfHeight(context)), 100 | datePicker, 101 | const Spacer(), 102 | confirmButton, 103 | SizedBox(height: 4.0.percentOfHeight(context)), 104 | ], 105 | ), 106 | ), 107 | ), 108 | ); 109 | } 110 | } 111 | 112 | // -------------------------------------------------------------------------------------------------------------------- 113 | 114 | /// * [showIRJalaliDatePickerDialog] show a dialog with [IRJalaliDatePickerResponsiveDialog] widget. 115 | 116 | Future showIRJalaliDatePickerDialog( 117 | {required BuildContext context, 118 | Jalali? initialDate, 119 | int? minYear, 120 | int? maxYear, 121 | required String title, 122 | bool visibleTodayButton = true, 123 | required String todayButtonText, 124 | required String confirmButtonText}) async { 125 | Jalali? jalaliDate = await showDialog( 126 | context: context, 127 | builder: (BuildContext buildContext) => Scaffold( 128 | backgroundColor: Colors.grey.withOpacity(0.4), 129 | body: Center( 130 | child: IRJalaliDatePickerResponsiveDialog( 131 | initialDate: initialDate, 132 | minYear: minYear, 133 | maxYear: maxYear, 134 | title: title, 135 | visibleTodayButton: visibleTodayButton, 136 | todayButtonText: todayButtonText, 137 | confirmButtonText: confirmButtonText, 138 | ), 139 | ), 140 | ), 141 | ); 142 | return jalaliDate; 143 | } 144 | 145 | // -------------------------------------------------------------------------------------------------------------------- 146 | -------------------------------------------------------------------------------- /lib/src/ir_date_picker/ready_views/ir_gregorian_date_picker_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 3 | import 'package:ir_datetime_picker/src/ir_date_picker/core/ir_gregorian_date_picker.dart'; 4 | import 'package:shamsi_date/shamsi_date.dart'; 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | 8 | /// * [IRGregorianDatePickerResponsiveDialog] is a ready responsive dialog widget that used with [showIRGregorianDatePickerDialog] top function. 9 | 10 | class IRGregorianDatePickerResponsiveDialog extends StatelessWidget { 11 | final Gregorian? initialDate; 12 | final int? minYear; 13 | final int? maxYear; 14 | final String title; 15 | final bool visibleTodayButton; 16 | final String todayButtonText; 17 | final String confirmButtonText; 18 | 19 | const IRGregorianDatePickerResponsiveDialog({ 20 | super.key, 21 | this.initialDate, 22 | this.minYear, 23 | this.maxYear, 24 | required this.title, 25 | this.visibleTodayButton = true, 26 | required this.todayButtonText, 27 | required this.confirmButtonText, 28 | }); 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | final ThemeData themeData = Theme.of(context); 33 | Gregorian selectedDate = initialDate ?? Gregorian.now(); 34 | Widget backButton = IconButton( 35 | iconSize: 7.0.percentOfWidth(context), 36 | icon: const Icon(Icons.close), 37 | onPressed: () { 38 | Navigator.pop(context, null); 39 | }, 40 | ); 41 | Widget titleText = Text( 42 | title, 43 | style: Theme.of(context).textTheme.titleLarge?.copyWith( 44 | fontSize: 22.0.responsiveFont(context), fontWeight: FontWeight.w700), 45 | ); 46 | Widget datePicker = IRGregorianDatePicker( 47 | initialDate: initialDate, 48 | minYear: minYear, 49 | maxYear: maxYear, 50 | visibleTodayButton: visibleTodayButton, 51 | todayButtonText: todayButtonText, 52 | onSelected: (Gregorian gregorianDate) { 53 | selectedDate = gregorianDate; 54 | }, 55 | ); 56 | Widget confirmButton = ConstrainedBox( 57 | constraints: BoxConstraints.tightFor( 58 | width: 50.0.percentOfWidth(context), 59 | height: 6.0.percentOfHeight(context)), 60 | child: ElevatedButton( 61 | style: ElevatedButton.styleFrom( 62 | backgroundColor: themeData.primaryColor, 63 | elevation: 6.0, 64 | shadowColor: Colors.black38, 65 | shape: 66 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)), 67 | ), 68 | child: Text( 69 | confirmButtonText, 70 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 71 | fontSize: 14.0.responsiveFont(context), 72 | fontWeight: FontWeight.w600, 73 | color: Colors.white), 74 | ), 75 | onPressed: () => Navigator.pop(context, selectedDate), 76 | ), 77 | ); 78 | return ConstrainedBox( 79 | constraints: BoxConstraints.tightFor( 80 | width: 90.0.percentOfWidth(context), 81 | height: 65.0.percentOfHeight(context), 82 | ), 83 | child: Material( 84 | borderRadius: BorderRadius.circular(15.0), 85 | color: Colors.white, 86 | elevation: 6.0, 87 | shadowColor: Colors.black38, 88 | child: Center( 89 | child: Column( 90 | mainAxisSize: MainAxisSize.min, 91 | children: [ 92 | const SizedBox(width: double.infinity), 93 | Align( 94 | alignment: Alignment.topRight, 95 | child: backButton, 96 | ), 97 | SizedBox(height: 1.5.percentOfHeight(context)), 98 | titleText, 99 | SizedBox(height: 1.5.percentOfHeight(context)), 100 | datePicker, 101 | const Spacer(), 102 | confirmButton, 103 | SizedBox(height: 4.0.percentOfHeight(context)), 104 | ], 105 | ), 106 | ), 107 | ), 108 | ); 109 | } 110 | } 111 | 112 | // -------------------------------------------------------------------------------------------------------------------- 113 | 114 | /// * [showIRGregorianDatePickerDialog] show a dialog with [IRGregorianDatePickerResponsiveDialog] widget. 115 | 116 | Future showIRGregorianDatePickerDialog( 117 | {required BuildContext context, 118 | Gregorian? initialDate, 119 | int? minYear, 120 | int? maxYear, 121 | required String title, 122 | bool visibleTodayButton = true, 123 | required String todayButtonText, 124 | required String confirmButtonText}) async { 125 | Gregorian? gregorianDate = await showDialog( 126 | context: context, 127 | builder: (BuildContext buildContext) => Scaffold( 128 | backgroundColor: Colors.grey.withOpacity(0.4), 129 | body: Center( 130 | child: IRGregorianDatePickerResponsiveDialog( 131 | initialDate: initialDate, 132 | minYear: minYear, 133 | maxYear: maxYear, 134 | title: title, 135 | visibleTodayButton: visibleTodayButton, 136 | todayButtonText: todayButtonText, 137 | confirmButtonText: confirmButtonText, 138 | ), 139 | ), 140 | ), 141 | ); 142 | return gregorianDate; 143 | } 144 | 145 | // -------------------------------------------------------------------------------------------------------------------- 146 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_localizations/flutter_localizations.dart'; 4 | import 'package:ir_datetime_picker/ir_datetime_picker.dart'; 5 | 6 | void main() { 7 | runApp(const MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | const MyApp({super.key}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return MaterialApp( 16 | localizationsDelegates: const [ 17 | GlobalCupertinoLocalizations.delegate, 18 | GlobalMaterialLocalizations.delegate, 19 | GlobalWidgetsLocalizations.delegate 20 | ], 21 | supportedLocales: const [Locale("fa"), Locale("en")], 22 | locale: const Locale("fa"), 23 | debugShowCheckedModeBanner: false, 24 | title: 'Example', 25 | theme: ThemeData( 26 | fontFamily: "IranSans", 27 | colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), 28 | ), 29 | home: const HomePage(), 30 | ); 31 | } 32 | } 33 | 34 | class HomePage extends StatefulWidget { 35 | const HomePage({super.key}); 36 | 37 | @override 38 | State createState() => _HomePageState(); 39 | } 40 | 41 | class _HomePageState extends State { 42 | String _jalaliDate = "Null"; 43 | String _gregorianDate = "Null"; 44 | String _time = "Null"; 45 | 46 | @override 47 | Widget build(BuildContext context) { 48 | return Scaffold( 49 | body: Center( 50 | child: Column( 51 | mainAxisSize: MainAxisSize.min, 52 | children: [ 53 | Text("تاریخ جلالی: $_jalaliDate", 54 | style: const TextStyle(fontSize: 18.0)), 55 | const SizedBox(height: 5.0), 56 | 57 | // Simple jalali date picker using top level functions showIRJalaliDatePickerDialog or showIRJalaliDatePickerRoute: 58 | // NOTE: For create your own JalaliDatePicker use IRJalaliDatePicker widget. 59 | ElevatedButton( 60 | child: const Text("انتخاب تاریخ"), 61 | onPressed: () async { 62 | Jalali? selectedDate = await showIRJalaliDatePickerDialog( 63 | context: context, 64 | title: "انتخاب تاریخ", 65 | visibleTodayButton: true, 66 | todayButtonText: "انتخاب امروز", 67 | confirmButtonText: "تایید", 68 | initialDate: Jalali(1400, 4, 2), 69 | ); 70 | if (selectedDate != null) { 71 | setState(() { 72 | _jalaliDate = 73 | "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}"; 74 | }); 75 | } 76 | }, 77 | ), 78 | const SizedBox(height: 30.0), 79 | 80 | Text("تاریخ میلادی: $_gregorianDate", 81 | style: const TextStyle(fontSize: 18.0)), 82 | const SizedBox(height: 5.0), 83 | 84 | // Simple gregorian date picker using top level functions showIRGregorianDatePickerDialog or showIRGregorianDatePickerRoute: 85 | // NOTE: For create your own GregorianDatePicker use IRGregorianDatePicker widget. 86 | ElevatedButton( 87 | child: const Text("انتخاب تاریخ"), 88 | onPressed: () async { 89 | Gregorian? selectedDate = await showIRGregorianDatePickerDialog( 90 | context: context, 91 | title: "انتخاب تاریخ", 92 | visibleTodayButton: true, 93 | todayButtonText: "انتخاب امروز", 94 | confirmButtonText: "تایید", 95 | initialDate: Gregorian(2020, 7, 15), 96 | ); 97 | if (selectedDate != null) { 98 | setState(() { 99 | _gregorianDate = 100 | "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}"; 101 | }); 102 | } 103 | }, 104 | ), 105 | const SizedBox(height: 30.0), 106 | 107 | Text("زمان: $_time", style: const TextStyle(fontSize: 18.0)), 108 | const SizedBox(height: 5.0), 109 | 110 | // Simple time picker using top level function showIRTimePickerDialog: 111 | // NOTE: For create your own TimePicker use IRTimePicker widget. 112 | ElevatedButton( 113 | child: const Text("انتخاب زمان"), 114 | onPressed: () async { 115 | IRTimeModel? selectedTime = await showIRTimePickerDialog( 116 | context: context, 117 | initialTime: IRTimeModel(hour: 18, minute: 45, second: 59), 118 | title: "انتخاب زمان", 119 | visibleSecondsPicker: true, 120 | visibleNowButton: true, 121 | nowButtonText: "انتخاب اکنون", 122 | confirmButtonText: "تایید", 123 | ); 124 | if (selectedTime != null) { 125 | setState(() { 126 | _time = selectedTime.toString(showSecond: true); 127 | Duration durationTime = selectedTime.toDuration(); 128 | if (kDebugMode) 129 | print('Duration: ${durationTime.toString()}'); 130 | if (kDebugMode) 131 | print( 132 | 'IRTimeModel: ${IRTimeModel.fromDuration(durationTime).toString(showSecond: true)}'); 133 | }); 134 | } 135 | }, 136 | ), 137 | const SizedBox(height: 30.0), 138 | 139 | // Sample IRJalaliDatePicker widget For create your own JalaliDatePicker. 140 | Container( 141 | color: Colors.green.withOpacity(0.1), 142 | child: IRJalaliDatePicker( 143 | initialDate: Jalali(1400, 1, 3), 144 | minYear: 1390, 145 | maxYear: 1420, 146 | visibleTodayButton: true, 147 | todayButtonText: "انتخاب اکنون", 148 | constraints: 149 | const BoxConstraints.tightFor(width: 400, height: 200), 150 | onSelected: (Jalali date) { 151 | if (kDebugMode) print(date.toString()); 152 | }, 153 | ), 154 | ), 155 | ], 156 | ), 157 | ), 158 | ); 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /lib/src/helpers/date.dart: -------------------------------------------------------------------------------- 1 | import 'package:shamsi_date/shamsi_date.dart'; 2 | 3 | // -------------------------------------------------------------------------------------------------------------------- 4 | 5 | /// * [IRDateType] usefull for selection type of date in your custom datepicker widgets. 6 | enum IRDateType { jalali, gregorian } 7 | 8 | // -------------------------------------------------------------------------------------------------------------------- 9 | 10 | /// * [IRJalaliDateHelper] helpers for working with Jalali date. 11 | 12 | class IRJalaliDateHelper { 13 | static List months = [ 14 | "فروردین", 15 | "اردیبهشت", 16 | "خرداد", 17 | "تیر", 18 | "مرداد", 19 | "شهریور", 20 | "مهر", 21 | "آبان", 22 | "آذر", 23 | "دی", 24 | "بهمن", 25 | "اسفند" 26 | ]; 27 | 28 | static String getMonthName({required int monthNumber}) { 29 | switch (monthNumber) { 30 | case 1: 31 | return "فروردین"; 32 | case 2: 33 | return "اردیبهشت"; 34 | case 3: 35 | return "خرداد"; 36 | case 4: 37 | return "تیر"; 38 | case 5: 39 | return "مرداد"; 40 | case 6: 41 | return "شهریور"; 42 | case 7: 43 | return "مهر"; 44 | case 8: 45 | return "آبان"; 46 | case 9: 47 | return "آذر"; 48 | case 10: 49 | return "دی"; 50 | case 11: 51 | return "بهمن"; 52 | case 12: 53 | return "اسفند"; 54 | default: 55 | throw DateException("Invalid month number($monthNumber)"); 56 | } 57 | } 58 | 59 | static int getMonthNumber({required String monthName}) { 60 | switch (monthName) { 61 | case "فروردین": 62 | return 1; 63 | case "اردیبهشت": 64 | return 2; 65 | case "خرداد": 66 | return 3; 67 | case "تیر": 68 | return 4; 69 | case "مرداد": 70 | return 5; 71 | case "شهریور": 72 | return 6; 73 | case "مهر": 74 | return 7; 75 | case "آبان": 76 | return 8; 77 | case "آذر": 78 | return 9; 79 | case "دی": 80 | return 10; 81 | case "بهمن": 82 | return 11; 83 | case "اسفند": 84 | return 12; 85 | default: 86 | throw DateException("Invalid month name($monthName)"); 87 | } 88 | } 89 | 90 | static String getWeekDayName({required int weekDayNumber}) { 91 | switch (weekDayNumber) { 92 | case 1: 93 | return "شنبه"; 94 | case 2: 95 | return "یکشنبه"; 96 | case 3: 97 | return "دوشنبه"; 98 | case 4: 99 | return "سه" "\u200c" "شنبه"; 100 | case 5: 101 | return "چهارشنبه"; 102 | case 6: 103 | return "پنج" "\u200c" "شنبه"; 104 | case 7: 105 | return "جمعه"; 106 | default: 107 | throw DateException("Invalid week day number($weekDayNumber)"); 108 | } 109 | } 110 | 111 | static int getWeekDayNumber({required String weekDayName}) { 112 | switch (weekDayName) { 113 | case "شنبه": 114 | return 1; 115 | case "یکشنبه": 116 | return 2; 117 | case "دوشنبه": 118 | return 3; 119 | case "دو شنبه": 120 | return 3; 121 | case "سه" "\u200c" "شنبه": 122 | return 4; 123 | case "سه شنبه": 124 | return 4; 125 | case "چهارشنبه": 126 | return 5; 127 | case "چهار شنبه": 128 | return 5; 129 | case "پنج" "\u200c" "شنبه": 130 | return 6; 131 | case "پنج شنبه": 132 | return 6; 133 | case "جمعه": 134 | return 7; 135 | default: 136 | throw DateException("Invalid week day name($weekDayName)"); 137 | } 138 | } 139 | 140 | static int getMonthLength({required int year, required int month}) { 141 | return Jalali(year, month).monthLength; 142 | } 143 | 144 | static Jalali getNow() { 145 | return Jalali.now(); 146 | } 147 | } 148 | 149 | // -------------------------------------------------------------------------------------------------------------------- 150 | 151 | /// * [IRGregorianDateHelper] helpers for working with Gregorian date. 152 | 153 | class IRGregorianDateHelper { 154 | static List months = [ 155 | "January", 156 | "February", 157 | "March", 158 | "April", 159 | "May", 160 | "June", 161 | "July", 162 | "August", 163 | "September", 164 | "October", 165 | "November", 166 | "December" 167 | ]; 168 | 169 | static String getMonthName({required int monthNumber}) { 170 | switch (monthNumber) { 171 | case 1: 172 | return "January"; 173 | case 2: 174 | return "February"; 175 | case 3: 176 | return "March"; 177 | case 4: 178 | return "April"; 179 | case 5: 180 | return "May"; 181 | case 6: 182 | return "June"; 183 | case 7: 184 | return "July"; 185 | case 8: 186 | return "August"; 187 | case 9: 188 | return "September"; 189 | case 10: 190 | return "October"; 191 | case 11: 192 | return "November"; 193 | case 12: 194 | return "December"; 195 | default: 196 | throw DateException("Invalid month number($monthNumber)"); 197 | } 198 | } 199 | 200 | static int getMonthNumber({required String monthName}) { 201 | switch (monthName) { 202 | case "January": 203 | return 1; 204 | case "February": 205 | return 2; 206 | case "March": 207 | return 3; 208 | case "April": 209 | return 4; 210 | case "May": 211 | return 5; 212 | case "June": 213 | return 6; 214 | case "July": 215 | return 7; 216 | case "August": 217 | return 8; 218 | case "September": 219 | return 9; 220 | case "October": 221 | return 10; 222 | case "November": 223 | return 11; 224 | case "December": 225 | return 12; 226 | default: 227 | throw DateException("Invalid month name($monthName)"); 228 | } 229 | } 230 | 231 | static String getWeekDayName({required int weekDayNumber}) { 232 | switch (weekDayNumber) { 233 | case 1: 234 | return "Saturday"; 235 | case 2: 236 | return "Sunday"; 237 | case 3: 238 | return "Monday"; 239 | case 4: 240 | return "Tuesday"; 241 | case 5: 242 | return "Wednesday"; 243 | case 6: 244 | return "Thursday"; 245 | case 7: 246 | return "Friday"; 247 | default: 248 | throw DateException("Invalid week day number($weekDayNumber)"); 249 | } 250 | } 251 | 252 | static int getWeekDayNumber({required String weekDayName}) { 253 | switch (weekDayName) { 254 | case "Saturday": 255 | return 1; 256 | case "Sunday": 257 | return 2; 258 | case "Monday": 259 | return 3; 260 | case "Tuesday": 261 | return 4; 262 | case "Wednesday": 263 | return 5; 264 | case "Thursday": 265 | return 6; 266 | case "Friday": 267 | return 7; 268 | default: 269 | throw DateException("Invalid week day name($weekDayName)"); 270 | } 271 | } 272 | 273 | static int getMonthLength({required int year, required int month}) { 274 | return Gregorian(year, month).monthLength; 275 | } 276 | 277 | static Gregorian getNow() { 278 | return Gregorian.now(); 279 | } 280 | } 281 | 282 | // -------------------------------------------------------------------------------------------------------------------- 283 | -------------------------------------------------------------------------------- /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: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.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: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 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: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.18.0" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.8" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" 70 | url: "https://pub.dev" 71 | source: hosted 72 | version: "4.0.0" 73 | flutter_localizations: 74 | dependency: "direct main" 75 | description: flutter 76 | source: sdk 77 | version: "0.0.0" 78 | flutter_test: 79 | dependency: "direct dev" 80 | description: flutter 81 | source: sdk 82 | version: "0.0.0" 83 | intl: 84 | dependency: transitive 85 | description: 86 | name: intl 87 | sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf 88 | url: "https://pub.dev" 89 | source: hosted 90 | version: "0.19.0" 91 | ir_datetime_picker: 92 | dependency: "direct main" 93 | description: 94 | path: ".." 95 | relative: true 96 | source: path 97 | version: "4.1.4" 98 | leak_tracker: 99 | dependency: transitive 100 | description: 101 | name: leak_tracker 102 | sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" 103 | url: "https://pub.dev" 104 | source: hosted 105 | version: "10.0.4" 106 | leak_tracker_flutter_testing: 107 | dependency: transitive 108 | description: 109 | name: leak_tracker_flutter_testing 110 | sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" 111 | url: "https://pub.dev" 112 | source: hosted 113 | version: "3.0.3" 114 | leak_tracker_testing: 115 | dependency: transitive 116 | description: 117 | name: leak_tracker_testing 118 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 119 | url: "https://pub.dev" 120 | source: hosted 121 | version: "3.0.1" 122 | lints: 123 | dependency: transitive 124 | description: 125 | name: lints 126 | sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" 127 | url: "https://pub.dev" 128 | source: hosted 129 | version: "4.0.0" 130 | matcher: 131 | dependency: transitive 132 | description: 133 | name: matcher 134 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 135 | url: "https://pub.dev" 136 | source: hosted 137 | version: "0.12.16+1" 138 | material_color_utilities: 139 | dependency: transitive 140 | description: 141 | name: material_color_utilities 142 | sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "0.8.0" 146 | meta: 147 | dependency: transitive 148 | description: 149 | name: meta 150 | sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.12.0" 154 | path: 155 | dependency: transitive 156 | description: 157 | name: path 158 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.9.0" 162 | shamsi_date: 163 | dependency: transitive 164 | description: 165 | name: shamsi_date 166 | sha256: "19020ef0a001db3eabcec8657f8aa10b93b3746641d9eca64db9a41e6506645c" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.0.2" 170 | sky_engine: 171 | dependency: transitive 172 | description: flutter 173 | source: sdk 174 | version: "0.0.99" 175 | source_span: 176 | dependency: transitive 177 | description: 178 | name: source_span 179 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 180 | url: "https://pub.dev" 181 | source: hosted 182 | version: "1.10.0" 183 | stack_trace: 184 | dependency: transitive 185 | description: 186 | name: stack_trace 187 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 188 | url: "https://pub.dev" 189 | source: hosted 190 | version: "1.11.1" 191 | stream_channel: 192 | dependency: transitive 193 | description: 194 | name: stream_channel 195 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 196 | url: "https://pub.dev" 197 | source: hosted 198 | version: "2.1.2" 199 | string_scanner: 200 | dependency: transitive 201 | description: 202 | name: string_scanner 203 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 204 | url: "https://pub.dev" 205 | source: hosted 206 | version: "1.2.0" 207 | term_glyph: 208 | dependency: transitive 209 | description: 210 | name: term_glyph 211 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 212 | url: "https://pub.dev" 213 | source: hosted 214 | version: "1.2.1" 215 | test_api: 216 | dependency: transitive 217 | description: 218 | name: test_api 219 | sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" 220 | url: "https://pub.dev" 221 | source: hosted 222 | version: "0.7.0" 223 | vector_math: 224 | dependency: transitive 225 | description: 226 | name: vector_math 227 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 228 | url: "https://pub.dev" 229 | source: hosted 230 | version: "2.1.4" 231 | vm_service: 232 | dependency: transitive 233 | description: 234 | name: vm_service 235 | sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" 236 | url: "https://pub.dev" 237 | source: hosted 238 | version: "14.2.1" 239 | sdks: 240 | dart: ">=3.4.0 <4.0.0" 241 | flutter: ">=3.18.0-18.0.pre.54" 242 | -------------------------------------------------------------------------------- /lib/src/ir_time_picker/core/ir_time_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:ir_datetime_picker/src/helpers/print.dart'; 4 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 5 | import 'package:ir_datetime_picker/src/helpers/time.dart'; 6 | 7 | /// * [IRTimePickerOnSelected] is a callback function that will call when user change cupertino pickers. 8 | 9 | typedef IRTimePickerOnSelected = void Function(IRTimeModel time); 10 | 11 | /// * You can use [IRTimePicker] to design your own time pickers. 12 | 13 | class IRTimePicker extends StatefulWidget { 14 | final IRTimeModel? initialTime; 15 | final bool visibleSecondsPicker; 16 | final bool visibleNowButton; 17 | final String nowButtonText; 18 | final BoxConstraints? constraints; 19 | final IRTimePickerOnSelected onSelected; 20 | final TextStyle? textStyle; 21 | final double diameterRatio; 22 | final double magnification; 23 | final double offAxisFraction; 24 | final double squeeze; 25 | 26 | const IRTimePicker({ 27 | super.key, 28 | this.initialTime, 29 | this.visibleSecondsPicker = true, 30 | this.visibleNowButton = true, 31 | required this.nowButtonText, 32 | this.constraints, 33 | required this.onSelected, 34 | this.textStyle, 35 | this.diameterRatio = 1.0, 36 | this.magnification = 1.5, 37 | this.offAxisFraction = 0.0, 38 | this.squeeze = 1.3, 39 | }); 40 | 41 | @override 42 | State createState() => _IRTimePickerState(); 43 | } 44 | 45 | class _IRTimePickerState extends State { 46 | late bool _refreshCupertinoPickers; 47 | late List _hours; 48 | late List _minutes; 49 | late List _seconds; 50 | late int _selectedHour; 51 | late int _selectedMinute; 52 | late int _selectedSecond; 53 | 54 | @override 55 | void initState() { 56 | super.initState(); 57 | _refreshCupertinoPickers = false; 58 | DateTime now = DateTime.now(); 59 | _selectedHour = widget.initialTime?.hour ?? now.hour; 60 | _selectedMinute = widget.initialTime?.minute ?? now.minute; 61 | _selectedSecond = widget.initialTime?.second ?? now.second; 62 | _hours = List.generate( 63 | 24, 64 | (index) => index.toString().padLeft(2, "0"), 65 | ); 66 | _minutes = List.generate( 67 | 60, 68 | (index) => index.toString().padLeft(2, "0"), 69 | ); 70 | _seconds = List.generate( 71 | 60, 72 | (index) => index.toString().padLeft(2, "0"), 73 | ); 74 | } 75 | 76 | @override 77 | Widget build(BuildContext context) { 78 | WidgetsBinding.instance.addPostFrameCallback((_) { 79 | _refreshCupertinoPickers = false; 80 | }); 81 | BoxConstraints cupertinoPickersConstraints = BoxConstraints.loose( 82 | Size(100.0.percentOfWidth(context), 30.0.percentOfHeight(context)), 83 | ); 84 | Widget cupertinoPickers = Directionality( 85 | textDirection: TextDirection.ltr, 86 | child: ConstrainedBox( 87 | constraints: widget.constraints ?? cupertinoPickersConstraints, 88 | child: Row( 89 | mainAxisAlignment: MainAxisAlignment.center, 90 | children: [ 91 | _cupertinoPicker( 92 | context: context, 93 | list: _hours, 94 | initialItem: _hours.indexOf(_selectedHour.toString().padLeft(2, "0")), 95 | onSelectedItemChanged: (selectedIndex) { 96 | _selectedHour = int.parse(_hours[selectedIndex]); 97 | widget.onSelected(_getSelectedIRtime()); 98 | }, 99 | ), 100 | Text(" : ", style: widget.textStyle ?? Theme.of(context).textTheme.titleMedium?.copyWith(fontSize: 18.0.responsiveFont(context))), 101 | _cupertinoPicker( 102 | context: context, 103 | list: _minutes, 104 | initialItem: _minutes.indexOf(_selectedMinute.toString().padLeft(2, "0")), 105 | onSelectedItemChanged: (selectedIndex) { 106 | _selectedMinute = int.parse(_minutes[selectedIndex]); 107 | widget.onSelected(_getSelectedIRtime()); 108 | }, 109 | ), 110 | Visibility( 111 | visible: widget.visibleSecondsPicker, 112 | child: Row( 113 | mainAxisSize: MainAxisSize.min, 114 | children: [ 115 | Text(" : ", style: widget.textStyle ?? Theme.of(context).textTheme.titleMedium?.copyWith(fontSize: 18.0.responsiveFont(context))), 116 | _cupertinoPicker( 117 | context: context, 118 | list: _seconds, 119 | initialItem: _seconds.indexOf(_selectedSecond.toString().padLeft(2, "0")), 120 | onSelectedItemChanged: (selectedIndex) { 121 | _selectedSecond = int.parse(_seconds[selectedIndex]); 122 | widget.onSelected(_getSelectedIRtime()); 123 | }, 124 | ), 125 | ], 126 | ), 127 | ), 128 | ], 129 | ), 130 | ), 131 | ); 132 | Widget nowButton = Column( 133 | mainAxisSize: MainAxisSize.min, 134 | children: [ 135 | SizedBox(height: 1.0.percentOfHeight(context)), 136 | Padding( 137 | padding: EdgeInsets.symmetric(horizontal: 10.0.percentOfWidth(context)), 138 | child: Row( 139 | mainAxisAlignment: MainAxisAlignment.start, 140 | mainAxisSize: MainAxisSize.max, 141 | children: [ 142 | TextButton.icon( 143 | icon: Icon(Icons.info, size: 6.5.percentOfWidth(context), color: widget.textStyle?.color ?? Theme.of(context).textTheme.titleMedium?.color), 144 | style: TextButton.styleFrom( 145 | padding: EdgeInsets.all(2.0.percentOfWidth(context)), 146 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), 147 | ), 148 | label: Text(widget.nowButtonText, style: (widget.textStyle ?? Theme.of(context).textTheme.titleMedium)?.copyWith(fontSize: 14.responsiveFont(context), fontWeight: FontWeight.w600)), 149 | onPressed: () { 150 | setState(() { 151 | _refreshCupertinoPickers = true; 152 | DateTime now = DateTime.now(); 153 | _selectedHour = now.hour; 154 | _selectedMinute = now.minute; 155 | _selectedSecond = now.second; 156 | }); 157 | widget.onSelected(_getSelectedIRtime()); 158 | }, 159 | ), 160 | ], 161 | ), 162 | ), 163 | ], 164 | ); 165 | return Column( 166 | mainAxisSize: MainAxisSize.min, 167 | children: [ 168 | cupertinoPickers, 169 | Visibility( 170 | visible: widget.visibleNowButton, 171 | child: nowButton, 172 | ), 173 | ], 174 | ); 175 | } 176 | 177 | Widget _cupertinoPicker({ 178 | required BuildContext context, 179 | required List list, 180 | required int initialItem, 181 | required ValueChanged onSelectedItemChanged, 182 | }) { 183 | mPrint(initialItem); 184 | BoxConstraints cupertinoPickerConstraints = BoxConstraints.loose( 185 | Size(widget.visibleSecondsPicker ? 17.0.percentOfWidth(context) : 25.0.percentOfWidth(context), double.infinity), 186 | ); 187 | return ConstrainedBox( 188 | constraints: cupertinoPickerConstraints, 189 | child: CupertinoPicker( 190 | key: _refreshCupertinoPickers ? UniqueKey() : null, 191 | backgroundColor: Colors.transparent, 192 | looping: true, 193 | scrollController: FixedExtentScrollController(initialItem: initialItem), 194 | itemExtent: 8.5.percentOfWidth(context), 195 | diameterRatio: widget.diameterRatio, 196 | magnification: widget.magnification, 197 | offAxisFraction: widget.offAxisFraction, 198 | squeeze: widget.squeeze, 199 | selectionOverlay: Container(), 200 | onSelectedItemChanged: onSelectedItemChanged, 201 | children: list.map( 202 | (element) { 203 | return Center( 204 | child: Text( 205 | element.toString(), 206 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 207 | color: widget.textStyle?.color, 208 | fontSize: widget.textStyle?.fontSize ?? 18.0.responsiveFont(context), 209 | fontWeight: widget.textStyle?.fontWeight, 210 | ), 211 | ), 212 | ); 213 | }, 214 | ).toList(), 215 | ), 216 | ); 217 | } 218 | 219 | IRTimeModel _getSelectedIRtime() { 220 | return IRTimeModel(hour: _selectedHour, minute: _selectedMinute, second: _selectedSecond); 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /lib/src/ir_date_picker/core/ir_jalali_date_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:ir_datetime_picker/src/helpers/date.dart'; 4 | import 'package:ir_datetime_picker/src/helpers/print.dart'; 5 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 6 | import 'package:shamsi_date/shamsi_date.dart'; 7 | 8 | /// * [IRJalaliDatePickerOnSelected] is a callback function that will call when user change cupertino pickers. 9 | 10 | typedef IRJalaliDatePickerOnSelected = void Function(Jalali jalaliDate); 11 | 12 | /// * You can use [IRJalaliDatePicker] to design your own date pickers. 13 | 14 | class IRJalaliDatePicker extends StatefulWidget { 15 | final Jalali? initialDate; 16 | final int? minYear; 17 | final int? maxYear; 18 | final bool visibleTodayButton; 19 | final String todayButtonText; 20 | final BoxConstraints? constraints; 21 | final IRJalaliDatePickerOnSelected onSelected; 22 | final TextStyle? textStyle; 23 | final double diameterRatio; 24 | final double magnification; 25 | final double offAxisFraction; 26 | final double squeeze; 27 | 28 | const IRJalaliDatePicker({ 29 | super.key, 30 | this.initialDate, 31 | this.minYear, 32 | this.maxYear, 33 | this.visibleTodayButton = true, 34 | required this.todayButtonText, 35 | this.constraints, 36 | required this.onSelected, 37 | this.textStyle, 38 | this.diameterRatio = 1.0, 39 | this.magnification = 1.3, 40 | this.offAxisFraction = 0.0, 41 | this.squeeze = 1.3, 42 | }); 43 | 44 | @override 45 | State createState() => _IRJalaliDatePickerState(); 46 | } 47 | 48 | class _IRJalaliDatePickerState extends State { 49 | late Jalali _initialDate; 50 | late bool _refreshCupertinoPickers; 51 | int _selectedYear = 1400; 52 | int _selectedMonth = 1; 53 | int _selectedDay = 1; 54 | List _years = []; 55 | final List _months = IRJalaliDateHelper.months; 56 | List _days = []; 57 | 58 | @override 59 | void initState() { 60 | super.initState(); 61 | _initialDate = widget.initialDate ?? Jalali.now(); 62 | _refreshCupertinoPickers = false; 63 | _selectedYear = _initialDate.year; 64 | _selectedMonth = _initialDate.month; 65 | _selectedDay = _initialDate.day; 66 | _years = _yearsList(widget.minYear ?? (_initialDate.year - 50), 67 | widget.maxYear ?? (_initialDate.year + 50)); 68 | _days = _daysList(_getSelectedJalaliDate().monthLength); 69 | } 70 | 71 | @override 72 | Widget build(BuildContext context) { 73 | WidgetsBinding.instance.addPostFrameCallback((_) { 74 | _refreshCupertinoPickers = false; 75 | }); 76 | BoxConstraints cupertinoPickersConstraints = BoxConstraints.loose( 77 | Size(100.0.percentOfWidth(context), 30.0.percentOfHeight(context)), 78 | ); 79 | Widget cupertinoPickers = Directionality( 80 | textDirection: TextDirection.ltr, 81 | child: ConstrainedBox( 82 | constraints: widget.constraints ?? cupertinoPickersConstraints, 83 | child: Row( 84 | mainAxisAlignment: MainAxisAlignment.center, 85 | children: [ 86 | _cupertinoPicker( 87 | context: context, 88 | list: _years, 89 | initialItem: _years.indexOf(_selectedYear), 90 | onSelectedItemChanged: (selectedIndex) { 91 | setState(() { 92 | _selectedYear = _years[selectedIndex]; 93 | int monthLength = IRJalaliDateHelper.getMonthLength( 94 | year: _selectedYear, month: _selectedMonth); 95 | _days = List.generate(monthLength, (index) => index + 1); 96 | if (_selectedDay > monthLength) { 97 | _selectedDay = monthLength; 98 | } 99 | }); 100 | widget.onSelected(_getSelectedJalaliDate()); 101 | }, 102 | ), 103 | _cupertinoPicker( 104 | context: context, 105 | list: _months, 106 | initialItem: _months.indexOf( 107 | IRJalaliDateHelper.getMonthName(monthNumber: _selectedMonth)), 108 | onSelectedItemChanged: (selectedIndex) { 109 | setState(() { 110 | _selectedMonth = IRJalaliDateHelper.getMonthNumber( 111 | monthName: _months[selectedIndex]); 112 | int monthLength = IRJalaliDateHelper.getMonthLength( 113 | year: _selectedYear, month: _selectedMonth); 114 | _days = List.generate(monthLength, (index) => index + 1); 115 | if (_selectedDay > monthLength) { 116 | _selectedDay = monthLength; 117 | } 118 | }); 119 | widget.onSelected(_getSelectedJalaliDate()); 120 | }, 121 | ), 122 | _cupertinoPicker( 123 | context: context, 124 | list: _days, 125 | initialItem: _days.indexOf(_selectedDay), 126 | onSelectedItemChanged: (selectedIndex) { 127 | _selectedDay = _days[selectedIndex]; 128 | widget.onSelected(_getSelectedJalaliDate()); 129 | }, 130 | ), 131 | ], 132 | ), 133 | ), 134 | ); 135 | Widget todayButton = Column( 136 | mainAxisSize: MainAxisSize.min, 137 | children: [ 138 | SizedBox(height: 1.0.percentOfHeight(context)), 139 | Padding( 140 | padding: 141 | EdgeInsets.symmetric(horizontal: 10.0.percentOfWidth(context)), 142 | child: Row( 143 | mainAxisAlignment: MainAxisAlignment.start, 144 | mainAxisSize: MainAxisSize.max, 145 | children: [ 146 | TextButton.icon( 147 | icon: Icon(Icons.info, 148 | size: 6.5.percentOfWidth(context), 149 | color: widget.textStyle?.color ?? 150 | Theme.of(context).textTheme.titleMedium?.color), 151 | style: TextButton.styleFrom( 152 | padding: EdgeInsets.all(2.0.percentOfWidth(context)), 153 | shape: RoundedRectangleBorder( 154 | borderRadius: BorderRadius.circular(12.0)), 155 | ), 156 | label: Text(widget.todayButtonText, 157 | style: (widget.textStyle ?? 158 | Theme.of(context).textTheme.titleMedium) 159 | ?.copyWith( 160 | fontSize: 14.responsiveFont(context), 161 | fontWeight: FontWeight.w600)), 162 | onPressed: () { 163 | setState(() { 164 | _refreshCupertinoPickers = true; 165 | Jalali now = Jalali.now(); 166 | _selectedYear = now.year; 167 | _selectedMonth = now.month; 168 | _selectedDay = now.day; 169 | }); 170 | widget.onSelected(_getSelectedJalaliDate()); 171 | }, 172 | ), 173 | ], 174 | ), 175 | ), 176 | ], 177 | ); 178 | return Column( 179 | mainAxisSize: MainAxisSize.min, 180 | children: [ 181 | cupertinoPickers, 182 | Visibility( 183 | visible: widget.visibleTodayButton, 184 | child: todayButton, 185 | ), 186 | ], 187 | ); 188 | } 189 | 190 | Widget _cupertinoPicker( 191 | {required BuildContext context, 192 | required List list, 193 | required int initialItem, 194 | required ValueChanged onSelectedItemChanged}) { 195 | mPrint(initialItem); 196 | BoxConstraints cupertinoPickerConstraints = BoxConstraints.loose( 197 | Size(30.0.percentOfWidth(context), double.infinity), 198 | ); 199 | return ConstrainedBox( 200 | constraints: cupertinoPickerConstraints, 201 | child: CupertinoPicker( 202 | key: _refreshCupertinoPickers ? UniqueKey() : null, 203 | scrollController: FixedExtentScrollController(initialItem: initialItem), 204 | itemExtent: 8.5.percentOfWidth(context), 205 | diameterRatio: widget.diameterRatio, 206 | magnification: widget.magnification, 207 | offAxisFraction: widget.offAxisFraction, 208 | squeeze: widget.squeeze, 209 | selectionOverlay: Container( 210 | decoration: BoxDecoration( 211 | border: Border( 212 | top: BorderSide( 213 | color: widget.textStyle?.color?.withOpacity(0.35) ?? 214 | Colors.grey.shade400, 215 | width: 0.5), 216 | bottom: BorderSide( 217 | color: widget.textStyle?.color?.withOpacity(0.35) ?? 218 | Colors.grey.shade400, 219 | width: 0.5), 220 | ), 221 | ), 222 | ), 223 | onSelectedItemChanged: onSelectedItemChanged, 224 | children: list.map( 225 | (element) { 226 | return Center( 227 | child: Text( 228 | element.toString(), 229 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 230 | color: widget.textStyle?.color, 231 | fontSize: widget.textStyle?.fontSize ?? 232 | 16.5.responsiveFont(context), 233 | fontWeight: widget.textStyle?.fontWeight, 234 | ), 235 | ), 236 | ); 237 | }, 238 | ).toList(), 239 | ), 240 | ); 241 | } 242 | 243 | List _yearsList(int minYear, int maxYear) { 244 | List years = []; 245 | for (int i = minYear; i <= maxYear; i++) { 246 | years.add(i); 247 | } 248 | return years; 249 | } 250 | 251 | List _daysList(int monthLength) { 252 | return List.generate(monthLength, (index) => index + 1); 253 | } 254 | 255 | Jalali _getSelectedJalaliDate() { 256 | return Jalali(_selectedYear, _selectedMonth, _selectedDay); 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /lib/src/ir_date_picker/core/ir_gregorian_date_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:ir_datetime_picker/src/helpers/date.dart'; 4 | import 'package:ir_datetime_picker/src/helpers/print.dart'; 5 | import 'package:ir_datetime_picker/src/helpers/responsive.dart'; 6 | import 'package:shamsi_date/shamsi_date.dart'; 7 | 8 | /// * [IRGregorianDatePickerOnSelected] is a callback function that will call when user change cupertino pickers. 9 | 10 | typedef IRGregorianDatePickerOnSelected = void Function( 11 | Gregorian gregorianDate); 12 | 13 | /// * You can use [IRGregorianDatePicker] to design your own date pickers. 14 | 15 | class IRGregorianDatePicker extends StatefulWidget { 16 | final Gregorian? initialDate; 17 | final int? minYear; 18 | final int? maxYear; 19 | final bool visibleTodayButton; 20 | final String todayButtonText; 21 | final BoxConstraints? constraints; 22 | final IRGregorianDatePickerOnSelected onSelected; 23 | final TextStyle? textStyle; 24 | final double diameterRatio; 25 | final double magnification; 26 | final double offAxisFraction; 27 | final double squeeze; 28 | 29 | const IRGregorianDatePicker({ 30 | super.key, 31 | this.initialDate, 32 | this.minYear, 33 | this.maxYear, 34 | this.visibleTodayButton = true, 35 | required this.todayButtonText, 36 | this.constraints, 37 | required this.onSelected, 38 | this.textStyle, 39 | this.diameterRatio = 1.0, 40 | this.magnification = 1.3, 41 | this.offAxisFraction = 0.0, 42 | this.squeeze = 1.3, 43 | }); 44 | 45 | @override 46 | State createState() => _IRGregorianDatePickerState(); 47 | } 48 | 49 | class _IRGregorianDatePickerState extends State { 50 | late Gregorian _initialDate; 51 | late bool _refreshCupertinoPickers; 52 | int _selectedYear = 2020; 53 | int _selectedMonth = 1; 54 | int _selectedDay = 1; 55 | List _years = []; 56 | final List _months = IRGregorianDateHelper.months; 57 | List _days = []; 58 | 59 | @override 60 | void initState() { 61 | super.initState(); 62 | _initialDate = widget.initialDate ?? Gregorian.now(); 63 | _refreshCupertinoPickers = false; 64 | _selectedYear = _initialDate.year; 65 | _selectedMonth = _initialDate.month; 66 | _selectedDay = _initialDate.day; 67 | _years = _yearsList(widget.minYear ?? (_initialDate.year - 50), 68 | widget.maxYear ?? (_initialDate.year + 50)); 69 | _days = _daysList(_getSelectedGregorianDate().monthLength); 70 | } 71 | 72 | @override 73 | Widget build(BuildContext context) { 74 | WidgetsBinding.instance.addPostFrameCallback((_) { 75 | _refreshCupertinoPickers = false; 76 | }); 77 | BoxConstraints cupertinoPickersConstraints = BoxConstraints.loose( 78 | Size(100.0.percentOfWidth(context), 30.0.percentOfHeight(context)), 79 | ); 80 | Widget cupertinoPickers = Directionality( 81 | textDirection: TextDirection.ltr, 82 | child: ConstrainedBox( 83 | constraints: widget.constraints ?? cupertinoPickersConstraints, 84 | child: Row( 85 | mainAxisAlignment: MainAxisAlignment.center, 86 | children: [ 87 | _cupertinoPicker( 88 | context: context, 89 | list: _years, 90 | initialItem: _years.indexOf(_selectedYear), 91 | onSelectedItemChanged: (selectedIndex) { 92 | setState(() { 93 | _selectedYear = _years[selectedIndex]; 94 | int monthLength = IRGregorianDateHelper.getMonthLength( 95 | year: _selectedYear, month: _selectedMonth); 96 | _days = List.generate(monthLength, (index) => index + 1); 97 | if (_selectedDay > monthLength) { 98 | _selectedDay = monthLength; 99 | } 100 | }); 101 | widget.onSelected(_getSelectedGregorianDate()); 102 | }, 103 | ), 104 | _cupertinoPicker( 105 | context: context, 106 | list: _months, 107 | initialItem: _months.indexOf(IRGregorianDateHelper.getMonthName( 108 | monthNumber: _selectedMonth)), 109 | onSelectedItemChanged: (selectedIndex) { 110 | setState(() { 111 | _selectedMonth = IRGregorianDateHelper.getMonthNumber( 112 | monthName: _months[selectedIndex]); 113 | int monthLength = IRGregorianDateHelper.getMonthLength( 114 | year: _selectedYear, month: _selectedMonth); 115 | _days = List.generate(monthLength, (index) => index + 1); 116 | if (_selectedDay > monthLength) { 117 | _selectedDay = monthLength; 118 | } 119 | }); 120 | widget.onSelected(_getSelectedGregorianDate()); 121 | }, 122 | ), 123 | _cupertinoPicker( 124 | context: context, 125 | list: _days, 126 | initialItem: _days.indexOf(_selectedDay), 127 | onSelectedItemChanged: (selectedIndex) { 128 | _selectedDay = _days[selectedIndex]; 129 | widget.onSelected(_getSelectedGregorianDate()); 130 | }, 131 | ), 132 | ], 133 | ), 134 | ), 135 | ); 136 | Widget todayButton = Column( 137 | mainAxisSize: MainAxisSize.min, 138 | children: [ 139 | SizedBox(height: 1.0.percentOfHeight(context)), 140 | Padding( 141 | padding: 142 | EdgeInsets.symmetric(horizontal: 10.0.percentOfWidth(context)), 143 | child: Row( 144 | mainAxisAlignment: MainAxisAlignment.start, 145 | mainAxisSize: MainAxisSize.max, 146 | children: [ 147 | TextButton.icon( 148 | icon: Icon(Icons.info, 149 | size: 6.5.percentOfWidth(context), 150 | color: widget.textStyle?.color ?? 151 | Theme.of(context).textTheme.titleMedium?.color), 152 | style: TextButton.styleFrom( 153 | padding: EdgeInsets.all(2.0.percentOfWidth(context)), 154 | shape: RoundedRectangleBorder( 155 | borderRadius: BorderRadius.circular(12.0)), 156 | ), 157 | label: Text(widget.todayButtonText, 158 | style: (widget.textStyle ?? 159 | Theme.of(context).textTheme.titleMedium) 160 | ?.copyWith( 161 | fontSize: 14.responsiveFont(context), 162 | fontWeight: FontWeight.w600)), 163 | onPressed: () { 164 | setState(() { 165 | _refreshCupertinoPickers = true; 166 | Gregorian now = Gregorian.now(); 167 | _selectedYear = now.year; 168 | _selectedMonth = now.month; 169 | _selectedDay = now.day; 170 | }); 171 | widget.onSelected(_getSelectedGregorianDate()); 172 | }, 173 | ), 174 | ], 175 | ), 176 | ), 177 | ], 178 | ); 179 | return Column( 180 | mainAxisSize: MainAxisSize.min, 181 | children: [ 182 | cupertinoPickers, 183 | Visibility( 184 | visible: widget.visibleTodayButton, 185 | child: todayButton, 186 | ), 187 | ], 188 | ); 189 | } 190 | 191 | Widget _cupertinoPicker( 192 | {required BuildContext context, 193 | required List list, 194 | required int initialItem, 195 | required ValueChanged onSelectedItemChanged}) { 196 | mPrint(initialItem); 197 | BoxConstraints cupertinoPickerConstraints = BoxConstraints.loose( 198 | Size(30.0.percentOfWidth(context), double.infinity), 199 | ); 200 | return ConstrainedBox( 201 | constraints: cupertinoPickerConstraints, 202 | child: CupertinoPicker( 203 | key: _refreshCupertinoPickers ? UniqueKey() : null, 204 | scrollController: FixedExtentScrollController(initialItem: initialItem), 205 | itemExtent: 8.5.percentOfWidth(context), 206 | diameterRatio: widget.diameterRatio, 207 | magnification: widget.magnification, 208 | offAxisFraction: widget.offAxisFraction, 209 | squeeze: widget.squeeze, 210 | selectionOverlay: Container( 211 | decoration: BoxDecoration( 212 | border: Border( 213 | top: BorderSide( 214 | color: widget.textStyle?.color?.withOpacity(0.35) ?? 215 | Colors.grey.shade400, 216 | width: 0.5), 217 | bottom: BorderSide( 218 | color: widget.textStyle?.color?.withOpacity(0.35) ?? 219 | Colors.grey.shade400, 220 | width: 0.5), 221 | ), 222 | ), 223 | ), 224 | onSelectedItemChanged: onSelectedItemChanged, 225 | children: list.map( 226 | (element) { 227 | return Center( 228 | child: Text( 229 | element.toString(), 230 | style: Theme.of(context).textTheme.titleMedium?.copyWith( 231 | color: widget.textStyle?.color, 232 | fontSize: widget.textStyle?.fontSize ?? 233 | 16.5.responsiveFont(context), 234 | fontWeight: widget.textStyle?.fontWeight, 235 | ), 236 | ), 237 | ); 238 | }, 239 | ).toList(), 240 | ), 241 | ); 242 | } 243 | 244 | List _yearsList(int minYear, int maxYear) { 245 | List years = []; 246 | for (int i = minYear; i <= maxYear; i++) { 247 | years.add(i); 248 | } 249 | return years; 250 | } 251 | 252 | List _daysList(int monthLength) { 253 | return List.generate(monthLength, (index) => index + 1); 254 | } 255 | 256 | Gregorian _getSelectedGregorianDate() { 257 | return Gregorian(_selectedYear, _selectedMonth, _selectedDay); 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 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 | 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 97C146E61CF9000F007C117D /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 97C146ED1CF9000F007C117D; 25 | remoteInfo = Runner; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXCopyFilesBuildPhase section */ 30 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 31 | isa = PBXCopyFilesBuildPhase; 32 | buildActionMask = 2147483647; 33 | dstPath = ""; 34 | dstSubfolderSpec = 10; 35 | files = ( 36 | ); 37 | name = "Embed Frameworks"; 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXCopyFilesBuildPhase section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 44 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 47 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 51 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 57 | 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 78 | ); 79 | name = Flutter; 80 | sourceTree = ""; 81 | }; 82 | 331C8082294A63A400263BE5 /* RunnerTests */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 331C807B294A618700263BE5 /* RunnerTests.swift */, 86 | ); 87 | path = RunnerTests; 88 | sourceTree = ""; 89 | }; 90 | 97C146E51CF9000F007C117D = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9740EEB11CF90186004384FC /* Flutter */, 94 | 97C146F01CF9000F007C117D /* Runner */, 95 | 97C146EF1CF9000F007C117D /* Products */, 96 | 331C8082294A63A400263BE5 /* RunnerTests */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | 97C146EF1CF9000F007C117D /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 97C146EE1CF9000F007C117D /* Runner.app */, 104 | 331C8081294A63A400263BE5 /* RunnerTests.xctest */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | 97C146F01CF9000F007C117D /* Runner */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 113 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 114 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 115 | 97C147021CF9000F007C117D /* Info.plist */, 116 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 117 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 118 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 119 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 120 | ); 121 | path = Runner; 122 | sourceTree = ""; 123 | }; 124 | /* End PBXGroup section */ 125 | 126 | /* Begin PBXNativeTarget section */ 127 | 331C8080294A63A400263BE5 /* RunnerTests */ = { 128 | isa = PBXNativeTarget; 129 | buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; 130 | buildPhases = ( 131 | 331C807D294A63A400263BE5 /* Sources */, 132 | 331C807E294A63A400263BE5 /* Frameworks */, 133 | 331C807F294A63A400263BE5 /* Resources */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | 331C8086294A63A400263BE5 /* PBXTargetDependency */, 139 | ); 140 | name = RunnerTests; 141 | productName = RunnerTests; 142 | productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; 143 | productType = "com.apple.product-type.bundle.unit-test"; 144 | }; 145 | 97C146ED1CF9000F007C117D /* Runner */ = { 146 | isa = PBXNativeTarget; 147 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 148 | buildPhases = ( 149 | 9740EEB61CF901F6004384FC /* Run Script */, 150 | 97C146EA1CF9000F007C117D /* Sources */, 151 | 97C146EB1CF9000F007C117D /* Frameworks */, 152 | 97C146EC1CF9000F007C117D /* Resources */, 153 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 154 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 155 | ); 156 | buildRules = ( 157 | ); 158 | dependencies = ( 159 | ); 160 | name = Runner; 161 | productName = Runner; 162 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 163 | productType = "com.apple.product-type.application"; 164 | }; 165 | /* End PBXNativeTarget section */ 166 | 167 | /* Begin PBXProject section */ 168 | 97C146E61CF9000F007C117D /* Project object */ = { 169 | isa = PBXProject; 170 | attributes = { 171 | BuildIndependentTargetsInParallel = YES; 172 | LastUpgradeCheck = 1430; 173 | ORGANIZATIONNAME = ""; 174 | TargetAttributes = { 175 | 331C8080294A63A400263BE5 = { 176 | CreatedOnToolsVersion = 14.0; 177 | TestTargetID = 97C146ED1CF9000F007C117D; 178 | }; 179 | 97C146ED1CF9000F007C117D = { 180 | CreatedOnToolsVersion = 7.3.1; 181 | LastSwiftMigration = 1100; 182 | }; 183 | }; 184 | }; 185 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 186 | compatibilityVersion = "Xcode 9.3"; 187 | developmentRegion = en; 188 | hasScannedForEncodings = 0; 189 | knownRegions = ( 190 | en, 191 | Base, 192 | ); 193 | mainGroup = 97C146E51CF9000F007C117D; 194 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 195 | projectDirPath = ""; 196 | projectRoot = ""; 197 | targets = ( 198 | 97C146ED1CF9000F007C117D /* Runner */, 199 | 331C8080294A63A400263BE5 /* RunnerTests */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | 331C807F294A63A400263BE5 /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | 97C146EC1CF9000F007C117D /* Resources */ = { 213 | isa = PBXResourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 217 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 218 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 219 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXShellScriptBuildPhase section */ 226 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | alwaysOutOfDate = 1; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | ); 232 | inputPaths = ( 233 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 234 | ); 235 | name = "Thin Binary"; 236 | outputPaths = ( 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | shellPath = /bin/sh; 240 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 241 | }; 242 | 9740EEB61CF901F6004384FC /* Run Script */ = { 243 | isa = PBXShellScriptBuildPhase; 244 | alwaysOutOfDate = 1; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | inputPaths = ( 249 | ); 250 | name = "Run Script"; 251 | outputPaths = ( 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | shellPath = /bin/sh; 255 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 256 | }; 257 | /* End PBXShellScriptBuildPhase section */ 258 | 259 | /* Begin PBXSourcesBuildPhase section */ 260 | 331C807D294A63A400263BE5 /* Sources */ = { 261 | isa = PBXSourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | 97C146EA1CF9000F007C117D /* Sources */ = { 269 | isa = PBXSourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 273 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | /* End PBXSourcesBuildPhase section */ 278 | 279 | /* Begin PBXTargetDependency section */ 280 | 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { 281 | isa = PBXTargetDependency; 282 | target = 97C146ED1CF9000F007C117D /* Runner */; 283 | targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; 284 | }; 285 | /* End PBXTargetDependency section */ 286 | 287 | /* Begin PBXVariantGroup section */ 288 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 289 | isa = PBXVariantGroup; 290 | children = ( 291 | 97C146FB1CF9000F007C117D /* Base */, 292 | ); 293 | name = Main.storyboard; 294 | sourceTree = ""; 295 | }; 296 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 297 | isa = PBXVariantGroup; 298 | children = ( 299 | 97C147001CF9000F007C117D /* Base */, 300 | ); 301 | name = LaunchScreen.storyboard; 302 | sourceTree = ""; 303 | }; 304 | /* End PBXVariantGroup section */ 305 | 306 | /* Begin XCBuildConfiguration section */ 307 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ALWAYS_SEARCH_USER_PATHS = NO; 311 | CLANG_ANALYZER_NONNULL = YES; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_MODULES = YES; 315 | CLANG_ENABLE_OBJC_ARC = YES; 316 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 317 | CLANG_WARN_BOOL_CONVERSION = YES; 318 | CLANG_WARN_COMMA = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INFINITE_RECURSION = YES; 325 | CLANG_WARN_INT_CONVERSION = YES; 326 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 327 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 328 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 330 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 331 | CLANG_WARN_STRICT_PROTOTYPES = YES; 332 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 333 | CLANG_WARN_UNREACHABLE_CODE = YES; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | COPY_PHASE_STRIP = NO; 337 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 338 | ENABLE_NS_ASSERTIONS = NO; 339 | ENABLE_STRICT_OBJC_MSGSEND = YES; 340 | GCC_C_LANGUAGE_STANDARD = gnu99; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 343 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 344 | GCC_WARN_UNDECLARED_SELECTOR = YES; 345 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 346 | GCC_WARN_UNUSED_FUNCTION = YES; 347 | GCC_WARN_UNUSED_VARIABLE = YES; 348 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 349 | MTL_ENABLE_DEBUG_INFO = NO; 350 | SDKROOT = iphoneos; 351 | SUPPORTED_PLATFORMS = iphoneos; 352 | TARGETED_DEVICE_FAMILY = "1,2"; 353 | VALIDATE_PRODUCT = YES; 354 | }; 355 | name = Profile; 356 | }; 357 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 358 | isa = XCBuildConfiguration; 359 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | CLANG_ENABLE_MODULES = YES; 363 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 364 | ENABLE_BITCODE = NO; 365 | INFOPLIST_FILE = Runner/Info.plist; 366 | LD_RUNPATH_SEARCH_PATHS = ( 367 | "$(inherited)", 368 | "@executable_path/Frameworks", 369 | ); 370 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 371 | PRODUCT_NAME = "$(TARGET_NAME)"; 372 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 373 | SWIFT_VERSION = 5.0; 374 | VERSIONING_SYSTEM = "apple-generic"; 375 | }; 376 | name = Profile; 377 | }; 378 | 331C8088294A63A400263BE5 /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; 381 | buildSettings = { 382 | BUNDLE_LOADER = "$(TEST_HOST)"; 383 | CODE_SIGN_STYLE = Automatic; 384 | CURRENT_PROJECT_VERSION = 1; 385 | GENERATE_INFOPLIST_FILE = YES; 386 | MARKETING_VERSION = 1.0; 387 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 390 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 391 | SWIFT_VERSION = 5.0; 392 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; 393 | }; 394 | name = Debug; 395 | }; 396 | 331C8089294A63A400263BE5 /* Release */ = { 397 | isa = XCBuildConfiguration; 398 | baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; 399 | buildSettings = { 400 | BUNDLE_LOADER = "$(TEST_HOST)"; 401 | CODE_SIGN_STYLE = Automatic; 402 | CURRENT_PROJECT_VERSION = 1; 403 | GENERATE_INFOPLIST_FILE = YES; 404 | MARKETING_VERSION = 1.0; 405 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SWIFT_VERSION = 5.0; 408 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; 409 | }; 410 | name = Release; 411 | }; 412 | 331C808A294A63A400263BE5 /* Profile */ = { 413 | isa = XCBuildConfiguration; 414 | baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; 415 | buildSettings = { 416 | BUNDLE_LOADER = "$(TEST_HOST)"; 417 | CODE_SIGN_STYLE = Automatic; 418 | CURRENT_PROJECT_VERSION = 1; 419 | GENERATE_INFOPLIST_FILE = YES; 420 | MARKETING_VERSION = 1.0; 421 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | SWIFT_VERSION = 5.0; 424 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; 425 | }; 426 | name = Profile; 427 | }; 428 | 97C147031CF9000F007C117D /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ANALYZER_NONNULL = YES; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_COMMA = YES; 440 | CLANG_WARN_CONSTANT_CONVERSION = YES; 441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 443 | CLANG_WARN_EMPTY_BODY = YES; 444 | CLANG_WARN_ENUM_CONVERSION = YES; 445 | CLANG_WARN_INFINITE_RECURSION = YES; 446 | CLANG_WARN_INT_CONVERSION = YES; 447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 448 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 452 | CLANG_WARN_STRICT_PROTOTYPES = YES; 453 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 454 | CLANG_WARN_UNREACHABLE_CODE = YES; 455 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 456 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 457 | COPY_PHASE_STRIP = NO; 458 | DEBUG_INFORMATION_FORMAT = dwarf; 459 | ENABLE_STRICT_OBJC_MSGSEND = YES; 460 | ENABLE_TESTABILITY = YES; 461 | GCC_C_LANGUAGE_STANDARD = gnu99; 462 | GCC_DYNAMIC_NO_PIC = NO; 463 | GCC_NO_COMMON_BLOCKS = YES; 464 | GCC_OPTIMIZATION_LEVEL = 0; 465 | GCC_PREPROCESSOR_DEFINITIONS = ( 466 | "DEBUG=1", 467 | "$(inherited)", 468 | ); 469 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 470 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 471 | GCC_WARN_UNDECLARED_SELECTOR = YES; 472 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 473 | GCC_WARN_UNUSED_FUNCTION = YES; 474 | GCC_WARN_UNUSED_VARIABLE = YES; 475 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 476 | MTL_ENABLE_DEBUG_INFO = YES; 477 | ONLY_ACTIVE_ARCH = YES; 478 | SDKROOT = iphoneos; 479 | TARGETED_DEVICE_FAMILY = "1,2"; 480 | }; 481 | name = Debug; 482 | }; 483 | 97C147041CF9000F007C117D /* Release */ = { 484 | isa = XCBuildConfiguration; 485 | buildSettings = { 486 | ALWAYS_SEARCH_USER_PATHS = NO; 487 | CLANG_ANALYZER_NONNULL = YES; 488 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 489 | CLANG_CXX_LIBRARY = "libc++"; 490 | CLANG_ENABLE_MODULES = YES; 491 | CLANG_ENABLE_OBJC_ARC = YES; 492 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 493 | CLANG_WARN_BOOL_CONVERSION = YES; 494 | CLANG_WARN_COMMA = YES; 495 | CLANG_WARN_CONSTANT_CONVERSION = YES; 496 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 497 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 498 | CLANG_WARN_EMPTY_BODY = YES; 499 | CLANG_WARN_ENUM_CONVERSION = YES; 500 | CLANG_WARN_INFINITE_RECURSION = YES; 501 | CLANG_WARN_INT_CONVERSION = YES; 502 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 503 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 504 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 505 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 506 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 507 | CLANG_WARN_STRICT_PROTOTYPES = YES; 508 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 509 | CLANG_WARN_UNREACHABLE_CODE = YES; 510 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 511 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 512 | COPY_PHASE_STRIP = NO; 513 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 514 | ENABLE_NS_ASSERTIONS = NO; 515 | ENABLE_STRICT_OBJC_MSGSEND = YES; 516 | GCC_C_LANGUAGE_STANDARD = gnu99; 517 | GCC_NO_COMMON_BLOCKS = YES; 518 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 519 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 520 | GCC_WARN_UNDECLARED_SELECTOR = YES; 521 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 522 | GCC_WARN_UNUSED_FUNCTION = YES; 523 | GCC_WARN_UNUSED_VARIABLE = YES; 524 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 525 | MTL_ENABLE_DEBUG_INFO = NO; 526 | SDKROOT = iphoneos; 527 | SUPPORTED_PLATFORMS = iphoneos; 528 | SWIFT_COMPILATION_MODE = wholemodule; 529 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 530 | TARGETED_DEVICE_FAMILY = "1,2"; 531 | VALIDATE_PRODUCT = YES; 532 | }; 533 | name = Release; 534 | }; 535 | 97C147061CF9000F007C117D /* Debug */ = { 536 | isa = XCBuildConfiguration; 537 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 538 | buildSettings = { 539 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 540 | CLANG_ENABLE_MODULES = YES; 541 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 542 | ENABLE_BITCODE = NO; 543 | INFOPLIST_FILE = Runner/Info.plist; 544 | LD_RUNPATH_SEARCH_PATHS = ( 545 | "$(inherited)", 546 | "@executable_path/Frameworks", 547 | ); 548 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 549 | PRODUCT_NAME = "$(TARGET_NAME)"; 550 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 551 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 552 | SWIFT_VERSION = 5.0; 553 | VERSIONING_SYSTEM = "apple-generic"; 554 | }; 555 | name = Debug; 556 | }; 557 | 97C147071CF9000F007C117D /* Release */ = { 558 | isa = XCBuildConfiguration; 559 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 560 | buildSettings = { 561 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 562 | CLANG_ENABLE_MODULES = YES; 563 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 564 | ENABLE_BITCODE = NO; 565 | INFOPLIST_FILE = Runner/Info.plist; 566 | LD_RUNPATH_SEARCH_PATHS = ( 567 | "$(inherited)", 568 | "@executable_path/Frameworks", 569 | ); 570 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 571 | PRODUCT_NAME = "$(TARGET_NAME)"; 572 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 573 | SWIFT_VERSION = 5.0; 574 | VERSIONING_SYSTEM = "apple-generic"; 575 | }; 576 | name = Release; 577 | }; 578 | /* End XCBuildConfiguration section */ 579 | 580 | /* Begin XCConfigurationList section */ 581 | 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { 582 | isa = XCConfigurationList; 583 | buildConfigurations = ( 584 | 331C8088294A63A400263BE5 /* Debug */, 585 | 331C8089294A63A400263BE5 /* Release */, 586 | 331C808A294A63A400263BE5 /* Profile */, 587 | ); 588 | defaultConfigurationIsVisible = 0; 589 | defaultConfigurationName = Release; 590 | }; 591 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 592 | isa = XCConfigurationList; 593 | buildConfigurations = ( 594 | 97C147031CF9000F007C117D /* Debug */, 595 | 97C147041CF9000F007C117D /* Release */, 596 | 249021D3217E4FDB00AE95B9 /* Profile */, 597 | ); 598 | defaultConfigurationIsVisible = 0; 599 | defaultConfigurationName = Release; 600 | }; 601 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 602 | isa = XCConfigurationList; 603 | buildConfigurations = ( 604 | 97C147061CF9000F007C117D /* Debug */, 605 | 97C147071CF9000F007C117D /* Release */, 606 | 249021D4217E4FDB00AE95B9 /* Profile */, 607 | ); 608 | defaultConfigurationIsVisible = 0; 609 | defaultConfigurationName = Release; 610 | }; 611 | /* End XCConfigurationList section */ 612 | }; 613 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 614 | } 615 | --------------------------------------------------------------------------------