Newer
Older
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class LoginPage extends StatefulWidget{
static String tag = 'login-page';
const LoginPage({Key? key}) : super(key: key);
@override
_LoginPageState createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
@override
Widget build(BuildContext context){
const logo = Hero(
tag: 'blabla',
child: CircleAvatar(
backgroundColor: Colors.transparent,
radius: 48.0,
child: Text('LOGIN'),
)
);
final email = TextFormField(
keyboardType: TextInputType.emailAddress,
autofocus: false,
decoration: InputDecoration(
hintText: 'sensor e-mail address',
contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0)
)
)
);
final password = TextFormField(
autofocus: false,
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
decoration: InputDecoration(
hintText: 'sensor password',
contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(32.0)
)
)
);
final loginButton = Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Material(
borderRadius: BorderRadius.circular(30.0),
shadowColor: Colors.lightBlueAccent.shade100,
elevation: 5.0,
child: MaterialButton(
minWidth: 200.0,
height: 42.0,
onPressed: (){
},
color: Colors.lightBlueAccent,
child: const Text('Log In', style: TextStyle(color: Colors.white)),
),
),
);
final forgotLabel = FlatButton(
onPressed: () { },
child: const Text('Forgot password?',
style: TextStyle(color: Colors.black54),
),
);
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: ListView(
shrinkWrap: true,
padding: const EdgeInsets.only(left: 24.0, right: 24.0),
children: <Widget>[
logo,
const SizedBox(height: 48.0),
email,
const SizedBox(height: 8.0),
password,
const SizedBox(height: 24.0),
loginButton,
forgotLabel
],
)
)
);
}
}