1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +00:00

Can launch tour from settings

This commit is contained in:
Pierre HUBERT 2021-04-18 14:09:48 +02:00
parent 532d2412e3
commit 91139e25db

View File

@ -1,3 +1,4 @@
import 'package:comunic/ui/routes/TourRoute.dart';
import 'package:comunic/ui/routes/settings/account_image_settings.dart'; import 'package:comunic/ui/routes/settings/account_image_settings.dart';
import 'package:comunic/ui/routes/settings/account_privacy_settings.dart'; import 'package:comunic/ui/routes/settings/account_privacy_settings.dart';
import 'package:comunic/ui/routes/settings/account_security_settings.dart'; import 'package:comunic/ui/routes/settings/account_security_settings.dart';
@ -11,6 +12,8 @@ import 'package:comunic/utils/ui_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:settings_ui/settings_ui.dart'; import 'package:settings_ui/settings_ui.dart';
enum _MainMenuActions { SHOW_TOUR }
/// Account settings route /// Account settings route
/// ///
/// @author Pierre HUBERT /// @author Pierre HUBERT
@ -38,10 +41,29 @@ class AccountSettingsRoute extends StatelessWidget {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(tr("Settings")), title: Text(tr("Settings")),
actions: [
PopupMenuButton<_MainMenuActions>(
onSelected: (v) => _doPopupMenuAction(context, v),
itemBuilder: (c) => [
PopupMenuItem(
value: _MainMenuActions.SHOW_TOUR,
child: Text(tr("See the tour again")),
),
]),
],
), ),
body: _AccountSettingsBody(), body: _AccountSettingsBody(),
); );
} }
void _doPopupMenuAction(BuildContext context, _MainMenuActions value) async {
switch (value) {
case _MainMenuActions.SHOW_TOUR:
Navigator.of(context)
.push(MaterialPageRoute(builder: (c) => TourRoute()));
break;
}
}
} }
class _AccountSettingsBody extends StatefulWidget { class _AccountSettingsBody extends StatefulWidget {