1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-23 13:50:19 +01:00
git-touch-android-ios-app/lib/screens/about.dart

77 lines
2.1 KiB
Dart
Raw Normal View History

2020-01-04 06:28:29 +01:00
import 'package:flutter/material.dart';
2020-01-12 07:49:46 +01:00
import 'package:git_touch/models/theme.dart';
2020-01-04 06:28:29 +01:00
import 'package:git_touch/scaffolds/single.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/table_view.dart';
import 'package:launch_review/launch_review.dart';
import 'package:package_info/package_info.dart';
2020-01-12 07:49:46 +01:00
import 'package:provider/provider.dart';
2020-01-04 06:28:29 +01:00
final aboutRouter = RouterScreen(
'/about',
(context, parameters) {
return AboutScreen();
},
);
class AboutScreen extends StatefulWidget {
@override
_AboutScreenState createState() => _AboutScreenState();
}
class _AboutScreenState extends State<AboutScreen> {
var _version = '';
@override
void initState() {
super.initState();
PackageInfo.fromPlatform().then((info) {
setState(() {
_version = info.version;
});
});
}
@override
Widget build(BuildContext context) {
2020-01-12 07:49:46 +01:00
final theme = Provider.of<ThemeModel>(context);
2020-01-04 06:28:29 +01:00
return SingleScaffold(
title: AppBarTitle('About'),
body: Column(
children: <Widget>[
SizedBox(height: 32),
2020-01-12 07:49:46 +01:00
ClipRRect(
borderRadius: BorderRadius.circular(24),
child: Image.asset(
'images/icon.png',
width: 96,
),
),
SizedBox(height: 12),
Text(
'GitTouch',
2020-01-27 08:11:51 +01:00
style: TextStyle(fontSize: 20, color: theme.palette.text),
2020-01-04 06:28:29 +01:00
),
2020-01-12 07:49:46 +01:00
SizedBox(height: 48),
2020-01-04 06:28:29 +01:00
TableView(items: [
TableViewItem(text: Text('Version'), rightWidget: Text(_version)),
TableViewItem(text: Text('Source Code'), url: '/pd4d10/git-touch'),
TableViewItem(
text: Text('Feedback'), url: '/pd4d10/git-touch/issues/new'),
TableViewItem(
text: Text('Rate This App'),
onTap: () {
LaunchReview.launch(
androidAppId: 'io.github.pd4d10.gittouch',
iOSAppId: '1452042346',
);
},
),
]),
],
),
);
}
}