mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Create application preferences route
This commit is contained in:
31
lib/ui/routes/app_settings_route.dart
Normal file
31
lib/ui/routes/app_settings_route.dart
Normal file
@ -0,0 +1,31 @@
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Application settings route
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class AppSettingsRoute extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(tr("App settings")),
|
||||
),
|
||||
body: _AppSettingsBody(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AppSettingsBody extends StatefulWidget {
|
||||
@override
|
||||
__AppSettingsBodyState createState() => __AppSettingsBodyState();
|
||||
}
|
||||
|
||||
class __AppSettingsBodyState extends State<_AppSettingsBody> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(children: <Widget>[],);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:comunic/helpers/account_helper.dart';
|
||||
import 'package:comunic/ui/routes/app_settings_route.dart';
|
||||
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';
|
||||
@ -50,6 +51,11 @@ class _HomeRouteState extends State<HomeRoute> {
|
||||
_openCurrentUserPage();
|
||||
break;
|
||||
|
||||
/// Open app settings page
|
||||
case BarCallbackActions.OPEN_APP_SETTINGS:
|
||||
_openAppSettings();
|
||||
break;
|
||||
|
||||
/// Logout user
|
||||
case BarCallbackActions.ACTION_LOGOUT:
|
||||
_logoutRequested();
|
||||
@ -111,6 +117,11 @@ class _HomeRouteState extends State<HomeRoute> {
|
||||
openUserPage(context: context, userID: userID());
|
||||
}
|
||||
|
||||
void _openAppSettings() {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (c) => AppSettingsRoute()));
|
||||
}
|
||||
|
||||
/// Handle logout requests from user
|
||||
Future<void> _logoutRequested() async {
|
||||
if (!await showConfirmDialog(
|
||||
|
Reference in New Issue
Block a user