otpInputDecoration method

  1. @override
InputDecoration otpInputDecoration({
  1. required String hint,
  2. String? label,
})
override

Decoration for the OTP input field.

Implementation

@override
InputDecoration otpInputDecoration({required String hint, String? label}) {
  UnderlineInputBorder line(Color c, [double w = 1]) => UnderlineInputBorder(
    borderSide: BorderSide(color: c, width: w),
  );
  return InputDecoration(
    hintText: hint,
    hintStyle: TextStyle(
      fontFamily: fontFamily,
      color: theme.onSurfaceMuted.withValues(alpha: 0.4),
      letterSpacing: 10,
    ),
    filled: false,
    contentPadding: const EdgeInsets.symmetric(vertical: 12),
    border: line(_ink.withValues(alpha: 0.25)),
    enabledBorder: line(_ink.withValues(alpha: 0.25)),
    focusedBorder: line(theme.primary, 1.5),
    errorBorder: line(Colors.redAccent),
    focusedErrorBorder: line(Colors.redAccent, 1.5),
  );
}