-
Notifications
You must be signed in to change notification settings - Fork 622
Expand file tree
/
Copy pathcreate_account.dart
More file actions
70 lines (63 loc) · 1.84 KB
/
create_account.dart
File metadata and controls
70 lines (63 loc) · 1.84 KB
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
import 'package:flutter/material.dart';
class CreateAccount extends StatefulWidget {
@override
_CreateAccountState createState() => _CreateAccountState();
}
class _CreateAccountState extends State<CreateAccount> {
final name = TextEditingController();
@override
void dispose() {
// Clean up the controller when the Widget is removed from the Widget tree
name.dispose();
super.dispose();
}
@override
Widget build(BuildContext context2) {
return Column(children: [
Padding(
padding: const EdgeInsets.only(top: 25.0),
child: Center(
child: Text(
"Create a username",
style: TextStyle(fontSize: 25.0),
),
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Container(
decoration: BoxDecoration(
border: Border.all(width: 1.0, color: Colors.black26),
borderRadius: BorderRadius.circular(7.0)),
child: TextField(
controller: name,
decoration: InputDecoration(
border: InputBorder.none,
contentPadding: const EdgeInsets.all(10.0),
labelText: "Username",
labelStyle: TextStyle(fontSize: 15.0)),
),
),
),
GestureDetector(
onTap: () {
if (name.text == null || name.text.length == 0){
return;
}
Navigator.pop(context, name.text);
},
child: Container(
width: 350.0,
height: 50.0,
child: Center(
child: Text(
"Next",
style: TextStyle(
color: Colors.white, fontSize: 15.0, fontWeight: FontWeight.bold),
)),
decoration: BoxDecoration(
color: Colors.blue, borderRadius: BorderRadius.circular(7.0)),
))
]);
}
}