DatePicker constructor

DatePicker({
  1. String? label,
  2. String? name,
  3. TextEditingController? controller,
  4. String? value,
  5. String? min,
  6. String? max,
  7. String? placeholder,
  8. List<DatePreset>? presets,
  9. bool required = false,
  10. bool disabled = false,
  11. bool readonly = false,
  12. InputVariant variant = InputVariant.outline,
  13. ComponentSize size = ComponentSize.md,
  14. String? error,
  15. FormErrors? errors,
  16. String? helpText,
  17. String? className,
  18. Map<String, Object?> props = const {},
  19. Map<String, Object?> inputProps = const {},
  20. Map<String, Object?> style = const {},
  21. Map<String, Object?> inputStyle = const {},
  22. DartStyle? dartStyle,
  23. DartStyle? inputDartStyle,
  24. void onChanged(
    1. Object event
    )?,
  25. void onDateSelected(
    1. String date
    )?,
})

Creates a date picker field.

Implementation

DatePicker({
  String? label,
  String? name,
  TextEditingController? controller,
  String? value,
  String? min,
  String? max,
  String? placeholder,
  List<DatePreset>? presets,
  bool required = false,
  bool disabled = false,
  bool readonly = false,
  InputVariant variant = InputVariant.outline,
  ComponentSize size = ComponentSize.md,
  String? error,
  FormErrors? errors,
  String? helpText,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> inputProps = const {},
  Map<String, Object?> style = const {},
  Map<String, Object?> inputStyle = const {},
  DartStyle? dartStyle,
  DartStyle? inputDartStyle,
  void Function(Object event)? onChanged,
  void Function(String date)? onDateSelected,
}) : super(
        'div',
        props: fieldWrapperProps(
          props: props,
          className: className,
          dartStyle: dartStyle,
          style: style,
        ),
        children: _children(
          label: label,
          name: name,
          value: controller?.text ?? value,
          min: min,
          max: max,
          placeholder: placeholder,
          presets: presets,
          required: required,
          disabled: disabled,
          readonly: readonly,
          variant: variant,
          size: size,
          error: resolveFieldError(name: name, error: error, errors: errors),
          helpText: helpText,
          inputProps: inputProps,
          inputStyle: inputStyle,
          inputDartStyle: inputDartStyle,
          onChanged:
              _controlledOnChanged(controller, onChanged, onDateSelected),
        ),
      );