Farbe + width
This commit is contained in:
@@ -7,26 +7,34 @@ class LoginPage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final width = MediaQuery.of(context).size.width;
|
||||||
TextEditingController username = TextEditingController();
|
TextEditingController username = TextEditingController();
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Column(
|
child: SizedBox(
|
||||||
children: [
|
width: width / 2,
|
||||||
TextField(
|
child: Column(
|
||||||
controller: username,
|
children: [
|
||||||
decoration: const InputDecoration(
|
const Text('Please enter your first name',
|
||||||
label: Text('Username!'),
|
style: TextStyle(
|
||||||
|
color: Colors.pink,
|
||||||
|
)),
|
||||||
|
TextField(
|
||||||
|
controller: username,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
label: Text('Username!'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
TextButton(
|
||||||
TextButton(
|
onPressed: () => DbHelper.login(username.text),
|
||||||
onPressed: () => DbHelper.login(username.text),
|
child: const Text('Login'),
|
||||||
child: const Text('Login'),
|
),
|
||||||
),
|
TextButton(
|
||||||
TextButton(
|
onPressed: () => DbHelper.logout(),
|
||||||
onPressed: () => DbHelper.logout(),
|
child: const Text('Logout'),
|
||||||
child: const Text('Logout'),
|
)
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user