flutter_pin_code_fields 2.2.0 flutter_pin_code_fields: ^2.2.0 copied to clipboard
A flutter package which will help you generate customizable pin code fields. Can be used for login pins or OTP.
Flutter Pin Code Fields Example #
Example on how to use the flutter_pin_code_fields package.
Getting Started #
Add dependency in pubspec.yaml
file.
dependencies:
flutter_pin_code_fields: <VERSION>
Examples #
Default Usage #
PinCodeFields(
length: 4,
onComplete: (output) {
// Your logic with pin code
print(output);
},
),
Obscure Fields #
PinCodeFields(
length: 6,
obscureText: true,
obscureCharacter: '❌',
onComplete: (output) {
// Your logic with pin code
print(output);
},
),
Customized Fields #
PinCodeFields(
length: 4,
fieldBorderStyle: FieldBorderStyle.Square,
responsive: false,
fieldHeight: 130.0,
fieldWidth: 130.0,
borderWidth: 5.0,
activeBorderColor: Colors.teal,
activeBackgroundColor: Colors.tealAccent,
borderRadius: BorderRadius.circular(20.0),
keyboardType: TextInputType.number,
autoHideKeyboard: false,
fieldBackgroundColor: Colors.lightGreenAccent,
borderColor: Colors.lightGreen,
textStyle: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
onComplete: (output) {
// Your logic with pin code
print(output);
},
),