DateTimeField constructor
DateTimeField({
- required String name,
- required DateTime? initialValue,
- @Deprecated('Fields should not be aware of their context') void onChanged(
- BuildContext context,
- DateTime? value
- required DateTime start,
- required DateTime end,
Implementation
DateTimeField({
required super.name,
required super.initialValue,
@Deprecated('Fields should not be aware of their context') super.onChanged,
required this.start,
required this.end,
}) : super(
type: FieldType.dateTime,
codec: FieldCodec<DateTime>(
toParam: (value) => value.toSimpleFormat(),
toValue: (param) {
return param == null ? null : DateTime.tryParse(param);
},
),
);