mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 08:44:06 +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:flutter/material.dart';
|
||||||
|
import 'package:mobile/pages/log_in_page.dart';
|
||||||
import 'package:mobile/repos/user.dart';
|
import 'package:mobile/repos/user.dart';
|
||||||
|
|
||||||
class HomePage extends StatelessWidget {
|
class HomePage extends StatelessWidget {
|
||||||
@ -52,7 +53,9 @@ class SettingsMenuState extends State<SettingsMenu> {
|
|||||||
menuChildren: <Widget>[
|
menuChildren: <Widget>[
|
||||||
MenuItemButton(
|
MenuItemButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.popUntil(context, (_) => false);
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(builder: (context) => const LogInPage()));
|
||||||
},
|
},
|
||||||
child: const Text('Log ud'),
|
child: const Text('Log ud'),
|
||||||
),
|
),
|
||||||
|
@ -68,6 +68,7 @@ class LogInFormState extends State<LogInForm> {
|
|||||||
|
|
||||||
if (loginResult is Ok) {
|
if (loginResult is Ok) {
|
||||||
setState(() => loginError = false);
|
setState(() => loginError = false);
|
||||||
|
Navigator.of(context).popUntil((_) => false);
|
||||||
Navigator.of(context).push(MaterialPageRoute(
|
Navigator.of(context).push(MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
Dashboard(user: (loginResult as Ok).value)));
|
Dashboard(user: (loginResult as Ok).value)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user