mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-27 16:24:07 +02:00
fix backbutton on homepage
This commit is contained in:
parent
cccfd3212e
commit
acf5341107
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mobile/pages/log_in_page.dart';
|
||||
import 'package:mobile/repos/user.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
@ -52,7 +53,9 @@ class SettingsMenuState extends State<SettingsMenu> {
|
||||
menuChildren: <Widget>[
|
||||
MenuItemButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.popUntil(context, (_) => false);
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (context) => const LogInPage()));
|
||||
},
|
||||
child: const Text('Log ud'),
|
||||
),
|
||||
|
@ -68,6 +68,7 @@ class LogInFormState extends State<LogInForm> {
|
||||
|
||||
if (loginResult is Ok) {
|
||||
setState(() => loginError = false);
|
||||
Navigator.of(context).popUntil((_) => false);
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
Dashboard(user: (loginResult as Ok).value)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user