DatePicker constructor
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 onChanged(
- Object event
- void onDateSelected(
- 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),
),
);