diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index 671000be..5acc40fb 100755 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -1,11 +1,15 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/realank/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/realank/Documents/GitHub/flutter_datetime_picker/example" -export "FLUTTER_TARGET=/Users/realank/Documents/GitHub/flutter_datetime_picker/example/lib/main.dart" +export "FLUTTER_ROOT=/Users/mahmed/SDKs/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/mahmed/Developer/Dart/flutter_datetime_picker/example" +export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build/ios" -export "FLUTTER_FRAMEWORK_DIR=/Users/realank/flutter/bin/cache/artifacts/engine/ios" +export "OTHER_LDFLAGS=$(inherited) -framework Flutter" +export "FLUTTER_FRAMEWORK_DIR=/Users/mahmed/SDKs/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" -export "TRACK_WIDGET_CREATION=true" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 5a2f9976..c0032906 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -9,10 +9,6 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; @@ -28,8 +24,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -40,13 +34,11 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -60,8 +52,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -71,9 +61,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -206,7 +194,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 949b6789..00000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - BuildSystemType - Original - - diff --git a/lib/flutter_datetime_picker.dart b/lib/flutter_datetime_picker.dart index 6c1b8f63..9e83c5cb 100644 --- a/lib/flutter_datetime_picker.dart +++ b/lib/flutter_datetime_picker.dart @@ -21,6 +21,7 @@ class DatePicker { /// static Future showDatePicker( BuildContext context, { + String title = '', bool showTitleActions: true, DateTime minTime, DateTime maxTime, @@ -34,6 +35,7 @@ class DatePicker { return await Navigator.push( context, new _DatePickerRoute( + title: title, showTitleActions: showTitleActions, onChanged: onChanged, onConfirm: onConfirm, @@ -50,6 +52,7 @@ class DatePicker { /// static Future showTimePicker( BuildContext context, { + String title = '', bool showTitleActions: true, bool showSecondsColumn: true, DateChangedCallback onChanged, @@ -62,6 +65,7 @@ class DatePicker { return await Navigator.push( context, new _DatePickerRoute( + title: title, showTitleActions: showTitleActions, onChanged: onChanged, onConfirm: onConfirm, @@ -104,6 +108,7 @@ class DatePicker { /// static Future showDateTimePicker( BuildContext context, { + String title = '', bool showTitleActions: true, DateTime minTime, DateTime maxTime, @@ -117,6 +122,7 @@ class DatePicker { return await Navigator.push( context, new _DatePickerRoute( + title: title, showTitleActions: showTitleActions, onChanged: onChanged, onConfirm: onConfirm, @@ -133,6 +139,7 @@ class DatePicker { /// static Future showPicker( BuildContext context, { + String title = '', bool showTitleActions: true, DateChangedCallback onChanged, DateChangedCallback onConfirm, @@ -144,6 +151,7 @@ class DatePicker { return await Navigator.push( context, new _DatePickerRoute( + title: title, showTitleActions: showTitleActions, onChanged: onChanged, onConfirm: onConfirm, @@ -157,6 +165,7 @@ class DatePicker { class _DatePickerRoute extends PopupRoute { _DatePickerRoute({ + this.title, this.showTitleActions, this.onChanged, this.onConfirm, @@ -170,6 +179,7 @@ class _DatePickerRoute extends PopupRoute { this.theme = theme ?? DatePickerTheme(), super(settings: settings); + final String title; final bool showTitleActions; final DateChangedCallback onChanged; final DateChangedCallback onConfirm; @@ -272,7 +282,7 @@ class _DatePickerState extends State<_DatePickerComponent> { child: GestureDetector( child: Material( color: theme.backgroundColor ?? Colors.white, - child: _renderPickerView(theme), + child: _renderPickerView(theme, widget.route.title), ), ), ), @@ -288,12 +298,12 @@ class _DatePickerState extends State<_DatePickerComponent> { } } - Widget _renderPickerView(DatePickerTheme theme) { + Widget _renderPickerView(DatePickerTheme theme, String title) { Widget itemView = _renderItemView(theme); if (widget.route.showTitleActions) { return Column( children: [ - _renderTitleActionsView(theme), + _renderTitleActionsView(theme, title), itemView, ], ); @@ -422,7 +432,7 @@ class _DatePickerState extends State<_DatePickerComponent> { } // Title View - Widget _renderTitleActionsView(DatePickerTheme theme) { + Widget _renderTitleActionsView(DatePickerTheme theme, String title) { String done = _localeDone(); String cancel = _localeCancel(); @@ -433,6 +443,7 @@ class _DatePickerState extends State<_DatePickerComponent> { ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( height: theme.titleHeight, @@ -451,6 +462,15 @@ class _DatePickerState extends State<_DatePickerComponent> { }, ), ), + Container( + height: theme.titleHeight, + alignment: Alignment.center, + child: Text( + '$title', + textAlign: TextAlign.center, + style: theme.itemStyle, + ), + ), Container( height: theme.titleHeight, child: CupertinoButton( diff --git a/lib/src/datetime_picker_theme.dart b/lib/src/datetime_picker_theme.dart index 3b3fb9ea..53a3c343 100644 --- a/lib/src/datetime_picker_theme.dart +++ b/lib/src/datetime_picker_theme.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; // Migrate DiagnosticableMixin to Diagnosticable until // https://github.com/flutter/flutter/pull/51495 makes it into stable (v1.15.21) -class DatePickerTheme with DiagnosticableMixin { +class DatePickerTheme with Diagnosticable { final TextStyle cancelStyle; final TextStyle doneStyle; final TextStyle itemStyle;