✨ About page
This commit is contained in:
parent
78c0323908
commit
e88a0ddb22
@ -1,6 +1,7 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:solian/models/channel.dart';
|
||||
import 'package:solian/models/realm.dart';
|
||||
import 'package:solian/screens/about.dart';
|
||||
import 'package:solian/screens/account.dart';
|
||||
import 'package:solian/screens/account/friend.dart';
|
||||
import 'package:solian/screens/account/personalize.dart';
|
||||
@ -87,6 +88,11 @@ abstract class AppRouter {
|
||||
name: 'accountPersonalize',
|
||||
builder: (context, state) => const PersonalizeScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
builder: (context, state) => const AboutScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
ShellRoute(
|
||||
|
69
lib/screens/about.dart
Normal file
69
lib/screens/about.dart
Normal file
@ -0,0 +1,69 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class AboutScreen extends StatelessWidget {
|
||||
const AboutScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const denseButtonStyle =
|
||||
ButtonStyle(visualDensity: VisualDensity(vertical: -4));
|
||||
|
||||
return Material(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset('assets/logo.png', width: 64, height: 64),
|
||||
Text(
|
||||
'Solian',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
const Text(
|
||||
'The Solar Network',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
FutureBuilder(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
return Text(
|
||||
'v${snapshot.data!.version} · ${snapshot.data!.buildNumber}',
|
||||
style: const TextStyle(fontFamily: 'monospace'),
|
||||
);
|
||||
},
|
||||
),
|
||||
Text('Copyright © ${DateTime.now().year} Solsynth LLC'),
|
||||
const SizedBox(height: 16),
|
||||
TextButton(
|
||||
style: denseButtonStyle,
|
||||
child: const Text('More Information'),
|
||||
onPressed: () {
|
||||
launchUrlString('https://solsynth.dev/products/solar-network');
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
style: denseButtonStyle,
|
||||
onPressed: () {
|
||||
launchUrlString('https://solsynth.dev');
|
||||
},
|
||||
child: const Text('Official Website'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'Open-sourced under AGPLv3',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ class _AccountScreenState extends State<AccountScreen> {
|
||||
'accountPersonalize'
|
||||
),
|
||||
(const Icon(Icons.diversity_1), 'accountFriend'.tr, 'accountFriend'),
|
||||
(const Icon(Icons.info_outline), 'about'.tr, 'about'),
|
||||
];
|
||||
|
||||
final AuthProvider provider = Get.find();
|
||||
|
@ -16,6 +16,7 @@ class SolianMessages extends Translations {
|
||||
'confirm': 'Confirm',
|
||||
'leave': 'Leave',
|
||||
'loading': 'Loading...',
|
||||
'about': 'About',
|
||||
'edit': 'Edit',
|
||||
'delete': 'Delete',
|
||||
'search': 'Search',
|
||||
@ -199,7 +200,6 @@ class SolianMessages extends Translations {
|
||||
'pushNotifyRegisterDone': 'Push notifications has been activated.',
|
||||
'pushNotifyRegisterFailed':
|
||||
'Unable to active push notification... @reason',
|
||||
'about': 'About',
|
||||
},
|
||||
'zh_CN': {
|
||||
'hide': '隐藏',
|
||||
@ -210,6 +210,7 @@ class SolianMessages extends Translations {
|
||||
'confirm': '确认',
|
||||
'leave': '离开',
|
||||
'loading': '载入中…',
|
||||
'about': '关于',
|
||||
'edit': '编辑',
|
||||
'delete': '删除',
|
||||
'page': '页面',
|
||||
@ -384,7 +385,6 @@ class SolianMessages extends Translations {
|
||||
'激活推送通知便可以让你在应用程序完全关闭的时候仍然获取到我们最新的通知。在 iOS/macOS 设备上我们使用 Apple 官方的推送服务;其他设备则通过 Google Firebase 提供推送通知。要注册推送通知设备,您可能需要连接到 Google 的服务器(在中国大陆不可用)并在您的设备上安装 Google Framework。即使您关闭此对话框,下次启动应用程序时仍会自动执行此注册。',
|
||||
'pushNotifyRegisterDone': '推送通知已成功激活',
|
||||
'pushNotifyRegisterFailed': '推送通知激活失败…… @reason',
|
||||
'about': '关于',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -793,7 +793,7 @@ packages:
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
package_info_plus:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: package_info_plus
|
||||
sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0
|
||||
|
@ -68,6 +68,7 @@ dependencies:
|
||||
firebase_core: ^3.0.0
|
||||
firebase_messaging: ^15.0.0
|
||||
platform_device_id: ^1.0.1
|
||||
package_info_plus: ^8.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
Reference in New Issue
Block a user