simple login screen
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'pages/login_page.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
@@ -11,10 +13,15 @@ class MyApp extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Briessenchecker',
|
title: 'Briessenchecker',
|
||||||
theme: ThemeData(
|
theme: ThemeData.dark(
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
|
).copyWith(
|
||||||
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||||||
),
|
),
|
||||||
|
initialRoute: LoginPage.routeName,
|
||||||
|
routes: {
|
||||||
|
LoginPage.routeName: (context) => const LoginPage(),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
lib/pages/login_page.dart
Normal file
35
lib/pages/login_page.dart
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class LoginPage extends StatelessWidget {
|
||||||
|
const LoginPage({super.key});
|
||||||
|
static const routeName = '/login';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
TextEditingController usernameController = TextEditingController();
|
||||||
|
TextEditingController passwordController = TextEditingController();
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
body: Form(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextFormField(
|
||||||
|
controller: usernameController,
|
||||||
|
decoration: const InputDecoration(label: Text('Username')),
|
||||||
|
),
|
||||||
|
TextFormField(
|
||||||
|
controller: passwordController,
|
||||||
|
decoration: const InputDecoration(label: Text('Password')),
|
||||||
|
),
|
||||||
|
FloatingActionButton.extended(
|
||||||
|
onPressed: _loginSubmitted, label: const Text('Login'))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _loginSubmitted() {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user