pinput 0.1.1
pinput: ^0.1.1 copied to clipboard
100% Dart based PIN input field widget for Flutter, this widget accepts string os any length and calls the onSubmit method when all fields are filled.
PinPut #
100% Dart based PIN input fiels for Flutter
Overview #
This widget accepts string os any length and calls the onSubmit method when all fields are filled. For now it has 4 properties: onSubmit, fontSize, isTextObscure and fieldsCount but more stuff comming soon

Contents: #
Installation #
Install the latest version from pub.
Example #
Import the package:
import 'package:flutter/material.dart';
import 'package:pinput/pinput.dart';
void main() => runApp(new PinPutTest());
class PinPutTest extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(primaryColor: Colors.green, hintColor: Colors.green),
home: Scaffold(
body: Builder(
builder: (context) => Center(
child: PinPut(
onSubmit: (pin) => _showSnackBar(pin, context),
),
),
)));
}
void _showSnackBar(String pin, context) {
final snackBar = SnackBar(
duration: Duration(seconds: 5),
content: Container(
height: 80.0,
child: Center(
child: Text(
'Pin Submitted. Value: $pin',
style: TextStyle(fontSize: 25.0),
),
)),
backgroundColor: Colors.greenAccent,
);
Scaffold.of(context).showSnackBar(snackBar);
}
}
Properties: #
Property | Default |
---|---|
onSubmit | Calls when field is submitted |
fieldsCount | Number of fields |
isTextObscure | true if it's pass |
fontSize | PIN forn size |