Add register page
This commit is contained in:
parent
3bd2ba5cbc
commit
1c6fc39b14
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'register.dart';
|
||||
|
||||
class LoginPage extends StatefulWidget {
|
||||
const LoginPage({super.key, required this.title});
|
||||
@ -29,9 +30,12 @@ class _LoginPageState extends State<LoginPage> {
|
||||
const Text('Password'),
|
||||
const TextField(obscureText: true, enableSuggestions: false, autocorrect: false),
|
||||
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),
|
||||
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
48
Mobile/lib/register.dart
Normal 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')))
|
||||
),
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user