FormBuilderCupertinoDateTimePicker constructor Null safety

FormBuilderCupertinoDateTimePicker(
  1. {Key? key,
  2. required String name,
  3. FormFieldValidator<DateTime>? validator,
  4. DateTime? initialValue,
  5. InputDecoration decoration = const InputDecoration(),
  6. ValueChanged<DateTime?>? onChanged,
  7. ValueTransformer<DateTime?>? valueTransformer,
  8. bool enabled = true,
  9. FormFieldSetter<DateTime>? onSaved,
  10. AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
  11. VoidCallback? onReset,
  12. FocusNode? focusNode,
  13. Locale? locale,
  14. DateFormat? format,
  15. CupertinoDateTimePickerInputType inputType = CupertinoDateTimePickerInputType.both,
  16. DateTime? firstDate,
  17. DateTime? lastDate,
  18. bool alwaysUse24HourFormat = false,
  19. DatePickerTheme? theme,
  20. DateChangedCallback? onConfirm,
  21. DateCancelledCallback? onCancel,
  22. ValueChanged<DateTime>? onFieldSubmitted,
  23. TextEditingController? controller,
  24. TextInputType keyboardType = TextInputType.datetime,
  25. TextStyle? style,
  26. TextAlign textAlign = TextAlign.start,
  27. bool autofocus = false,
  28. bool obscureText = false,
  29. bool autocorrect = false,
  30. MaxLengthEnforcement maxLengthEnforcement = MaxLengthEnforcement.none,
  31. TextDirection? textDirection,
  32. int? maxLines,
  33. int? maxLength,
  34. List<TextInputFormatter>? inputFormatters,
  35. StrutStyle strutStyle = StrutStyle.disabled,
  36. TransitionBuilder? transitionBuilder,
  37. bool showCursor = false,
  38. int? minLines,
  39. bool expands = false,
  40. TextInputAction? textInputAction,
  41. VoidCallback? onEditingComplete,
  42. InputCounterWidgetBuilder? buildCounter,
  43. Radius? cursorRadius,
  44. Color? cursorColor,
  45. Brightness? keyboardAppearance,
  46. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  47. bool enableInteractiveSelection = false,
  48. double cursorWidth = 2.0,
  49. TextCapitalization textCapitalization = TextCapitalization.none}
)

Implementation

FormBuilderCupertinoDateTimePicker({
  Key? key,
  //From Super
  required String name,
  FormFieldValidator<DateTime>? validator,
  DateTime? initialValue,
  InputDecoration decoration = const InputDecoration(),
  ValueChanged<DateTime?>? onChanged,
  ValueTransformer<DateTime?>? valueTransformer,
  bool enabled = true,
  FormFieldSetter<DateTime>? onSaved,
  AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
  VoidCallback? onReset,
  FocusNode? focusNode,
  //
  this.locale,
  this.format,
  this.inputType = CupertinoDateTimePickerInputType.both,
  this.firstDate,
  this.lastDate,
  this.alwaysUse24HourFormat = false,
  this.theme,
  this.onConfirm,
  this.onCancel,

  //TextField options
  this.onFieldSubmitted,
  this.controller,
  this.keyboardType = TextInputType.datetime,
  this.style,
  this.textAlign = TextAlign.start,
  this.autofocus = false,
  this.obscureText = false,
  this.autocorrect = false,
  this.maxLengthEnforcement = MaxLengthEnforcement.none,
  this.textDirection,
  this.maxLines,
  this.maxLength,
  this.inputFormatters,
  this.strutStyle = StrutStyle.disabled,
  this.transitionBuilder,
  this.showCursor = false,
  this.minLines,
  this.expands = false,
  this.textInputAction,
  this.onEditingComplete,
  this.buildCounter,
  this.cursorRadius,
  this.cursorColor,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.enableInteractiveSelection = false,
  this.cursorWidth = 2.0,
  this.textCapitalization = TextCapitalization.none,
}) : super(
        key: key,
        initialValue: initialValue,
        name: name,
        validator: validator,
        valueTransformer: valueTransformer,
        onChanged: onChanged,
        autovalidateMode: autovalidateMode,
        onSaved: onSaved,
        enabled: enabled,
        onReset: onReset,
        decoration: decoration,
        focusNode: focusNode,
        builder: (FormFieldState<DateTime?> field) {
          final state = field as _FormBuilderCupertinoDateTimePickerState;

          return TextField(
            textDirection: textDirection,
            textAlign: textAlign,
            maxLength: maxLength,
            autofocus: autofocus,
            decoration: state.decoration,
            readOnly: true,
            enabled: state.enabled,
            autocorrect: autocorrect,
            controller: state._textFieldController,
            focusNode: state.effectiveFocusNode,
            inputFormatters: inputFormatters,
            keyboardType: keyboardType,
            maxLines: maxLines,
            obscureText: obscureText,
            showCursor: showCursor,
            minLines: minLines,
            expands: expands,
            style: style,
            onEditingComplete: onEditingComplete,
            buildCounter: buildCounter,
            cursorColor: cursorColor,
            cursorRadius: cursorRadius,
            cursorWidth: cursorWidth,
            enableInteractiveSelection: enableInteractiveSelection,
            keyboardAppearance: keyboardAppearance,
            scrollPadding: scrollPadding,
            strutStyle: strutStyle,
            textCapitalization: textCapitalization,
            textInputAction: textInputAction,
            maxLengthEnforcement: maxLengthEnforcement,
          );
        },
      );