Commit a360fc24 authored by Wilko Manger's avatar Wilko Manger

Add navigation drawer and redefine terminology

parent 1f56162b
{
"@@last_modified": "2020-03-23T21:58:49.230276",
"@@last_modified": "2020-03-25T20:06:47.053234",
"appName": "Pattle",
"@appName": {
"type": "text",
......@@ -238,13 +238,13 @@
"count": {}
}
},
"_Chats_personal": "Personal",
"@_Chats_personal": {
"_Chats_chats": "Chats",
"@_Chats_chats": {
"type": "text",
"placeholders": {}
},
"_Chats_public": "Public",
"@_Chats_public": {
"_Chats_channels": "Channels",
"@_Chats_channels": {
"type": "text",
"placeholders": {}
},
......
......@@ -639,18 +639,26 @@ class _Chats extends _Category {
: newGroup = _ChatsNewGroup(localeName),
super(localeName);
String get personal {
String get chats {
return Intl.message(
'Personal',
name: '_Chats_personal',
'Chats',
name: '_Chats_chats',
locale: _localeName,
);
}
String get public {
String get channels {
return Intl.message(
'Public',
name: '_Chats_public',
'Channels',
name: '_Chats_channels',
locale: _localeName,
);
}
String get newChannel {
return Intl.message(
'New channel',
name: '_Chats_newChannel',
locale: _localeName,
);
}
......
......@@ -105,8 +105,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Group name"),
"_ChatsNewGroup_title":
MessageLookupByLibrary.simpleMessage("New group"),
"_Chats_personal": MessageLookupByLibrary.simpleMessage("Personal"),
"_Chats_public": MessageLookupByLibrary.simpleMessage("Public"),
"_Chats_channels": MessageLookupByLibrary.simpleMessage("Channels"),
"_Chats_chats": MessageLookupByLibrary.simpleMessage("Chats"),
"_Common_confirm": MessageLookupByLibrary.simpleMessage("Confirm"),
"_Common_name": MessageLookupByLibrary.simpleMessage("Name"),
"_Common_next": MessageLookupByLibrary.simpleMessage("Next"),
......
......@@ -17,7 +17,6 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/material.dart';
import 'package:mdi/mdi.dart';
import '../../../app.dart';
import '../../../resources/intl/localizations.dart';
......@@ -41,10 +40,6 @@ class ChatsPage extends StatefulWidget {
}
class _ChatsPageState extends State<ChatsPage> {
void _goToCreateGroup() {
Navigator.of(context).pushNamed(Routes.chatsNew);
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
......@@ -59,12 +54,6 @@ class _ChatsPageState extends State<ChatsPage> {
child: Scaffold(
appBar: AppBar(
title: Text(context.intl.appName),
actions: <Widget>[
IconButton(
icon: Icon(Icons.settings),
onPressed: () => Navigator.pushNamed(context, Routes.settings),
)
],
bottom: TabBar(
tabs: <Widget>[
Tab(
......@@ -73,7 +62,7 @@ class _ChatsPageState extends State<ChatsPage> {
children: <Widget>[
Icon(Icons.group),
SizedBox(width: 8),
Text(context.intl.chats.personal.toUpperCase()),
Text(context.intl.chats.chats.toUpperCase()),
],
),
),
......@@ -82,15 +71,16 @@ class _ChatsPageState extends State<ChatsPage> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(Mdi.bullhorn),
Icon(Icons.public),
SizedBox(width: 8),
Text(context.intl.chats.public.toUpperCase()),
Text(context.intl.chats.channels.toUpperCase()),
],
),
),
],
),
),
drawer: _Drawer(),
body: TabBarView(
children: <Widget>[
_ChatsTab(personal: true),
......@@ -98,7 +88,7 @@ class _ChatsPageState extends State<ChatsPage> {
],
),
floatingActionButton: FloatingActionButton(
onPressed: _goToCreateGroup,
onPressed: () => Navigator.of(context).pushNamed(Routes.chatsNew),
child: Icon(Icons.chat),
),
),
......@@ -124,3 +114,47 @@ class _ChatsTab extends StatelessWidget {
});
}
}
class _Drawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Container(),
),
ListTile(
leading: Icon(
Icons.group,
color: Theme.of(context).primaryColor,
),
title: Text(context.intl.chats.newGroup.title),
onTap: () => Navigator.of(context).pushNamed(Routes.chatsNew),
),
ListTile(
leading: Icon(
Icons.public,
color: Theme.of(context).primaryColor,
),
title: Text(context.intl.chats.newChannel),
onTap: () {},
),
Divider(),
ListTile(
leading: Icon(
Icons.settings,
color: Theme.of(context).primaryColor,
),
title: Text(context.intl.settings.title),
onTap: () => Navigator.pushNamed(context, Routes.settings),
),
],
),
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment