💄 Finishing up

This commit is contained in:
2024-08-15 21:12:23 +08:00
parent 0b34a4b74b
commit bd50859e73
56 changed files with 395 additions and 75 deletions

View File

@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher_string.dart';
class SettingsScreen extends StatelessWidget {
const SettingsScreen({super.key});
@ -15,6 +18,37 @@ class SettingsScreen extends StatelessWidget {
),
body: ListView(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(16)),
child: Image.asset("assets/icon.png", width: 64, height: 64),
).paddingAll(8),
const SizedBox(height: 12),
Text(
'appName'.tr,
style: Theme.of(context).textTheme.headlineMedium,
),
Text('appDescription'.tr),
FutureBuilder(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Text('loading'.tr);
}
return Text(
'v${snapshot.data!.version} (${snapshot.data!.buildNumber})',
style: GoogleFonts.ibmPlexMono(fontSize: 12),
);
},
),
],
).paddingOnly(left: 24, right: 24, bottom: 16),
const Divider(height: 1, thickness: 0.3).paddingOnly(
bottom: 16,
top: 8,
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
trailing: const Icon(Icons.chevron_right),
@ -31,6 +65,18 @@ class SettingsScreen extends StatelessWidget {
GoRouter.of(context).pushNamed('settingsDataSource');
},
),
const Divider(height: 1, thickness: 0.3)
.paddingOnly(top: 16, bottom: 8),
Center(
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Text('appCopyright'.tr, textAlign: TextAlign.center)
.paddingAll(8),
onTap: () {
launchUrlString("https://solsynth.dev");
},
),
),
],
),
),

View File

@ -1,4 +1,5 @@
const i18nEnglish = {
'appCopyright': 'Copyright © 2024 Solsynth LLC\nOriginal Author @littlesheep',
'query': 'Query',
'settings': 'Settings',
'preparingData': 'Preparing data...',

View File

@ -1,4 +1,7 @@
const i18nSimplifiedChinese = {
'appName': '膳食卫士',
'appDescription': '您的健康膳食小卫士',
'appCopyright': '版权所有 © 2024 索尔辛茨实业有限公司\n作者 @littlesheep',
'query': '查询',
'settings': '设置',
'preparingData': '准备数据中…',
@ -35,4 +38,5 @@ const i18nSimplifiedChinese = {
'DietaryGuard 的数据来自于美国农业部公开 API因此你需要配置一个 API 令牌,但是别担心,这是完全免费的,查看我们的维基了解如何获取一个 API 令牌。',
'fdcApiCredit':
'DietaryGuard 的食品数据来源于 U.S. Department of Agriculture, Agricultural Research Service, Beltsville Human Nutrition Research Center. FoodData Central. 在此感谢他们慷慨贡献的食品数据并发布在公有领域。',
'loading': '加载中',
};