pin_code_text_field 1.0.0 copy "pin_code_text_field: ^1.0.0" to clipboard
pin_code_text_field: ^1.0.0 copied to clipboard

outdated

It's a Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

pin_code_text_field #

It's a Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

Usage #

API #

name type default description
maxLength int 4 The total length of pin number & the number of pin boxes
hideCharacter bool false Show or hide the pin code
highlight bool false highlight the focused pin box
highlightColor Color Set color of the focused pin box
boxDecoration BoxDecoration Customization for the individual pin boxes.
pinTextStyle TextStyle TextStyle for styling pin characters
maskCharacter String "\u25CF" Special character to mask the pin code. Will only work if hideCharacter is set to true
onDone void Function() Callback when the max length of pin code is reached.

Example #

class MyHomePageState extends State<MyHomePage> {
  TextEditingController controller = TextEditingController();
  String thisText = "234235";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("TEXT"),
      ),
      body: Container(
        child: Column(
          children: <Widget>[
            PinCodeTextField(
              controller: controller,
              hideCharacter: true,
              highlight: true,
              highlightColor: Colors.blue,
              maxLength: 5,
              maskCharacter: "☆",
              pinTextStyle: TextStyle(fontSize: 30.0),
            ),
            RaisedButton(
              onPressed: () {
                setState(() {
                  this.thisText = controller.text;
                });
              },
            ),
            Text(thisText)
          ],
        ),
      ),
    );
  }
}

Wishlist #

  1. Localization (L-R, R-L)
  2. Highlight properties

Star 🌟 to show support!

pin usage

More information #

documentation.

159
likes
0
pub points
97%
popularity

Publisher

unverified uploader

It's a Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on pin_code_text_field