Field.date constructor
Field.date(
- String key, {
- dynamic value,
- FormValidator? validate,
- bool autofocus = false,
- String? dummyData,
- Widget? header,
- TextStyle? titleStyle,
- dynamic style,
- Map<
String, NyTextField Function(NyTextField nyTextField)> ? metaData = const {}, - TextStyle? dateTextStyle,
- VoidCallback? onTap,
- FocusNode? focusNode,
- bool? enableFeedback,
- EdgeInsetsGeometry? padding,
- bool hideDefaultSuffixIcon = false,
- DateTime? initialPickerDateTime,
- CupertinoDatePickerOptions? cupertinoDatePickerOptions,
- MaterialDatePickerOptions? materialDatePickerOptions,
- MaterialTimePickerOptions? materialTimePickerOptions,
- InputDecoration? decoration,
- DateFormat? dateFormat,
- DateTime? firstDate,
- DateTime? lastDate,
- DateTimeFieldPickerMode mode = DateTimeFieldPickerMode.dateAndTime,
- DateTimeFieldPickerPlatform pickerPlatform = DateTimeFieldPickerPlatform.adaptive,
Field.date is a constructor that helps in managing date fields
Implementation
Field.date(
this.key, {
this.value,
this.validate,
this.autofocus = false,
this.dummyData,
this.header,
this.footer,
this.titleStyle,
this.style,
this.metaData = const {},
this.hidden = false,
TextStyle? dateTextStyle,
VoidCallback? onTap,
FocusNode? focusNode,
bool? enableFeedback,
EdgeInsetsGeometry? padding,
bool hideDefaultSuffixIcon = false,
DateTime? initialPickerDateTime,
CupertinoDatePickerOptions? cupertinoDatePickerOptions,
MaterialDatePickerOptions? materialDatePickerOptions,
MaterialTimePickerOptions? materialTimePickerOptions,
InputDecoration? decoration,
intl.DateFormat? dateFormat,
DateTime? firstDate,
DateTime? lastDate,
DateTimeFieldPickerMode mode = DateTimeFieldPickerMode.dateAndTime,
DateTimeFieldPickerPlatform pickerPlatform =
DateTimeFieldPickerPlatform.adaptive,
}) : cast = FormCast.date(
style: dateTextStyle,
onTap: onTap,
focusNode: focusNode,
autofocus: autofocus,
enableFeedback: enableFeedback,
padding: padding,
hideDefaultSuffixIcon: hideDefaultSuffixIcon,
initialPickerDateTime: initialPickerDateTime,
cupertinoDatePickerOptions: cupertinoDatePickerOptions,
materialDatePickerOptions: materialDatePickerOptions,
materialTimePickerOptions: materialTimePickerOptions,
decoration: decoration,
dateFormat: dateFormat,
firstDate: firstDate,
lastDate: lastDate,
mode: mode,
pickerPlatform: pickerPlatform) {
if (style == null) return;
metaData = {};
if (style is String) {
style = style;
return;
}
if (style is Map) {
style as Map<String, dynamic>;
metaData!["decoration_style"] =
(style as Map<String, dynamic>).entries.first.value;
style = (style as Map<String, dynamic>).entries.first.key;
}
}