ugly login page and dbhelper

This commit is contained in:
SomnusVeritas
2023-10-20 17:26:56 +02:00
parent 9bc3a8366a
commit 1148d79279
5 changed files with 84 additions and 3 deletions

34
lib/pages/login_page.dart Normal file
View File

@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import '../services/db_helper.dart';
class LoginPage extends StatelessWidget {
const LoginPage({super.key});
@override
Widget build(BuildContext context) {
TextEditingController username = TextEditingController();
return Scaffold(
body: Center(
child: Column(
children: [
TextField(
controller: username,
decoration: const InputDecoration(
label: Text('Username'),
),
),
TextButton(
onPressed: () => DbHelper.login(username.text),
child: const Text('Login'),
),
TextButton(
onPressed: () => DbHelper.logout(),
child: const Text('Logout'),
)
],
),
),
);
}
}