mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 05:34:45 +08:00
feat: User Agreement and Privacy Policy Dialog
This commit is contained in:
@ -147,7 +147,7 @@ class AboutUI extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
launchUrlString("mailto:scbox@xkeyc.com");
|
||||
launchUrlString("mailto:xkeyc@qq.com");
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 24),
|
||||
|
@ -7,7 +7,7 @@ part of 'home_game_login_dialog_ui_model.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$homeGameLoginUIModelHash() =>
|
||||
r'108812122298cf826ee57ecad3e519b1dc3fd6ce';
|
||||
r'aba96cf64ea6146f1006ca2bd41e6e26c10adb6c';
|
||||
|
||||
/// See also [HomeGameLoginUIModel].
|
||||
@ProviderFor(HomeGameLoginUIModel)
|
||||
|
@ -190,8 +190,8 @@ class _$HomeDownloaderUIStateImpl implements _HomeDownloaderUIState {
|
||||
.equals(other._waitingTasks, _waitingTasks) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._stoppedTasks, _stoppedTasks) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other.globalStat, globalStat));
|
||||
(identical(other.globalStat, globalStat) ||
|
||||
other.globalStat == globalStat));
|
||||
}
|
||||
|
||||
@override
|
||||
@ -200,7 +200,7 @@ class _$HomeDownloaderUIStateImpl implements _HomeDownloaderUIState {
|
||||
const DeepCollectionEquality().hash(_tasks),
|
||||
const DeepCollectionEquality().hash(_waitingTasks),
|
||||
const DeepCollectionEquality().hash(_stoppedTasks),
|
||||
const DeepCollectionEquality().hash(globalStat));
|
||||
globalStat);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
|
@ -6,7 +6,7 @@ part of 'home_ui_model.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$homeUIModelHash() => r'b62026bb0b5ab37c0aed33e0ed018aa9732da58e';
|
||||
String _$homeUIModelHash() => r'13dc0eb046a284bb9cb5a1da5597dae7e5287030';
|
||||
|
||||
/// See also [HomeUIModel].
|
||||
@ProviderFor(HomeUIModel)
|
||||
|
@ -7,7 +7,7 @@ part of 'localization_ui_model.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$localizationUIModelHash() =>
|
||||
r'697f9e00ea08729c5debb4d87ffe9fadb5c0ec71';
|
||||
r'87152654734d322cd20d62baf050918adc9fd11b';
|
||||
|
||||
/// See also [LocalizationUIModel].
|
||||
@ProviderFor(LocalizationUIModel)
|
||||
|
@ -1,7 +1,11 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:markdown_widget/widget/markdown.dart';
|
||||
import 'package:starcitizen_doctor/api/analytics.dart';
|
||||
import 'package:starcitizen_doctor/app.dart';
|
||||
import 'package:starcitizen_doctor/common/conf/const_conf.dart';
|
||||
@ -13,6 +17,8 @@ import 'package:starcitizen_doctor/widgets/widgets.dart';
|
||||
class SplashUI extends HookConsumerWidget {
|
||||
const SplashUI({super.key});
|
||||
|
||||
static const _alertInfoVersion = 1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final stepState = useState(0);
|
||||
@ -61,7 +67,13 @@ class SplashUI extends HookConsumerWidget {
|
||||
void _initApp(BuildContext context, AppGlobalModel appModel,
|
||||
ValueNotifier<int> stepState, WidgetRef ref) async {
|
||||
await appModel.initApp();
|
||||
final appConf = await Hive.openBox("app_conf");
|
||||
final v = appConf.get("splash_alert_info_version", defaultValue: 0);
|
||||
AnalyticsApi.touch("launch");
|
||||
if (v < _alertInfoVersion) {
|
||||
if (!context.mounted) return;
|
||||
await _showAlert(context, appConf);
|
||||
}
|
||||
try {
|
||||
await URLConf.checkHost();
|
||||
} catch (e) {
|
||||
@ -77,4 +89,18 @@ class SplashUI extends HookConsumerWidget {
|
||||
if (!context.mounted) return;
|
||||
context.go("/index");
|
||||
}
|
||||
|
||||
_showAlert(BuildContext context, Box<dynamic> appConf) async {
|
||||
final userOk = await showConfirmDialogs(
|
||||
context,
|
||||
S.current.app_splash_dialog_u_a_p_p,
|
||||
MarkdownWidget(data: S.current.app_splash_dialog_u_a_p_p_content),
|
||||
constraints:
|
||||
BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .5));
|
||||
if (userOk) {
|
||||
await appConf.put("splash_alert_info_version", _alertInfoVersion);
|
||||
} else {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ part of 'tools_ui_model.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$toolsUIModelHash() => r'6b4ab0195cc9606202ae5d0dce574735090f486f';
|
||||
String _$toolsUIModelHash() => r'e96ded635df8f59fb93d92f8dac337c44482dc1c';
|
||||
|
||||
/// See also [ToolsUIModel].
|
||||
@ProviderFor(ToolsUIModel)
|
||||
|
Reference in New Issue
Block a user