chore: Archive button in main menu

This commit is contained in:
Christian Pauly 2021-04-09 17:43:12 +02:00
parent 29f8e05903
commit da3dc8078d
3 changed files with 17 additions and 7 deletions

View File

@ -117,8 +117,8 @@ class FluffyRoutes {
mainView: (_) => ChatList(), emptyView: (_) => EmptyPage()); mainView: (_) => ChatList(), emptyView: (_) => EmptyPage());
case 'archive': case 'archive':
return ViewData( return ViewData(
leftView: (_) => Settings(),
mainView: (_) => Archive(), mainView: (_) => Archive(),
emptyView: (_) => EmptyPage(),
); );
case 'logs': case 'logs':
return ViewData( return ViewData(

View File

@ -20,7 +20,7 @@ import '../utils/url_launcher.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
enum SelectMode { normal, share, select } enum SelectMode { normal, share, select }
enum PopupMenuAction { settings, invite, newGroup, setStatus } enum PopupMenuAction { settings, invite, newGroup, setStatus, archive }
class ChatList extends StatefulWidget { class ChatList extends StatefulWidget {
final String activeChat; final String activeChat;
@ -285,6 +285,10 @@ class _ChatListState extends State<ChatList> {
AdaptivePageLayout.of(context) AdaptivePageLayout.of(context)
.pushNamed('/newgroup'); .pushNamed('/newgroup');
break; break;
case PopupMenuAction.archive:
AdaptivePageLayout.of(context)
.pushNamed('/archive');
break;
} }
}, },
itemBuilder: (_) => [ itemBuilder: (_) => [
@ -321,6 +325,17 @@ class _ChatListState extends State<ChatList> {
], ],
), ),
), ),
PopupMenuItem(
value: PopupMenuAction.archive,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.archive_outlined),
SizedBox(width: 12),
Text(L10n.of(context).archive),
],
),
),
PopupMenuItem( PopupMenuItem(
value: PopupMenuAction.settings, value: PopupMenuAction.settings,
child: Row( child: Row(

View File

@ -468,11 +468,6 @@ class _SettingsState extends State<Settings> {
AdaptivePageLayout.of(context).pushNamed('/settings/emotes'), AdaptivePageLayout.of(context).pushNamed('/settings/emotes'),
trailing: Icon(Icons.insert_emoticon_outlined), trailing: Icon(Icons.insert_emoticon_outlined),
), ),
ListTile(
title: Text(L10n.of(context).archive),
onTap: () => AdaptivePageLayout.of(context).pushNamed('/archive'),
trailing: Icon(Icons.archive_outlined),
),
Divider(thickness: 1), Divider(thickness: 1),
ListTile( ListTile(
title: Text( title: Text(