From 00cbac48585a33e9ea4c68ca41199a331a9ac299 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Thu, 26 Sep 2019 20:34:51 +0800 Subject: [PATCH] feat: add credits screen --- lib/screens/credits.dart | 45 +++++++++++++++++++++++++++++++++++++++ lib/screens/settings.dart | 5 +++++ 2 files changed, 50 insertions(+) create mode 100644 lib/screens/credits.dart diff --git a/lib/screens/credits.dart b/lib/screens/credits.dart new file mode 100644 index 0000000..75b53f4 --- /dev/null +++ b/lib/screens/credits.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:git_touch/scaffolds/single.dart'; +import 'package:git_touch/screens/repository.dart'; +import 'package:git_touch/widgets/table_view.dart'; +import 'package:tuple/tuple.dart'; + +class CreditsScreen extends StatelessWidget { + static const projects = [ + Tuple2('flutter', 'flutter/flutter'), + Tuple2('flutter_vector_icons', 'pd4d10/flutter-vector-icons'), + Tuple2('flutter_highlight', 'pd4d10/highlight'), + Tuple2('primer', 'pd4d10/primer-flutter'), + Tuple2('nanoid', 'pd4d10/nanoid-dart'), + Tuple2('github_contributions', 'pd4d10/github-contributions'), + Tuple2('seti', 'pd4d10/seti-flutter'), + Tuple2('http', 'dart-lang/http'), + Tuple2('intl', 'dart-lang/intl'), + Tuple2('url_launcher', 'flutter/plugins'), + Tuple2('uni_links', 'avioli/uni_links'), + Tuple2('flutter_markdown', 'flutter/flutter_markdown'), + Tuple2('shared_preferences', 'flutter/plugins'), + Tuple2('share', 'flutter/plugins'), + Tuple2('flutter_svg', 'dnfield/flutter_svg'), + Tuple2('launch_review', 'purus/launch_review'), + Tuple2('timeago', 'andresaraujo/timeago.dart'), + Tuple2('provider', 'rrousselGit/provider'), + Tuple2('filesize', 'synw/filesize'), + Tuple2('tuple', 'dart-lang/tuple'), + ]; + + @override + Widget build(BuildContext context) { + return SingleScaffold( + title: Text('Credits'), + body: TableView( + items: projects.map((t) { + return TableViewItem( + text: Text(t.item1), + screenBuilder: (_) => RepositoryScreen.fromFullName(t.item2), + ); + }), + ), + ); + } +} diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index 1dc9075..921b6d4 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:git_touch/models/theme.dart'; import 'package:git_touch/scaffolds/single.dart'; +import 'package:git_touch/screens/credits.dart'; import 'package:git_touch/screens/object.dart'; import 'package:git_touch/screens/repository.dart'; import 'package:git_touch/utils/utils.dart'; @@ -74,6 +75,10 @@ class SettingsScreen extends StatelessWidget { type: 'blob', ), ), + TableViewItem( + text: Text('Credits'), + screenBuilder: (_) => CreditsScreen(), + ), TableViewItem( text: Text('Rate This App'), onTap: () {