-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.dart
80 lines (74 loc) · 2.12 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import 'package:flutter/material.dart';
import 'package:flutter_pin_code_widget/flutter_pin_code_widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData.dark(),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
actions: [
TextButton(
onPressed: () {},
child: const Text(
'Skip',
style: TextStyle(color: Colors.blueAccent),
))
],
),
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 40),
Text(
'Set up PIN',
style: Theme.of(context).textTheme.headline4,
),
const SizedBox(height: 20),
const Text('You can use this PIN to unlock the app..'),
const Text('Pin length is 4-25 digits'),
const SizedBox(height: 60),
Expanded(
child: PinCodeWidget(
minPinLength: 4,
maxPinLength: 25,
onChangedPin: (pin) {
// check the PIN length and check different PINs with 4,5.. length.
},
onEnter: (pin, _) {
// callback user pressed enter
},
centerBottomWidget: IconButton(
icon: const Icon(
Icons.fingerprint,
size: 40,
),
onPressed: () {},
),
),
),
],
),
),
);
}
}