From 91139e25db5e7fa3520360e53000621a341d7a5e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 18 Apr 2021 14:09:48 +0200 Subject: [PATCH] Can launch tour from settings --- .../settings/account_settings_route.dart | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/ui/routes/settings/account_settings_route.dart b/lib/ui/routes/settings/account_settings_route.dart index d3cf3eb..29750b9 100644 --- a/lib/ui/routes/settings/account_settings_route.dart +++ b/lib/ui/routes/settings/account_settings_route.dart @@ -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_privacy_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:settings_ui/settings_ui.dart'; +enum _MainMenuActions { SHOW_TOUR } + /// Account settings route /// /// @author Pierre HUBERT @@ -38,10 +41,29 @@ class AccountSettingsRoute extends StatelessWidget { return Scaffold( appBar: AppBar( 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(), ); } + + 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 {