Browse Source

Add a basic about page with build information

pull/107/head
James Mills 2 months ago
parent
commit
56ec28f4ff
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 6
      ios/Podfile.lock
  2. 65
      lib/screens/about.dart
  3. 4
      lib/screens/auth_widget.dart
  4. 2
      lib/strings.dart
  5. 2
      lib/widgets/common_widgets.dart
  6. 42
      pubspec.lock
  7. 1
      pubspec.yaml

6
ios/Podfile.lock

@ -9,6 +9,8 @@ PODS:
- Flutter
- package_info (0.0.1):
- Flutter
- package_info_plus (0.4.5):
- Flutter
- path_provider (0.0.1):
- Flutter
- share (0.0.1):
@ -28,6 +30,7 @@ DEPENDENCIES:
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- share (from `.symlinks/plugins/share/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
@ -48,6 +51,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
share:
@ -67,6 +72,7 @@ SPEC CHECKSUMS:
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_picker: 9aa50e1d8cdacdbed739e925b7eea16d014367e6
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider: d1e9807085df1f9cc9318206cd649dc0b76be3de
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
shared_preferences: 5033afbb22d372e15aff8ff766df9021b845f273

65
lib/screens/about.dart

@ -0,0 +1,65 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:goryon/widgets/common_widgets.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/src/provider.dart';
import '../strings.dart';
class About extends StatefulWidget {
static const String routePath = "/about";
About({Key? key}) : super(key: key);
@override
_AboutState createState() => _AboutState();
}
class _AboutState extends State<About> {
PackageInfo _packageInfo = PackageInfo(
appName: 'Unknown',
packageName: 'Unknown',
version: 'Unknown',
buildNumber: 'Unknown',
buildSignature: 'Unknown',
);
@override
void initState() {
super.initState();
_initPackageInfo();
}
Future<void> _initPackageInfo() async {
final info = await PackageInfo.fromPlatform();
setState(() {
_packageInfo = info;
});
}
Widget _infoTile(String title, String subtitle) {
return ListTile(
title: Text(title),
subtitle: Text(subtitle.isEmpty ? 'Not set' : subtitle),
);
}
@override
Widget build(BuildContext context) {
final appStrings = context.watch<AppStrings>();
return Scaffold(
drawer: AppDrawer(activatedRoute: About.routePath),
appBar: AppBar(title: Text(appStrings.about)),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_infoTile('App name', _packageInfo.appName),
_infoTile('Package name', _packageInfo.packageName),
_infoTile('App version', _packageInfo.version),
_infoTile('Build number', _packageInfo.buildNumber),
_infoTile('Build signature', _packageInfo.buildSignature),
],
),
);
}
}

4
lib/screens/auth_widget.dart

@ -6,6 +6,7 @@ import 'package:provider/provider.dart';
import '../api.dart';
import '../models.dart';
import '../viewmodels.dart';
import 'about.dart';
import 'discover.dart';
import 'follow.dart';
import 'login.dart';
@ -99,6 +100,9 @@ class _HomeState extends State<Home> {
case Settings.routePath:
builder = (_) => Settings();
break;
case About.routePath:
builder = (_) => About();
break;
default:
throw Exception('Invalid route: ${settings.name}');
}

2
lib/strings.dart

@ -28,4 +28,6 @@ class AppStrings {
String timeline = "Timeline";
String newpost = "New Post";
String about = "About";
}

2
lib/widgets/common_widgets.dart

@ -22,6 +22,7 @@ import '../screens/follow.dart';
import '../screens/mentions.dart';
import '../screens/newtwt.dart';
import '../screens/settings.dart';
import '../screens/about.dart';
import '../screens/timeline.dart';
import '../screens/videoscreen.dart';
import '../viewmodels.dart';
@ -185,6 +186,7 @@ class AppDrawer extends StatelessWidget {
buildListTile(context, 'Follow', Follow.routePath),
buildListTile(context, 'Mentions', Mentions.routePath),
buildListTile(context, 'Settings', Settings.routePath),
buildListTile(context, "About", About.routePath),
ListTile(
title: Text('Log Out'),
trailing: Icon(Icons.logout),

42
pubspec.lock

@ -457,6 +457,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
package_info_plus_linux:
dependency: transitive
description:
name: package_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
package_info_plus_macos:
dependency: transitive
description:
name: package_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
package_info_plus_web:
dependency: transitive
description:
name: package_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
package_info_plus_windows:
dependency: transitive
description:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
path:
dependency: "direct main"
description:

1
pubspec.yaml

@ -53,6 +53,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.3
package_info_plus: ^1.3.0
dev_dependencies:
build_runner: ^2.1.4

Loading…
Cancel
Save