Skip to content

Commit

Permalink
Add About author screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
shoothzj committed Aug 2, 2021
1 parent 43d8dc4 commit dc94c08
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 7 deletions.
6 changes: 6 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class MessageLookup extends MessageLookupByLibrary {

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"aboutAuthor": MessageLookupByLibrary.simpleMessage("About author"),
"appName": MessageLookupByLibrary.simpleMessage("Paas Dashboard"),
"cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
"clearBacklog": MessageLookupByLibrary.simpleMessage("Clear Backlog"),
Expand All @@ -32,6 +33,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Delete Namespace"),
"deleteTenant": MessageLookupByLibrary.simpleMessage("Delete Tenant"),
"deleteTopic": MessageLookupByLibrary.simpleMessage("Delete Topic"),
"email": MessageLookupByLibrary.simpleMessage("email"),
"languageSettings":
MessageLookupByLibrary.simpleMessage("Language Settings"),
"name": MessageLookupByLibrary.simpleMessage("name"),
"namespaceName": MessageLookupByLibrary.simpleMessage("Namespace Name"),
"namespaces": MessageLookupByLibrary.simpleMessage("Namespaces"),
"refresh": MessageLookupByLibrary.simpleMessage("Refresh"),
Expand All @@ -41,6 +46,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Search by Tenant Name"),
"searchByTopic":
MessageLookupByLibrary.simpleMessage("Search by Topic Name"),
"settings": MessageLookupByLibrary.simpleMessage("Settings"),
"subscriptionName":
MessageLookupByLibrary.simpleMessage("Subscription Name"),
"subscriptions": MessageLookupByLibrary.simpleMessage("Subscriptions"),
Expand Down
5 changes: 5 additions & 0 deletions lib/generated/intl/messages_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class MessageLookup extends MessageLookupByLibrary {

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"aboutAuthor": MessageLookupByLibrary.simpleMessage("关于作者"),
"appName": MessageLookupByLibrary.simpleMessage("Paas 仪表盘"),
"cancel": MessageLookupByLibrary.simpleMessage("取消"),
"clearBacklog": MessageLookupByLibrary.simpleMessage("清理积压"),
Expand All @@ -30,12 +31,16 @@ class MessageLookup extends MessageLookupByLibrary {
"deleteNamespace": MessageLookupByLibrary.simpleMessage("删除命名空间"),
"deleteTenant": MessageLookupByLibrary.simpleMessage("删除租户"),
"deleteTopic": MessageLookupByLibrary.simpleMessage("删除 Topic"),
"email": MessageLookupByLibrary.simpleMessage("邮箱"),
"languageSettings": MessageLookupByLibrary.simpleMessage("语言设置"),
"name": MessageLookupByLibrary.simpleMessage("名称"),
"namespaceName": MessageLookupByLibrary.simpleMessage("命名空间名称"),
"namespaces": MessageLookupByLibrary.simpleMessage("命名空间列表"),
"refresh": MessageLookupByLibrary.simpleMessage("刷新"),
"searchByNamespace": MessageLookupByLibrary.simpleMessage("按命名空间名称搜索"),
"searchByTenant": MessageLookupByLibrary.simpleMessage("按租户名称搜索"),
"searchByTopic": MessageLookupByLibrary.simpleMessage("按 Topic 名称搜索"),
"settings": MessageLookupByLibrary.simpleMessage("设置"),
"subscriptionName": MessageLookupByLibrary.simpleMessage("订阅名称"),
"subscriptions": MessageLookupByLibrary.simpleMessage("订阅列表"),
"tenantName": MessageLookupByLibrary.simpleMessage("租户名称"),
Expand Down
50 changes: 50 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
"deleteTopic": "Delete Topic",
"clearBacklog": "Clear Backlog",
"subscriptions": "Subscriptions",
"subscriptionName": "Subscription Name"
"subscriptionName": "Subscription Name",
"aboutAuthor": "About author",
"settings": "Settings",
"languageSettings": "Language Settings",
"name": "name",
"email": "email"
}
7 changes: 6 additions & 1 deletion lib/l10n/intl_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
"deleteTopic": "删除 Topic",
"clearBacklog": "清理积压",
"subscriptions": "订阅列表",
"subscriptionName": "订阅名称"
"subscriptionName": "订阅名称",
"aboutAuthor": "关于作者",
"settings": "设置",
"languageSettings": "语言设置",
"name": "名称",
"email": "邮箱"
}
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:paas_dashboard_flutter/generated/l10n.dart';
import 'package:paas_dashboard_flutter/route/page_route_const.dart';
import 'package:paas_dashboard_flutter/route/route_gen.dart';
import 'package:paas_dashboard_flutter/ui/bk/bk_page.dart';
import 'package:paas_dashboard_flutter/ui/general/author_screen.dart';
import 'package:paas_dashboard_flutter/ui/general/settings_screen.dart';
import 'package:paas_dashboard_flutter/ui/home/home_page.dart';
import 'package:paas_dashboard_flutter/ui/pulsar/pulsar_page.dart';
Expand Down Expand Up @@ -48,6 +49,7 @@ class MyApp extends StatelessWidget {
initialRoute: PageRouteConst.Root,
routes: {
PageRouteConst.Root: (context) => HomePage(),
PageRouteConst.Author: (context) => AuthorScreen(),
PageRouteConst.Settings: (context) => ChangeNotifierProvider(
create: (context) => SettingsViewModel(),
child: SettingsScreen(),
Expand Down
6 changes: 6 additions & 0 deletions lib/module/author.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Author {
final String name;
final String email;

Author(this.name, this.email);
}
1 change: 1 addition & 0 deletions lib/route/page_route_const.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class PageRouteConst {
static const String Root = '/';
static const String Author = '/author';
static const String Settings = '/settings';
static const String Bookkeeper = '/bookkeeper';
static const String Pulsar = '/pulsar';
Expand Down
36 changes: 36 additions & 0 deletions lib/ui/general/author_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';
import 'package:paas_dashboard_flutter/generated/l10n.dart';
import 'package:paas_dashboard_flutter/module/author.dart';

class AuthorScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<Author> authors = [
Author('fu_turer', "futurer@outlook.com"),
Author('shoothzj', 'shoothzj@gmail.com')
];
List<String> name = ['fu_turer', 'shoothzj'];

return Scaffold(
appBar: AppBar(
title: Text(S.of(context).aboutAuthor),
),
body: Center(
child: DataTable(
showCheckboxColumn: false,
columns: [
DataColumn(label: Text(S.of(context).name)),
DataColumn(label: Text(S.of(context).email)),
],
rows: authors
.map((itemRow) =>
DataRow(onSelectChanged: (bool? selected) {}, cells: [
DataCell(Text(itemRow.name)),
DataCell(Text(itemRow.email)),
]))
.toList(),
),
),
);
}
}
5 changes: 3 additions & 2 deletions lib/ui/general/settings_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:paas_dashboard_flutter/generated/l10n.dart';
import 'package:paas_dashboard_flutter/vm/general/settings_view_model.dart';
import 'package:provider/provider.dart';

Expand Down Expand Up @@ -29,10 +30,10 @@ class SettingsScreenState extends State<SettingsScreen> {
final vm = Provider.of<SettingsViewModel>(context);
return Scaffold(
appBar: AppBar(
title: Text('Settings'),
title: Text(S.of(context).settings),
),
body: ExpansionTile(
title: Text('Change language'),
title: Text(S.of(context).languageSettings),
leading: Icon(Icons.language),
initiallyExpanded: false,
children: [
Expand Down
8 changes: 5 additions & 3 deletions lib/ui/home/home_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:paas_dashboard_flutter/generated/l10n.dart';
import 'package:paas_dashboard_flutter/route/page_route_const.dart';

class NavDrawer extends StatelessWidget {
Expand All @@ -21,11 +22,12 @@ class NavDrawer extends StatelessWidget {
'assets/images/background/joy_valley_slide.png'))),
),
ListTile(
title: Text('About author'),
onTap: () => {Navigator.of(context).pop()},
title: Text(S.of(context).aboutAuthor),
onTap: () =>
{Navigator.of(context).pushNamed(PageRouteConst.Author)},
),
ListTile(
title: Text('Settings'),
title: Text(S.of(context).settings),
onTap: () =>
{Navigator.of(context).pushNamed(PageRouteConst.Settings)},
),
Expand Down

0 comments on commit dc94c08

Please sign in to comment.