summaryrefslogtreecommitdiff
path: root/lib/pages/delivery_login_page.dart
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-11-05 15:58:05 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-11-05 15:58:05 +0100
commit0b0168ac91c9b7f7896cb89436aa1dcf90605cf3 (patch)
treee6c25a6c618c6132c86d7133ae82554784213257 /lib/pages/delivery_login_page.dart
parentd3bf422afa275f8264a85c48c639576839f2f320 (diff)
fix shift delete bug
Diffstat (limited to 'lib/pages/delivery_login_page.dart')
-rw-r--r--lib/pages/delivery_login_page.dart79
1 files changed, 79 insertions, 0 deletions
diff --git a/lib/pages/delivery_login_page.dart b/lib/pages/delivery_login_page.dart
new file mode 100644
index 0000000..1724ba2
--- /dev/null
+++ b/lib/pages/delivery_login_page.dart
@@ -0,0 +1,79 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:training_planner/pages/agenda_page.dart';
+import 'package:training_planner/pages/developer_page.dart';
+import 'package:training_planner/pages/logbook_page.dart';
+import 'package:training_planner/pages/navigation_page.dart';
+import 'package:training_planner/pages/settings_page.dart';
+import 'package:training_planner/shift.dart';
+import 'package:training_planner/main.dart';
+import 'package:training_planner/style/style.dart';
+
+class DeliveryLoginPage extends StatefulWidget {
+ @override
+ _DeliveryLoginPageState createState() => _DeliveryLoginPageState();
+
+ const DeliveryLoginPage({Key? key}) : super(key: key);
+}
+
+class _DeliveryLoginPageState extends State<DeliveryLoginPage> {
+ final pnumberController = TextEditingController();
+ final daycodeController = TextEditingController();
+
+ @override
+ initState() {
+ super.initState();
+ }
+
+ _attemptLogin() async {
+ bool success = await remoteAuthService.authenticate(
+ pnumberController.text, daycodeController.text);
+ if (success) {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) => NavigationPage()),
+ );
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ children: [
+ Container(
+ width: 50,
+ ),
+ Expanded(
+ child: Column(
+ children: [
+ Padding(padding: EdgeInsets.all(50)),
+ TextField(
+ decoration: InputDecoration(labelText: "pnummer"),
+ keyboardType: TextInputType.number,
+ controller: pnumberController,
+ inputFormatters: <TextInputFormatter>[
+ FilteringTextInputFormatter.digitsOnly
+ ],
+ ),
+ Padding(padding: EdgeInsets.all(10)),
+ TextField(
+ decoration: InputDecoration(labelText: "dagcode"),
+ keyboardType: TextInputType.number,
+ controller: daycodeController,
+ inputFormatters: <TextInputFormatter>[
+ FilteringTextInputFormatter.digitsOnly
+ ],
+ ),
+ Padding(padding: EdgeInsets.all(10)),
+ OutlinedButton(
+ onPressed: () => _attemptLogin(), child: Text('Inloggen'))
+ ],
+ ),
+ ),
+ Container(
+ width: 50,
+ ),
+ ],
+ );
+ }
+}