mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Added the "My Page" button to the new app bar
This commit is contained in:
@ -3,7 +3,9 @@ import 'package:comunic/ui/screens/conversations_list_screen.dart';
|
||||
import 'package:comunic/ui/screens/friends_list_screen.dart';
|
||||
import 'package:comunic/ui/screens/newest_posts.dart';
|
||||
import 'package:comunic/ui/widgets/navbar_widget.dart';
|
||||
import 'package:comunic/utils/account_utils.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:comunic/utils/navigation_utils.dart';
|
||||
import 'package:comunic/utils/ui_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@ -42,6 +44,13 @@ class _HomeRouteState extends State<HomeRoute> {
|
||||
void _onTap(BarCallbackActions action) {
|
||||
/// Check more quick actions
|
||||
switch (action) {
|
||||
|
||||
/// Open current user page
|
||||
case BarCallbackActions.OPEN_MY_PAGE:
|
||||
_openCurrentUserPage();
|
||||
break;
|
||||
|
||||
/// Logout user
|
||||
case BarCallbackActions.ACTION_LOGOUT:
|
||||
_logoutRequested();
|
||||
break;
|
||||
@ -97,6 +106,11 @@ class _HomeRouteState extends State<HomeRoute> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Open current user page
|
||||
Future<void> _openCurrentUserPage() async {
|
||||
openUserPage(context: context, userID: userID());
|
||||
}
|
||||
|
||||
/// Handle logout requests from user
|
||||
Future<void> _logoutRequested() async {
|
||||
if (!await showConfirmDialog(
|
||||
@ -106,7 +120,7 @@ class _HomeRouteState extends State<HomeRoute> {
|
||||
|
||||
await AccountHelper().signOut();
|
||||
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(builder: (c){
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(builder: (c) {
|
||||
return LoginRoute();
|
||||
}));
|
||||
}
|
||||
|
Reference in New Issue
Block a user