Skip to content

datetime_picker_theme conflict issue resolved #341

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>12.0</string>
</dict>
</plist>
14 changes: 6 additions & 8 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/liuyanbo/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/liuyanbo/Documents/GitHub/flutter_datetime_picker/example"
export "FLUTTER_TARGET=/Users/liuyanbo/Documents/GitHub/flutter_datetime_picker/example/lib/main.dart"
export "FLUTTER_ROOT=/Users/trdevendran/development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/trdevendran/Documents/workspace/flutter/plugins/flutter_datetime_picker/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/trdevendran/Documents/workspace/flutter/plugins/flutter_datetime_picker/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=/Users/liuyanbo/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9mNjM0NGI3NWRjZjg2MWQ4YmYxZjEzMjI3ODBiODgxMWY5ODJlMzFhLw=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/trdevendran/Documents/workspace/flutter/plugins/flutter_datetime_picker/example/.dart_tool/package_config.json"
11 changes: 7 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -140,7 +140,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -184,10 +184,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -198,6 +200,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -290,7 +293,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -337,7 +340,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 4 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class HomePage extends StatelessWidget {
showTitleActions: true,
minTime: DateTime(2018, 3, 5),
maxTime: DateTime(2019, 6, 7),
theme: DatePickerTheme(
theme: CustomDatePickerTheme(
headerColor: Colors.orange,
backgroundColor: Colors.blue,
itemStyle: TextStyle(
Expand Down
34 changes: 17 additions & 17 deletions lib/flutter_datetime_picker.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
library flutter_datetime_picker;

import 'dart:async';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
import 'package:flutter_datetime_picker/src/date_model.dart';
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
import 'package:flutter_datetime_picker/src/i18n_model.dart';

export 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
export 'package:flutter_datetime_picker/src/date_model.dart';
export 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
export 'package:flutter_datetime_picker/src/i18n_model.dart';

typedef DateChangedCallback(DateTime time);
Expand All @@ -30,7 +30,7 @@ class DatePicker {
DateCancelledCallback? onCancel,
locale: LocaleType.en,
DateTime? currentTime,
DatePickerTheme? theme,
CustomDatePickerTheme? theme,
}) async {
return await Navigator.push(
context,
Expand Down Expand Up @@ -65,7 +65,7 @@ class DatePicker {
DateCancelledCallback? onCancel,
locale: LocaleType.en,
DateTime? currentTime,
DatePickerTheme? theme,
CustomDatePickerTheme? theme,
}) async {
return await Navigator.push(
context,
Expand Down Expand Up @@ -98,7 +98,7 @@ class DatePicker {
DateCancelledCallback? onCancel,
locale: LocaleType.en,
DateTime? currentTime,
DatePickerTheme? theme,
CustomDatePickerTheme? theme,
}) async {
return await Navigator.push(
context,
Expand Down Expand Up @@ -132,7 +132,7 @@ class DatePicker {
DateCancelledCallback? onCancel,
locale: LocaleType.en,
DateTime? currentTime,
DatePickerTheme? theme,
CustomDatePickerTheme? theme,
}) async {
return await Navigator.push(
context,
Expand Down Expand Up @@ -166,7 +166,7 @@ class DatePicker {
DateCancelledCallback? onCancel,
locale: LocaleType.en,
BasePickerModel? pickerModel,
DatePickerTheme? theme,
CustomDatePickerTheme? theme,
}) async {
return await Navigator.push(
context,
Expand All @@ -191,21 +191,21 @@ class _DatePickerRoute<T> extends PopupRoute<T> {
this.onChanged,
this.onConfirm,
this.onCancel,
DatePickerTheme? theme,
CustomDatePickerTheme? theme,
this.barrierLabel,
this.locale,
RouteSettings? settings,
BasePickerModel? pickerModel,
}) : this.pickerModel = pickerModel ?? DatePickerModel(),
this.theme = theme ?? DatePickerTheme(),
this.theme = theme ?? CustomDatePickerTheme(),
super(settings: settings);

final bool? showTitleActions;
final DateChangedCallback? onChanged;
final DateChangedCallback? onConfirm;
final DateCancelledCallback? onCancel;
final LocaleType? locale;
final DatePickerTheme theme;
final CustomDatePickerTheme theme;
final BasePickerModel pickerModel;

@override
Expand Down Expand Up @@ -293,7 +293,7 @@ class _DatePickerState extends State<_DatePickerComponent> {

@override
Widget build(BuildContext context) {
DatePickerTheme theme = widget.route.theme;
CustomDatePickerTheme theme = widget.route.theme;
return GestureDetector(
child: AnimatedBuilder(
animation: widget.route.animation!,
Expand Down Expand Up @@ -326,7 +326,7 @@ class _DatePickerState extends State<_DatePickerComponent> {
}
}

Widget _renderPickerView(DatePickerTheme theme) {
Widget _renderPickerView(CustomDatePickerTheme theme) {
Widget itemView = _renderItemView(theme);
if (widget.route.showTitleActions == true) {
return Column(
Expand All @@ -341,7 +341,7 @@ class _DatePickerState extends State<_DatePickerComponent> {

Widget _renderColumnView(
ValueKey key,
DatePickerTheme theme,
CustomDatePickerTheme theme,
StringAtIndexCallBack stringAtIndexCB,
ScrollController scrollController,
int layoutProportion,
Expand Down Expand Up @@ -396,7 +396,7 @@ class _DatePickerState extends State<_DatePickerComponent> {
);
}

Widget _renderItemView(DatePickerTheme theme) {
Widget _renderItemView(CustomDatePickerTheme theme) {
return Container(
color: theme.backgroundColor,
child: Directionality(
Expand Down Expand Up @@ -471,7 +471,7 @@ class _DatePickerState extends State<_DatePickerComponent> {
}

// Title View
Widget _renderTitleActionsView(DatePickerTheme theme) {
Widget _renderTitleActionsView(CustomDatePickerTheme theme) {
final done = _localeDone();
final cancel = _localeCancel();

Expand Down Expand Up @@ -543,7 +543,7 @@ class _BottomPickerLayout extends SingleChildLayoutDelegate {
final double progress;
final int? itemCount;
final bool? showTitleActions;
final DatePickerTheme theme;
final CustomDatePickerTheme theme;
final double bottomPadding;

@override
Expand Down
4 changes: 2 additions & 2 deletions 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 DiagnosticableTreeMixin {
class CustomDatePickerTheme with DiagnosticableTreeMixin {
final TextStyle cancelStyle;
final TextStyle doneStyle;
final TextStyle itemStyle;
Expand All @@ -14,7 +14,7 @@ class DatePickerTheme with DiagnosticableTreeMixin {
final double titleHeight;
final double itemHeight;

const DatePickerTheme({
const CustomDatePickerTheme({
this.cancelStyle = const TextStyle(color: Colors.black54, fontSize: 16),
this.doneStyle = const TextStyle(color: Colors.blue, fontSize: 16),
this.itemStyle = const TextStyle(color: Color(0xFF000046), fontSize: 18),
Expand Down