ArcaneFormattedInput.phone constructor

ArcaneFormattedInput.phone({
  1. String? initialAreaCode,
  2. String? initialPrefix,
  3. String? initialLine,
  4. void onChanged(
    1. FormattedValue value
    )?,
  5. String? label,
  6. String? error,
  7. bool disabled = false,
})

Implementation

factory ArcaneFormattedInput.phone({
  String? initialAreaCode,
  String? initialPrefix,
  String? initialLine,
  void Function(FormattedValue value)? onChanged,
  String? label,
  String? error,
  bool disabled = false,
}) {
  return ArcaneFormattedInput(
    initialValue: FormattedValue([
      const InputPart.static('('),
      const InputPart.editable(length: 3, width: 45, placeholder: '000', inputType: 'tel')
          .withValue(initialAreaCode ?? ''),
      const InputPart.static(') '),
      const InputPart.editable(length: 3, width: 45, placeholder: '000', inputType: 'tel')
          .withValue(initialPrefix ?? ''),
      const InputPart.static('-'),
      const InputPart.editable(length: 4, width: 55, placeholder: '0000', inputType: 'tel')
          .withValue(initialLine ?? ''),
    ]),
    onChanged: onChanged,
    label: label ?? 'Phone',
    error: error,
    disabled: disabled,
  );
}