ArcaneFormattedInput.date constructor

ArcaneFormattedInput.date({
  1. String? initialMonth,
  2. String? initialDay,
  3. String? initialYear,
  4. void onChanged(
    1. FormattedValue value
    )?,
  5. String? label,
  6. String? error,
  7. bool disabled = false,
})

Implementation

factory ArcaneFormattedInput.date({
  String? initialMonth,
  String? initialDay,
  String? initialYear,
  void Function(FormattedValue value)? onChanged,
  String? label,
  String? error,
  bool disabled = false,
}) {
  return ArcaneFormattedInput(
    initialValue: FormattedValue([
      const InputPart.editable(length: 2, width: 40, placeholder: 'MM', inputType: 'number')
          .withValue(initialMonth ?? ''),
      const InputPart.static('/'),
      const InputPart.editable(length: 2, width: 40, placeholder: 'DD', inputType: 'number')
          .withValue(initialDay ?? ''),
      const InputPart.static('/'),
      const InputPart.editable(length: 4, width: 60, placeholder: 'YYYY', inputType: 'number')
          .withValue(initialYear ?? ''),
    ]),
    onChanged: onChanged,
    label: label ?? 'Date',
    error: error,
    disabled: disabled,
  );
}