Add register page

This commit is contained in:
Reimar 2024-08-20 14:53:06 +02:00
parent 3bd2ba5cbc
commit 1c6fc39b14
Signed by: Reimar
GPG Key ID: 93549FA07F0AE268
2 changed files with 54 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'register.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
const LoginPage({super.key, required this.title}); const LoginPage({super.key, required this.title});
@ -29,9 +30,12 @@ class _LoginPageState extends State<LoginPage> {
const Text('Password'), const Text('Password'),
const TextField(obscureText: true, enableSuggestions: false, autocorrect: false), const TextField(obscureText: true, enableSuggestions: false, autocorrect: false),
const SizedBox(height: 30), const SizedBox(height: 30),
ElevatedButton(child: const Text('Login'), onPressed: () => Navigator.pop(context)), ElevatedButton(child: const Text('Log ind'), onPressed: () => Navigator.pop(context)),
const SizedBox(height: 10), const SizedBox(height: 10),
TextButton(child: const Text('Registrer konto'), onPressed: () {}) TextButton(
child: const Text('Registrer konto'),
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (context) => const RegisterPage(title: 'Registrer'))),
)
] ]
) )
) )

48
Mobile/lib/register.dart Normal file
View File

@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
import 'login.dart';
class RegisterPage extends StatefulWidget {
const RegisterPage({super.key, required this.title});
final String title;
@override
State<RegisterPage> createState() => _RegisterPageState();
}
class _RegisterPageState extends State<RegisterPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Container(
constraints: const BoxConstraints(minWidth: 100, maxWidth: 400),
child: Column(
children: [
const SizedBox(height: 80),
const Text('Brugernavn'),
const TextField(),
const SizedBox(height: 30),
const Text('Email'),
const TextField(),
const SizedBox(height: 30),
const Text('Password'),
const TextField(obscureText: true, enableSuggestions: false, autocorrect: false),
const SizedBox(height: 30),
ElevatedButton(child: const Text('Registrer'), onPressed: () => Navigator.pop(context)),
const SizedBox(height: 10),
TextButton(
child: const Text('Log ind'),
onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (context) => const LoginPage(title: 'Log ind')))
),
]
)
)
)
);
}
}