Merge pull request #22 from TheGlorySaint/master

This commit is contained in:
Gaspard Merten 2021-12-22 13:58:35 +01:00 committed by GitHub
commit e4bd1361d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,7 @@
##2.1.3
* [TheGlorySaint](https://github.com/TheGlorySaint) added the possibility to use the 24Hour Format at the Timepicker. Default it is set to false
##2.1.2 ##2.1.2
* Adding the possibility to specify the initial date selected in the date picker dialog. * Adding the possibility to specify the initial date selected in the date picker dialog.

View file

@ -23,6 +23,7 @@ class DateTimeField extends StatelessWidget {
this.initialEntryMode = DatePickerEntryMode.calendar, this.initialEntryMode = DatePickerEntryMode.calendar,
this.dateTextStyle, this.dateTextStyle,
this.initialDate, this.initialDate,
this.use24hFormat = false,
DateTime? firstDate, DateTime? firstDate,
DateTime? lastDate, DateTime? lastDate,
DateFormat? dateFormat, DateFormat? dateFormat,
@ -39,6 +40,7 @@ class DateTimeField extends StatelessWidget {
this.enabled, this.enabled,
this.initialDate, this.initialDate,
this.dateTextStyle, this.dateTextStyle,
this.use24hFormat = false,
this.initialEntryMode = DatePickerEntryMode.calendar, this.initialEntryMode = DatePickerEntryMode.calendar,
DateTime? firstDate, DateTime? firstDate,
DateTime? lastDate, DateTime? lastDate,
@ -76,6 +78,9 @@ class DateTimeField extends StatelessWidget {
/// Whether the field is usable. If false the user won't be able to select any date /// Whether the field is usable. If false the user won't be able to select any date
final bool? enabled; final bool? enabled;
/// Whether to use the 24Hr Format
final bool use24hFormat;
/// Whether to ask the user to pick only the date, the time or both. /// Whether to ask the user to pick only the date, the time or both.
final DateTimeFieldPickerMode mode; final DateTimeFieldPickerMode mode;
@ -112,6 +117,7 @@ class DateTimeField extends StatelessWidget {
initialDateTime: initialDateTime, initialDateTime: initialDateTime,
minimumDate: firstDate, minimumDate: firstDate,
maximumDate: lastDate, maximumDate: lastDate,
use24hFormat: use24hFormat,
), ),
); );
}, },

View file

@ -20,6 +20,7 @@ class DateTimeFormField extends FormField<DateTime> {
DateTime? initialValue, DateTime? initialValue,
AutovalidateMode? autovalidateMode, AutovalidateMode? autovalidateMode,
bool enabled = true, bool enabled = true,
bool use24hFormat = false,
TextStyle? dateTextStyle, TextStyle? dateTextStyle,
DateFormat? dateFormat, DateFormat? dateFormat,
DateTime? firstDate, DateTime? firstDate,
@ -63,6 +64,7 @@ class DateTimeFormField extends FormField<DateTime> {
onDateSelected: onChangedHandler, onDateSelected: onChangedHandler,
selectedDate: field.value, selectedDate: field.value,
enabled: enabled, enabled: enabled,
use24hFormat: use24hFormat,
mode: mode, mode: mode,
initialEntryMode: initialEntryMode, initialEntryMode: initialEntryMode,
dateTextStyle: dateTextStyle, dateTextStyle: dateTextStyle,

View file

@ -7,7 +7,7 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@ -40,14 +40,14 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0" version: "1.8.1"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -66,6 +66,6 @@ packages:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
sdks: sdks:
dart: ">=2.12.0 <3.0.0" dart: ">=2.14.0 <3.0.0"

View file

@ -1,6 +1,6 @@
name: date_field name: date_field
description: A widget in the form of a field that lets people choose a date, a time or both. description: A widget in the form of a field that lets people choose a date, a time or both.
version: 2.1.2 version: 2.1.3
homepage: 'https://github.com/GaspardMerten/date_field' homepage: 'https://github.com/GaspardMerten/date_field'
environment: environment: