pin_input_text_field 0.2.0
pin_input_text_field: ^0.2.0 copied to clipboard
A textField widget to help display different style pin
pin_input_text_field #
A textField widget to help display different style pin
Example #
Decoration #
UnderlineDecoration
BoxLooseDecoration
BoxTightDecoration
ObscureStyle #
/// Determine whether replace [obscureText] with number.
final bool isTextObscure;
/// The display text when [isTextObscure] is true
final String obscureText;
Installing #
Install the latest version from pub.
Usage #
PinEditingController _pinEditingController = PinEditingController();
PinDecoration _pinDecoration = UnderlineDecoration(textStyle: _textStyle);
static final TextStyle _textStyle = TextStyle(
color: Colors.black,
fontSize: 24,
);
bool _obscureEnable = false;
PinEntryType _pinEntryType = PinEntryType.underline;
PinInputTextField(
pinLength: 4, /// The length of the pin.
decoration: _pinDecoration, /// Control the display of text and border.
pinEditingController: _pinEditingController, /// Control pin and observe pin.
autoFocus: true,
onSubmit: (pin) {
/// Add action to handle submit.
debugPrint('submit pin:$pin');
},
),