From a5d4fc9fd756411eecd60548881abe0610061334 Mon Sep 17 00:00:00 2001 From: danoetz Date: Wed, 14 Sep 2022 11:43:13 +0700 Subject: [PATCH 1/4] fix divider position --- lib/widget/date_picker_widget.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/widget/date_picker_widget.dart b/lib/widget/date_picker_widget.dart index 3e1cf36..72306cc 100644 --- a/lib/widget/date_picker_widget.dart +++ b/lib/widget/date_picker_widget.dart @@ -218,7 +218,9 @@ class _DatePickerWidgetState extends State { ), Positioned( child: Container( - margin: const EdgeInsets.only(top: 63), + margin: EdgeInsets.only( + top: (widget.pickerTheme!.pickerHeight / 2) - + (widget.pickerTheme!.itemHeight / 2)), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -237,7 +239,9 @@ class _DatePickerWidgetState extends State { ), Positioned( child: Container( - margin: const EdgeInsets.only(top: 99), + margin: EdgeInsets.only( + top: (widget.pickerTheme!.pickerHeight / 2) + + (widget.pickerTheme!.itemHeight / 2)), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ From 792a077fe8362d1de3668e63da5ec87a2e710609 Mon Sep 17 00:00:00 2001 From: danoetz Date: Tue, 27 Dec 2022 06:46:26 +0700 Subject: [PATCH 2/4] rename package --- .gitignore | 1 + README.md | 4 ++-- example/lib/date_testing.dart | 2 +- example/lib/main.dart | 4 ++-- example/pubspec.yaml | 4 ++-- ..._date_picker.dart => flutter_holo_date_picker_widget.dart} | 2 +- pubspec.yaml | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) rename lib/{flutter_holo_date_picker.dart => flutter_holo_date_picker_widget.dart} (80%) diff --git a/.gitignore b/.gitignore index 7b5d0af..afbc08f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .buildlog/ .history .svn/ +.fvm/ # IntelliJ related *.iml diff --git a/README.md b/README.md index 7576916..c8fd979 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# flutter_holo_date_picker +# flutter_holo_date_picker_widget - A Flutter package of Datepicker inspired by the Holo Theme in Android. + This package is a clone of [flutter_holo_date_picker](https://pub.dev/packages/flutter_holo_date_picker) with small adjustment. ## Getting Started diff --git a/example/lib/date_testing.dart b/example/lib/date_testing.dart index 72b1057..34bb8a6 100644 --- a/example/lib/date_testing.dart +++ b/example/lib/date_testing.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_holo_date_picker/flutter_holo_date_picker.dart'; +import 'package:flutter_holo_date_picker_widget/flutter_holo_date_picker_widget.dart'; import 'package:intl/intl.dart'; class DateTesting extends StatefulWidget { diff --git a/example/lib/main.dart b/example/lib/main.dart index c15665f..3ca19e5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_holo_date_picker/flutter_holo_date_picker.dart'; +import 'package:flutter_holo_date_picker_widget/flutter_holo_date_picker_widget.dart'; void main() => runApp(MyApp()); @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget { // home: DateTesting(), home: Scaffold( appBar: AppBar( - title: Text('Holo Datepicker Example'), + title: Text('Holo Date Picker Example'), ), body: MyHomePage(), ), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index f985a3a..08107ea 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,5 +1,5 @@ name: holo_date_picker_example -description: flutter_holo_date_picker package exmaple project +description: flutter_holo_date_picker_widget package exmaple project # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -24,7 +24,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 - flutter_holo_date_picker: + flutter_holo_date_picker_widget: path: ../ intl: ^0.17.0 diff --git a/lib/flutter_holo_date_picker.dart b/lib/flutter_holo_date_picker_widget.dart similarity index 80% rename from lib/flutter_holo_date_picker.dart rename to lib/flutter_holo_date_picker_widget.dart index d823e4f..aa6163a 100644 --- a/lib/flutter_holo_date_picker.dart +++ b/lib/flutter_holo_date_picker_widget.dart @@ -1,4 +1,4 @@ -library flutter_holo_date_picker; +library flutter_holo_date_picker_widget; export 'date_picker.dart'; export 'i18n/date_picker_i18n.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index c242702..d4b06b4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ -name: flutter_holo_date_picker -description: A Flutter package of Datepicker that looks like Holo Theme in Android. +name: flutter_holo_date_picker_widget +description: A Clone of Flutter Holo Date Picker. version: 1.0.6 homepage: https://github.com/kfiross/flutter_holo_date_picker From 814df781b6834d2e0c0ca10429338631692ad56c Mon Sep 17 00:00:00 2001 From: danoetz Date: Tue, 27 Dec 2022 07:00:51 +0700 Subject: [PATCH 3/4] fix divider position --- CHANGELOG.md | 6 ++++++ pubspec.yaml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9647b4d..9fe01d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.1.1] +* Fix divider position. + +## [1.1.0] +* Merged issue #53 (Incorrect month selected not same on picker display). + ## [1.0.6] * Updated `DatePicker.localeFromString` function with the missing locales. diff --git a/pubspec.yaml b/pubspec.yaml index d4b06b4..92896aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_holo_date_picker_widget description: A Clone of Flutter Holo Date Picker. -version: 1.0.6 -homepage: https://github.com/kfiross/flutter_holo_date_picker +version: 1.1.1 +homepage: https://github.com/danoetz/flutter_holo_date_picker_widget environment: sdk: '>=2.12.0 <3.0.0' From 88c4940fa34c74a05f990367055a2430c67cb18b Mon Sep 17 00:00:00 2001 From: danoetz Date: Tue, 27 Dec 2022 07:13:57 +0700 Subject: [PATCH 4/4] fix deprecated code --- CHANGELOG.md | 3 +++ README.md | 4 +++- lib/date_picker.dart | 4 ++-- pubspec.yaml | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fe01d6..838678f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.1.2] +* Fix deprecated code. + ## [1.1.1] * Fix divider position. diff --git a/README.md b/README.md index c8fd979..cfbc01f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # flutter_holo_date_picker_widget - This package is a clone of [flutter_holo_date_picker](https://pub.dev/packages/flutter_holo_date_picker) with small adjustment. +A Flutter package of Datepicker inspired by the Holo Theme in Android. + +This package is a clone of [flutter_holo_date_picker](https://pub.dev/packages/flutter_holo_date_picker) with small adjustment. ## Getting Started diff --git a/lib/date_picker.dart b/lib/date_picker.dart index 18770b3..fbb3db8 100644 --- a/lib/date_picker.dart +++ b/lib/date_picker.dart @@ -129,14 +129,14 @@ class DatePicker { DateTime? _selectedDate = initialDate; final List listButtonActions = [ TextButton( - style: TextButton.styleFrom(primary: textColor), + style: TextButton.styleFrom(foregroundColor: textColor), child: Text(confirmText ?? "OK"), onPressed: () { Navigator.pop(context, _selectedDate); }, ), TextButton( - style: TextButton.styleFrom(primary: textColor), + style: TextButton.styleFrom(foregroundColor: textColor), child: Text(cancelText ?? "Cancel"), onPressed: () { Navigator.pop(context); diff --git a/pubspec.yaml b/pubspec.yaml index 92896aa..446d9d1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_holo_date_picker_widget -description: A Clone of Flutter Holo Date Picker. -version: 1.1.1 +description: A Clone of Flutter Holo Date Picker. A Flutter package of Datepicker inspired by the Holo Theme in Android. +version: 1.1.2 homepage: https://github.com/danoetz/flutter_holo_date_picker_widget environment: