From 546db9006ab2f47a5ce7497a84171af461d63906 Mon Sep 17 00:00:00 2001 From: Gaspard Merten Date: Thu, 28 Apr 2022 23:02:33 +0200 Subject: [PATCH] Fixing issue #29,adding 24h format support for material time picker dialog --- CHANGELOG.md | 4 ++++ lib/src/field.dart | 8 ++++++++ pubspec.yaml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 732f0bc..d56686a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +##3.0.1 + +* Fixing [issue #29](https://github.com/GaspardMerten/date_field/issues/29) -> adding 24h format support for material time picker dialog + ##3.0.0 * Breaking Upgraded minimum Dart version to 2.15 for Constructor Tearoff support diff --git a/lib/src/field.dart b/lib/src/field.dart index 0ae0a5c..9d9fc55 100644 --- a/lib/src/field.dart +++ b/lib/src/field.dart @@ -185,6 +185,14 @@ class DateTimeField extends StatelessWidget { return showTimePicker( initialTime: TimeOfDay.fromDateTime(initialDateTime), context: context, + builder: (BuildContext context, Widget? child) { + return MediaQuery( + data: MediaQuery.of(context).copyWith( + alwaysUse24HourFormat: use24hFormat, + ), + child: child!, + ); + }, ); } diff --git a/pubspec.yaml b/pubspec.yaml index a915e88..1fc091a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: date_field description: A widget in the form of a field that lets people choose a date, a time or both. -version: 3.0.0 +version: 3.0.1 homepage: 'https://github.com/GaspardMerten/date_field' environment: