Added the 24Hr Format
Added the 24Hr Format
This commit is contained in:
parent
bf47b6c6c6
commit
d10bb24830
4 changed files with 14 additions and 6 deletions
|
@ -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,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
|
|
10
pubspec.lock
10
pubspec.lock
|
@ -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"
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue