Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

chore: better dialog

Predidit7673b0f9c6c8
diff --git a/lib/pages/about/about_page.dart b/lib/pages/about/about_page.dart
index 06065a33..a37656e7 100644
--- a/lib/pages/about/about_page.dart
+++ b/lib/pages/about/about_page.dart
@@ -41,7 +41,12 @@ class _AboutPageState extends State<AboutPage> {
_getCacheSize();
}
- void onBackPressed(BuildContext context) {}
+ void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
+ }
Future<Directory> _getCacheDir() async {
Directory tempDir = await getTemporaryDirectory();
diff --git a/lib/pages/collect/collect_page.dart b/lib/pages/collect/collect_page.dart
index da6decdb..2baae0b2 100644
--- a/lib/pages/collect/collect_page.dart
+++ b/lib/pages/collect/collect_page.dart
@@ -30,6 +30,10 @@ class _CollectPageState extends State<CollectPage>
Box setting = GStorage.setting;
void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
navigationBarState.updateSelectedIndex(0);
Modular.to.navigate('/tab/popular/');
}
diff --git a/lib/pages/history/history_page.dart b/lib/pages/history/history_page.dart
index f2f1442a..5a600613 100644
--- a/lib/pages/history/history_page.dart
+++ b/lib/pages/history/history_page.dart
@@ -27,7 +27,12 @@ class _HistoryPageState extends State<HistoryPage>
historyController.init();
}
- void onBackPressed(BuildContext context) {}
+ void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
+ }
void showHistoryClearDialog() {
KazumiDialog.show(
diff --git a/lib/pages/info/source_sheet.dart b/lib/pages/info/source_sheet.dart
index b8c5b950..787b60da 100644
--- a/lib/pages/info/source_sheet.dart
+++ b/lib/pages/info/source_sheet.dart
@@ -65,65 +65,68 @@ class _SourceSheetState extends State<SourceSheet>
KazumiDialog.show(builder: (context) {
return Dialog(
clipBehavior: Clip.antiAlias,
- child: ValueListenableBuilder<List<String>>(
- valueListenable: aliasNotifier,
- builder: (context, aliasList, child) {
- return ListView(
- shrinkWrap: true,
- children: aliasList.asMap().entries.map((entry) {
- final index = entry.key;
- final alias = entry.value;
- return ListTile(
- title: Text(alias),
- trailing: IconButton(
- onPressed: () {
- KazumiDialog.show(
- builder: (context) {
- return AlertDialog(
- title: const Text('删除确认'),
- content: const Text('删除后无法恢复,确认要永久删除这个别名吗?'),
- actions: [
- TextButton(
- onPressed: () {
- KazumiDialog.dismiss();
- },
- child: Text(
- '取消',
- style: TextStyle(
- color: Theme.of(context)
- .colorScheme
- .outline),
+ child: SizedBox(
+ width: 560,
+ child: ValueListenableBuilder<List<String>>(
+ valueListenable: aliasNotifier,
+ builder: (context, aliasList, child) {
+ return ListView(
+ shrinkWrap: true,
+ children: aliasList.asMap().entries.map((entry) {
+ final index = entry.key;
+ final alias = entry.value;
+ return ListTile(
+ title: Text(alias),
+ trailing: IconButton(
+ onPressed: () {
+ KazumiDialog.show(
+ builder: (context) {
+ return AlertDialog(
+ title: const Text('删除确认'),
+ content: const Text('删除后无法恢复,确认要永久删除这个别名吗?'),
+ actions: [
+ TextButton(
+ onPressed: () {
+ KazumiDialog.dismiss();
+ },
+ child: Text(
+ '取消',
+ style: TextStyle(
+ color: Theme.of(context)
+ .colorScheme
+ .outline),
+ ),
),
- ),
- TextButton(
- onPressed: () {
- KazumiDialog.dismiss();
- aliasList.removeAt(index);
- aliasNotifier.value = List.from(aliasList);
- collectController.updateLocalCollect(
- widget.infoController.bangumiItem);
- if (aliasList.isEmpty) {
- // pop whole dialog when empty
- Navigator.of(context).pop();
- }
- },
- child: const Text('确认'),
- ),
- ],
- );
- },
- );
+ TextButton(
+ onPressed: () {
+ KazumiDialog.dismiss();
+ aliasList.removeAt(index);
+ aliasNotifier.value = List.from(aliasList);
+ collectController.updateLocalCollect(
+ widget.infoController.bangumiItem);
+ if (aliasList.isEmpty) {
+ // pop whole dialog when empty
+ Navigator.of(context).pop();
+ }
+ },
+ child: const Text('确认'),
+ ),
+ ],
+ );
+ },
+ );
+ },
+ icon: Icon(Icons.delete),
+ ),
+ onTap: () {
+ KazumiDialog.dismiss();
+ queryManager?.querySource(alias, pluginName);
},
- icon: Icon(Icons.delete),
- ),
- onTap: () {
- KazumiDialog.dismiss();
- queryManager?.querySource(alias, pluginName);
- },
- );
- }).toList(),
- );
- },
+ );
+ }).toList(),
+ );
+ },
+ ),
),
);
});
diff --git a/lib/pages/my/my_page.dart b/lib/pages/my/my_page.dart
index aec49f5d..49131d75 100644
--- a/lib/pages/my/my_page.dart
+++ b/lib/pages/my/my_page.dart
@@ -4,6 +4,7 @@ import 'package:flutter_modular/flutter_modular.dart';
import 'package:kazumi/bean/appbar/sys_app_bar.dart';
import 'package:kazumi/pages/menu/menu.dart';
import 'package:provider/provider.dart';
+import 'package:kazumi/bean/dialog/dialog_helper.dart';
class MyPage extends StatefulWidget {
const MyPage({super.key});
@@ -16,6 +17,10 @@ class _MyPageState extends State<MyPage> {
late NavigationBarState navigationBarState;
void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
navigationBarState.updateSelectedIndex(0);
Modular.to.navigate('/tab/popular/');
}
diff --git a/lib/pages/plugin_editor/plugin_shop_page.dart b/lib/pages/plugin_editor/plugin_shop_page.dart
index 92849b18..5aab89ae 100644
--- a/lib/pages/plugin_editor/plugin_shop_page.dart
+++ b/lib/pages/plugin_editor/plugin_shop_page.dart
@@ -26,7 +26,10 @@ class _PluginShopPageState extends State<PluginShopPage> {
final PluginsController pluginsController = Modular.get<PluginsController>();
void onBackPressed(BuildContext context) {
- // Navigator.of(context).pop();
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
}
@override
diff --git a/lib/pages/plugin_editor/plugin_view_page.dart b/lib/pages/plugin_editor/plugin_view_page.dart
index 5f99eed3..9485409a 100644
--- a/lib/pages/plugin_editor/plugin_view_page.dart
+++ b/lib/pages/plugin_editor/plugin_view_page.dart
@@ -120,7 +120,10 @@ class _PluginViewPageState extends State<PluginViewPage> {
}
void onBackPressed(BuildContext context) {
- // Navigator.of(context).pop();
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
}
@override
@@ -183,7 +186,8 @@ class _PluginViewPageState extends State<PluginViewPage> {
),
TextButton(
onPressed: () {
- pluginsController.removePlugins(selectedNames);
+ pluginsController
+ .removePlugins(selectedNames);
setState(() {
isMultiSelectMode = false;
selectedNames.clear();
@@ -221,128 +225,133 @@ class _PluginViewPageState extends State<PluginViewPage> {
)
: Builder(builder: (context) {
return ReorderableListView.builder(
- buildDefaultDragHandles: false,
- proxyDecorator: (child, index, animation) {
- return Material(
- elevation: 0,
- color: Colors.transparent,
- child: child,
- );
- },
- onReorder: (int oldIndex, int newIndex) {
- pluginsController.onReorder(oldIndex, newIndex);
- },
- itemCount: pluginsController.pluginList.length,
- itemBuilder: (context, index) {
- var plugin = pluginsController.pluginList[index];
- bool canUpdate =
- pluginsController.pluginUpdateStatus(plugin) ==
- 'updatable';
- return Card(
- key: ValueKey(index),
- margin: const EdgeInsets.fromLTRB(8, 0, 8, 8),
- child: ListTile(
- trailing: pluginCardTrailing(index),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12)),
- onLongPress: () {
- if (!isMultiSelectMode) {
- setState(() {
- isMultiSelectMode = true;
- selectedNames.add(plugin.name);
- });
- }
- },
- onTap: () {
- if (isMultiSelectMode) {
- setState(() {
- if (selectedNames.contains(plugin.name)) {
- selectedNames.remove(plugin.name);
- if (selectedNames.isEmpty) {
- isMultiSelectMode = false;
- }
- } else {
- selectedNames.add(plugin.name);
+ buildDefaultDragHandles: false,
+ proxyDecorator: (child, index, animation) {
+ return Material(
+ elevation: 0,
+ color: Colors.transparent,
+ child: child,
+ );
+ },
+ onReorder: (int oldIndex, int newIndex) {
+ pluginsController.onReorder(oldIndex, newIndex);
+ },
+ itemCount: pluginsController.pluginList.length,
+ itemBuilder: (context, index) {
+ var plugin = pluginsController.pluginList[index];
+ bool canUpdate =
+ pluginsController.pluginUpdateStatus(plugin) ==
+ 'updatable';
+ return Card(
+ key: ValueKey(index),
+ margin: const EdgeInsets.fromLTRB(8, 0, 8, 8),
+ child: ListTile(
+ trailing: pluginCardTrailing(index),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12)),
+ onLongPress: () {
+ if (!isMultiSelectMode) {
+ setState(() {
+ isMultiSelectMode = true;
+ selectedNames.add(plugin.name);
+ });
}
- });
- }
- },
- selected: selectedNames.contains(plugin.name),
- selectedTileColor:
- Theme.of(context).colorScheme.primaryContainer,
- title: Text(
- plugin.name,
- style: const TextStyle(fontWeight: FontWeight.bold),
- ),
- subtitle: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
+ },
+ onTap: () {
+ if (isMultiSelectMode) {
+ setState(() {
+ if (selectedNames.contains(plugin.name)) {
+ selectedNames.remove(plugin.name);
+ if (selectedNames.isEmpty) {
+ isMultiSelectMode = false;
+ }
+ } else {
+ selectedNames.add(plugin.name);
+ }
+ });
+ }
+ },
+ selected: selectedNames.contains(plugin.name),
+ selectedTileColor: Theme.of(context)
+ .colorScheme
+ .primaryContainer,
+ title: Text(
+ plugin.name,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold),
+ ),
+ subtitle: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(
- 'Version: ${plugin.version}',
- style: const TextStyle(color: Colors.grey),
- ),
- if (canUpdate) ...[
- const SizedBox(width: 8),
- Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 6, vertical: 2),
- decoration: BoxDecoration(
- color: Theme.of(context)
- .colorScheme
- .errorContainer,
- borderRadius: BorderRadius.circular(4),
+ Row(
+ children: [
+ Text(
+ 'Version: ${plugin.version}',
+ style:
+ const TextStyle(color: Colors.grey),
),
- child: Text(
- '可更新',
- style: TextStyle(
- fontSize: 12,
- color: Theme.of(context)
- .colorScheme
- .onErrorContainer,
+ if (canUpdate) ...[
+ const SizedBox(width: 8),
+ Container(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 6, vertical: 2),
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .colorScheme
+ .errorContainer,
+ borderRadius:
+ BorderRadius.circular(4),
+ ),
+ child: Text(
+ '可更新',
+ style: TextStyle(
+ fontSize: 12,
+ color: Theme.of(context)
+ .colorScheme
+ .onErrorContainer,
+ ),
+ ),
),
- ),
- ),
- ],
- if (pluginsController.validityTracker
- .isSearchValid(plugin.name)) ...[
- const SizedBox(width: 8),
- Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 6, vertical: 2),
- decoration: BoxDecoration(
- color: Theme.of(context)
- .colorScheme
- .tertiaryContainer,
- borderRadius: BorderRadius.circular(4),
- ),
- child: Text(
- '搜索有效',
- style: TextStyle(
- fontSize: 12,
- color: Theme.of(context)
- .colorScheme
- .onTertiaryContainer,
+ ],
+ if (pluginsController.validityTracker
+ .isSearchValid(plugin.name)) ...[
+ const SizedBox(width: 8),
+ Container(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 6, vertical: 2),
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .colorScheme
+ .tertiaryContainer,
+ borderRadius:
+ BorderRadius.circular(4),
+ ),
+ child: Text(
+ '搜索有效',
+ style: TextStyle(
+ fontSize: 12,
+ color: Theme.of(context)
+ .colorScheme
+ .onTertiaryContainer,
+ ),
+ ),
),
- ),
+ ],
+ ],
+ ),
+ if (pluginsController.installTimeTracker
+ .getInstallTime(plugin.name) >
+ 0) ...[
+ Text(
+ '安装时间: ${DateTime.fromMillisecondsSinceEpoch(pluginsController.installTimeTracker.getInstallTime(plugin.name)).toString().split('.')[0]}',
+ style:
+ const TextStyle(color: Colors.grey),
),
],
],
),
- if (pluginsController.installTimeTracker
- .getInstallTime(plugin.name) >
- 0) ...[
- Text(
- '安装时间: ${DateTime.fromMillisecondsSinceEpoch(pluginsController.installTimeTracker.getInstallTime(plugin.name)).toString().split('.')[0]}',
- style: const TextStyle(color: Colors.grey),
- ),
- ],
- ],
- ),
- ));
- }
- );
+ ));
+ });
});
}),
),
@@ -376,7 +385,7 @@ class _PluginViewPageState extends State<PluginViewPage> {
]);
}
- Widget popupMenuButton(int index){
+ Widget popupMenuButton(int index) {
final plugin = pluginsController.pluginList[index];
return PopupMenuButton<String>(
onSelected: (String result) async {
diff --git a/lib/pages/popular/popular_page.dart b/lib/pages/popular/popular_page.dart
index c1a2d821..af89b3e3 100644
--- a/lib/pages/popular/popular_page.dart
+++ b/lib/pages/popular/popular_page.dart
@@ -71,6 +71,10 @@ class _PopularPageState extends State<PopularPage>
}
void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
if (_lastPressedAt == null ||
DateTime.now().difference(_lastPressedAt!) >
const Duration(seconds: 2)) {
diff --git a/lib/pages/settings/danmaku/danmaku_settings.dart b/lib/pages/settings/danmaku/danmaku_settings.dart
index b6b1e467..4c931d4b 100644
--- a/lib/pages/settings/danmaku/danmaku_settings.dart
+++ b/lib/pages/settings/danmaku/danmaku_settings.dart
@@ -66,7 +66,10 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {
}
void onBackPressed(BuildContext context) {
- // Navigator.of(context).pop();
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
}
void updateDanmakuArea(double i) async {
diff --git a/lib/pages/settings/player_settings.dart b/lib/pages/settings/player_settings.dart
index e68bf36d..8a1db4cf 100644
--- a/lib/pages/settings/player_settings.dart
+++ b/lib/pages/settings/player_settings.dart
@@ -49,7 +49,10 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
}
void onBackPressed(BuildContext context) {
- // Navigator.of(context).pop();
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
}
void updateDefaultPlaySpeed(double speed) {
@@ -65,6 +68,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
defaultAspectRatioType = type;
});
}
+
@override
Widget build(BuildContext context) {
WidgetsBinding.instance.addPostFrameCallback((_) {});
@@ -112,9 +116,10 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
if (Platform.isAndroid) ...[
SettingsTile.switchTile(
onToggle: (value) async {
- androidEnableOpenSLES = value ?? !androidEnableOpenSLES;
- await setting.put(
- SettingBoxKey.androidEnableOpenSLES, androidEnableOpenSLES);
+ androidEnableOpenSLES =
+ value ?? !androidEnableOpenSLES;
+ await setting.put(SettingBoxKey.androidEnableOpenSLES,
+ androidEnableOpenSLES);
setState(() {});
},
title: const Text('低延迟音频'),
@@ -246,16 +251,20 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
return AlertDialog(
title: const Text('默认视频比例'),
content: StatefulBuilder(
- builder: (BuildContext context, StateSetter setState) {
+ builder:
+ (BuildContext context, StateSetter setState) {
return Wrap(
spacing: 8,
runSpacing: Utils.isDesktop() ? 8 : 0,
children: [
- for (final entry in aspectRatioTypeMap.entries) ...<Widget>[
- if (entry.key == defaultAspectRatioType) ...<Widget>[
+ for (final entry in aspectRatioTypeMap
+ .entries) ...<Widget>[
+ if (entry.key ==
+ defaultAspectRatioType) ...<Widget>[
FilledButton(
onPressed: () async {
- updateDefaultAspectRatioType(entry.key);
+ updateDefaultAspectRatioType(
+ entry.key);
KazumiDialog.dismiss();
},
child: Text(entry.value),
@@ -263,7 +272,8 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
] else ...[
FilledButton.tonal(
onPressed: () async {
- updateDefaultAspectRatioType(entry.key);
+ updateDefaultAspectRatioType(
+ entry.key);
KazumiDialog.dismiss();
},
child: Text(entry.value),
@@ -280,7 +290,9 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
child: Text(
'取消',
style: TextStyle(
- color: Theme.of(context).colorScheme.outline),
+ color: Theme.of(context)
+ .colorScheme
+ .outline),
),
),
TextButton(
@@ -295,7 +307,8 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {
});
},
title: const Text('默认视频比例'),
- value: Text(aspectRatioTypeMap[defaultAspectRatioType] ?? '自动'),
+ value: Text(
+ aspectRatioTypeMap[defaultAspectRatioType] ?? '自动'),
),
],
),
diff --git a/lib/pages/settings/theme_settings_page.dart b/lib/pages/settings/theme_settings_page.dart
index fe72606a..9b21c075 100644
--- a/lib/pages/settings/theme_settings_page.dart
+++ b/lib/pages/settings/theme_settings_page.dart
@@ -47,25 +47,28 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {
themeProvider = Provider.of<ThemeProvider>(context, listen: false);
}
- void onBackPressed(BuildContext context) {}
+ void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
+ }
void setTheme(Color? color) {
var defaultDarkTheme = ThemeData(
- useMaterial3: true,
- brightness: Brightness.dark,
- colorSchemeSeed: color,
- progressIndicatorTheme: progressIndicatorTheme2024,
- pageTransitionsTheme: pageTransitionsTheme2024
- );
- var oledDarkTheme = Utils.oledDarkTheme(defaultDarkTheme);
- themeProvider.setTheme(
- ThemeData(
useMaterial3: true,
- brightness: Brightness.light,
+ brightness: Brightness.dark,
colorSchemeSeed: color,
progressIndicatorTheme: progressIndicatorTheme2024,
- pageTransitionsTheme: pageTransitionsTheme2024
- ),
+ pageTransitionsTheme: pageTransitionsTheme2024);
+ var oledDarkTheme = Utils.oledDarkTheme(defaultDarkTheme);
+ themeProvider.setTheme(
+ ThemeData(
+ useMaterial3: true,
+ brightness: Brightness.light,
+ colorSchemeSeed: color,
+ progressIndicatorTheme: progressIndicatorTheme2024,
+ pageTransitionsTheme: pageTransitionsTheme2024),
oledEnhance ? oledDarkTheme : defaultDarkTheme,
);
defaultThemeColor = color?.value.toRadixString(16) ?? 'default';
@@ -74,21 +77,19 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {
void resetTheme() {
var defaultDarkTheme = ThemeData(
- useMaterial3: true,
- brightness: Brightness.dark,
- colorSchemeSeed: Colors.green,
- progressIndicatorTheme: progressIndicatorTheme2024,
- pageTransitionsTheme: pageTransitionsTheme2024
- );
- var oledDarkTheme = Utils.oledDarkTheme(defaultDarkTheme);
- themeProvider.setTheme(
- ThemeData(
useMaterial3: true,
- brightness: Brightness.light,
+ brightness: Brightness.dark,
colorSchemeSeed: Colors.green,
progressIndicatorTheme: progressIndicatorTheme2024,
- pageTransitionsTheme: pageTransitionsTheme2024
- ),
+ pageTransitionsTheme: pageTransitionsTheme2024);
+ var oledDarkTheme = Utils.oledDarkTheme(defaultDarkTheme);
+ themeProvider.setTheme(
+ ThemeData(
+ useMaterial3: true,
+ brightness: Brightness.light,
+ colorSchemeSeed: Colors.green,
+ progressIndicatorTheme: progressIndicatorTheme2024,
+ pageTransitionsTheme: pageTransitionsTheme2024),
oledEnhance ? oledDarkTheme : defaultDarkTheme,
);
defaultThemeColor = 'default';
diff --git a/lib/pages/timeline/timeline_page.dart b/lib/pages/timeline/timeline_page.dart
index 338f1e6f..688c7033 100644
--- a/lib/pages/timeline/timeline_page.dart
+++ b/lib/pages/timeline/timeline_page.dart
@@ -23,7 +23,6 @@ class _TimelinePageState extends State<TimelinePage>
with SingleTickerProviderStateMixin {
final TimelineController timelineController =
Modular.get<TimelineController>();
- bool showingTimeMachineDialog = false;
late NavigationBarState navigationBarState;
TabController? tabController;
@@ -47,7 +46,7 @@ class _TimelinePageState extends State<TimelinePage>
}
void onBackPressed(BuildContext context) {
- if (showingTimeMachineDialog) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
KazumiDialog.dismiss();
return;
}
@@ -110,10 +109,7 @@ class _TimelinePageState extends State<TimelinePage>
title: InkWell(
child: Text(timelineController.seasonString),
onTap: () {
- showingTimeMachineDialog = true;
- KazumiDialog.show(onDismiss: () {
- showingTimeMachineDialog = false;
- }, builder: (context) {
+ KazumiDialog.show(builder: (context) {
final currDate = DateTime.now();
final years =
List.generate(20, (index) => currDate.year - index);
diff --git a/lib/pages/video/video_page.dart b/lib/pages/video/video_page.dart
index d2567c33..dc89fc3b 100644
--- a/lib/pages/video/video_page.dart
+++ b/lib/pages/video/video_page.dart
@@ -100,7 +100,8 @@ class _VideoPageState extends State<VideoPage>
videoPageController.showTabBody = true;
playResume = setting.get(SettingBoxKey.playResume, defaultValue: true);
var progress = historyController.lastWatching(
- videoPageController.bangumiItem, videoPageController.currentPlugin.name);
+ videoPageController.bangumiItem,
+ videoPageController.currentPlugin.name);
if (progress != null) {
if (videoPageController.roadList.length > progress.road) {
if (videoPageController.roadList[progress.road].data.length >=
@@ -242,6 +243,10 @@ class _VideoPageState extends State<VideoPage>
}
void onBackPressed(BuildContext context) async {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
if (videoPageController.isPip) {
Utils.exitDesktopPIPWindow();
videoPageController.isPip = false;
diff --git a/lib/pages/webdav_editor/webdav_setting.dart b/lib/pages/webdav_editor/webdav_setting.dart
index 070ed030..edeb4b27 100644
--- a/lib/pages/webdav_editor/webdav_setting.dart
+++ b/lib/pages/webdav_editor/webdav_setting.dart
@@ -30,7 +30,12 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {
setting.get(SettingBoxKey.enableGitProxy, defaultValue: false);
}
- void onBackPressed(BuildContext context) {}
+ void onBackPressed(BuildContext context) {
+ if (KazumiDialog.observer.hasKazumiDialog) {
+ KazumiDialog.dismiss();
+ return;
+ }
+ }
Future<void> checkWebDav() async {
var webDavURL =
@@ -140,7 +145,8 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {
}
if (!webDavEnable) {
webDavEnableHistory = false;
- await setting.put(SettingBoxKey.webDavEnableHistory, false);
+ await setting.put(
+ SettingBoxKey.webDavEnableHistory, false);
}
await setting.put(
SettingBoxKey.webDavEnable, webDavEnable);
diff --git a/lib/utils/auto_updater.dart b/lib/utils/auto_updater.dart
index 5f3a100b..33691760 100644
--- a/lib/utils/auto_updater.dart
+++ b/lib/utils/auto_updater.dart
@@ -521,7 +521,7 @@ class AutoUpdater {
),
const SizedBox(height: 12),
Text(
- '⚠️ 安装过程中应用将会退出',
+ '安装过程中应用将会退出',
style: TextStyle(
color: Theme.of(context).colorScheme.error,
fontSize: 12,