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
* 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.dateTextStyle,
this.initialDate,
this.use24hFormat = false,
DateTime? firstDate,
DateTime? lastDate,
DateFormat? dateFormat,
@ -39,6 +40,7 @@ class DateTimeField extends StatelessWidget {
this.enabled,
this.initialDate,
this.dateTextStyle,
this.use24hFormat = false,
this.initialEntryMode = DatePickerEntryMode.calendar,
DateTime? firstDate,
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
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.
final DateTimeFieldPickerMode mode;
@ -112,6 +117,7 @@ class DateTimeField extends StatelessWidget {
initialDateTime: initialDateTime,
minimumDate: firstDate,
maximumDate: lastDate,
use24hFormat: use24hFormat,
),
);
},

View file

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

View file

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

View file

@ -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: 2.1.2
version: 2.1.3
homepage: 'https://github.com/GaspardMerten/date_field'
environment: