InputField.phone constructor

InputField.phone({
  1. Key? key,
  2. TextEditingController? controller,
  3. String hintText = 'Phone number',
  4. ValueChanged<String>? onChanged,
  5. ValueChanged<String>? onSubmitted,
  6. String? errorText,
  7. bool enabled = true,
})

Implementation

factory InputField.phone({
  Key? key,
  TextEditingController? controller,
  String hintText = 'Phone number',
  ValueChanged<String>? onChanged,
  ValueChanged<String>? onSubmitted,
  String? errorText,
  bool enabled = true,
}) {
  return InputField(
    key: key,
    controller: controller,
    hintText: hintText,
    keyboardType: TextInputType.phone,
    textInputAction: TextInputAction.done,
    prefixIcon: Icons.phone_outlined,
    onChanged: onChanged,
    onSubmitted: onSubmitted,
    errorText: errorText,
    enabled: enabled,
    inputFormatters: [
      FilteringTextInputFormatter.digitsOnly,
      PhoneNumberFormatter(),
    ],
  );
}