Skip to content

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

fix: replace deprecated flutter APIs (#2121)

LiggMax82466ed5d4d9
diff --git a/lib/bean/card/palette_card.dart b/lib/bean/card/palette_card.dart
index 3c0c567b..6fce282c 100644
--- a/lib/bean/card/palette_card.dart
+++ b/lib/bean/card/palette_card.dart
@@ -18,7 +18,7 @@ class PaletteCard extends StatefulWidget {
class _PaletteCardState extends State<PaletteCard> {
@override
Widget build(BuildContext context) {
- final Hct hct = Hct.fromInt(widget.color.value);
+ final Hct hct = Hct.fromInt(widget.color.toARGB32());
final primary = Color(Hct.from(hct.hue, 20.0, 90.0).toInt());
final tertiary = Color(Hct.from(hct.hue + 50, 20.0, 85.0).toInt());
final primaryContainer = Color(Hct.from(hct.hue, 30.0, 50.0).toInt());
diff --git a/lib/pages/plugin_editor/plugin_test_page.dart b/lib/pages/plugin_editor/plugin_test_page.dart
index 5a7c003c..6ca227f1 100644
--- a/lib/pages/plugin_editor/plugin_test_page.dart
+++ b/lib/pages/plugin_editor/plugin_test_page.dart
@@ -283,7 +283,7 @@ class _PluginTestPageState extends State<PluginTestPage> {
style: TextButton.styleFrom(
backgroundColor: theme
.getCoreColor(CoreColorType.error)
- .withOpacity(0.1)),
+ .withValues(alpha: 0.1)),
child: Text('重试测试',
style: TextStyle(
color: theme.colorScheme.onErrorContainer)),
diff --git a/lib/pages/plugin_editor/plugin_view_page.dart b/lib/pages/plugin_editor/plugin_view_page.dart
index 3e2888cd..03531d42 100644
--- a/lib/pages/plugin_editor/plugin_view_page.dart
+++ b/lib/pages/plugin_editor/plugin_view_page.dart
@@ -236,7 +236,7 @@ class _PluginViewPageState extends State<PluginViewPage> {
child: child,
);
},
- onReorder: (int oldIndex, int newIndex) {
+ onReorderItem: (int oldIndex, int newIndex) {
pluginsController.onReorder(oldIndex, newIndex);
},
itemCount: pluginsController.pluginList.length,
diff --git a/lib/pages/settings/theme_settings_page.dart b/lib/pages/settings/theme_settings_page.dart
index 051cabe6..fd27bd22 100644
--- a/lib/pages/settings/theme_settings_page.dart
+++ b/lib/pages/settings/theme_settings_page.dart
@@ -81,7 +81,7 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {
pageTransitionsTheme: pageTransitionsTheme2024),
oledEnhance ? oledTheme : defaultDarkTheme,
);
- defaultThemeColor = color?.value.toRadixString(16) ?? 'default';
+ defaultThemeColor = color?.toARGB32().toRadixString(16) ?? 'default';
setting.put(SettingBoxKey.themeColor, defaultThemeColor);
}
diff --git a/lib/plugins/plugins_controller.dart b/lib/plugins/plugins_controller.dart
index 7396784e..390390d6 100644
--- a/lib/plugins/plugins_controller.dart
+++ b/lib/plugins/plugins_controller.dart
@@ -150,9 +150,6 @@ abstract class _PluginsController with Store {
}
void onReorder(int oldIndex, int newIndex) {
- if (oldIndex < newIndex) {
- newIndex -= 1;
- }
final plugin = pluginList.removeAt(oldIndex);
pluginList.insert(newIndex, plugin);
savePlugins();
diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart
index 0a7ed8be..46d692dd 100644
--- a/lib/utils/constants.dart
+++ b/lib/utils/constants.dart
@@ -23,7 +23,7 @@ const ProgressIndicatorThemeData progressIndicatorTheme2024 =
/// ignore: deprecated_member_use
const SliderThemeData sliderTheme2024 = SliderThemeData(
year2023: false,
- showValueIndicator: ShowValueIndicator.always,
+ showValueIndicator: ShowValueIndicator.onDrag,
);
/// Flutter-managed platform transitions. Route-level Modular transitions should