passcode 0.1.0 passcode: ^0.1.0 copied to clipboard
A Flutter widget for entering a passcode.
import 'package:flutter/material.dart';
import 'package:passcode/passcode.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
PasscodeTextField(
onTextChanged: (passcode) {
print(passcode);
},
totalCharacters: 4,
borderColor: Colors.black,
passcodeType: PasscodeType.number,
),
],
),
),
);
}
}