DateTimeField constructor

DateTimeField({
  1. required String name,
  2. required DateTime? initialValue,
  3. @Deprecated('Fields should not be aware of their context') void onChanged(
    1. BuildContext context,
    2. DateTime? value
    )?,
  4. required DateTime start,
  5. 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);
          },
        ),
      );