Skip to content

Sync fork #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 1 addition & 13 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -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;
Expand All @@ -40,13 +34,11 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
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 = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand All @@ -60,8 +52,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -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 */,
Expand Down Expand Up @@ -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;
Expand Down

This file was deleted.

28 changes: 24 additions & 4 deletions lib/flutter_datetime_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DatePicker {
///
static Future<DateTime> showDatePicker(
BuildContext context, {
String title = '',
bool showTitleActions: true,
DateTime minTime,
DateTime maxTime,
Expand All @@ -34,6 +35,7 @@ class DatePicker {
return await Navigator.push(
context,
new _DatePickerRoute(
title: title,
showTitleActions: showTitleActions,
onChanged: onChanged,
onConfirm: onConfirm,
Expand All @@ -50,6 +52,7 @@ class DatePicker {
///
static Future<DateTime> showTimePicker(
BuildContext context, {
String title = '',
bool showTitleActions: true,
bool showSecondsColumn: true,
DateChangedCallback onChanged,
Expand All @@ -62,6 +65,7 @@ class DatePicker {
return await Navigator.push(
context,
new _DatePickerRoute(
title: title,
showTitleActions: showTitleActions,
onChanged: onChanged,
onConfirm: onConfirm,
Expand Down Expand Up @@ -104,6 +108,7 @@ class DatePicker {
///
static Future<DateTime> showDateTimePicker(
BuildContext context, {
String title = '',
bool showTitleActions: true,
DateTime minTime,
DateTime maxTime,
Expand All @@ -117,6 +122,7 @@ class DatePicker {
return await Navigator.push(
context,
new _DatePickerRoute(
title: title,
showTitleActions: showTitleActions,
onChanged: onChanged,
onConfirm: onConfirm,
Expand All @@ -133,6 +139,7 @@ class DatePicker {
///
static Future<DateTime> showPicker(
BuildContext context, {
String title = '',
bool showTitleActions: true,
DateChangedCallback onChanged,
DateChangedCallback onConfirm,
Expand All @@ -144,6 +151,7 @@ class DatePicker {
return await Navigator.push(
context,
new _DatePickerRoute(
title: title,
showTitleActions: showTitleActions,
onChanged: onChanged,
onConfirm: onConfirm,
Expand All @@ -157,6 +165,7 @@ class DatePicker {

class _DatePickerRoute<T> extends PopupRoute<T> {
_DatePickerRoute({
this.title,
this.showTitleActions,
this.onChanged,
this.onConfirm,
Expand All @@ -170,6 +179,7 @@ class _DatePickerRoute<T> extends PopupRoute<T> {
this.theme = theme ?? DatePickerTheme(),
super(settings: settings);

final String title;
final bool showTitleActions;
final DateChangedCallback onChanged;
final DateChangedCallback onConfirm;
Expand Down Expand Up @@ -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),
),
),
),
Expand All @@ -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: <Widget>[
_renderTitleActionsView(theme),
_renderTitleActionsView(theme, title),
itemView,
],
);
Expand Down Expand Up @@ -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();

Expand All @@ -433,6 +443,7 @@ class _DatePickerState extends State<_DatePickerComponent> {
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: theme.titleHeight,
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/datetime_picker_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down