基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。
feat(ui): redesign settings groups as split lists
Predidit16b01bb21a2c
diff --git a/lib/bean/settings/settings_list.dart b/lib/bean/settings/settings_list.dartindex 41e5123c..b08b70cc 100644--- a/lib/bean/settings/settings_list.dart+++ b/lib/bean/settings/settings_list.dart@@ -2,11 +2,17 @@ import 'package:flutter/material.dart';enum _TileKind { plain, toggle, radio }+const double _outerRadius = 24;+const double _innerRadius = 4;+const double _rowGap = 4;+class SettingsList extends StatelessWidget {- const SettingsList({super.key, required this.sections, this.maxWidth});+ const SettingsList({super.key, required this.sections, this.maxWidth = 1000});final List<Widget> sections;- final double? maxWidth;++ /// Defaulted here so a page that says nothing still matches the others.+ final double maxWidth;@overrideWidget build(BuildContext context) {@@ -15,7 +21,7 @@ class SettingsList extends StatelessWidget {itemCount: sections.length,itemBuilder: (context, index) => Center(child: ConstrainedBox(- constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),+ constraints: BoxConstraints(maxWidth: maxWidth),child: sections[index],),),@@ -48,27 +54,17 @@ class SettingsSection extends StatelessWidget {children: [if (title != null)Padding(- padding: const EdgeInsets.fromLTRB(4, 0, 4, 8),+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),child: DefaultTextStyle.merge(- style: textTheme.titleSmall- ?.copyWith(color: colorScheme.onSurfaceVariant),+ style:+ textTheme.titleSmall?.copyWith(color: colorScheme.primary),child: title!,),),- Material(- // M3 elevated card token, minus the elevation: tone carries the- // separation so the group never casts a shadow.- color: colorScheme.surfaceContainerLow,- borderRadius: BorderRadius.circular(16),- clipBehavior: Clip.antiAlias,- child: Column(- crossAxisAlignment: CrossAxisAlignment.stretch,- children: tiles,- ),- ),+ SettingsSplitGroup(children: tiles),if (bottomInfo != null)Padding(- padding: const EdgeInsets.fromLTRB(4, 8, 4, 0),+ padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),child: DefaultTextStyle.merge(style: textTheme.bodySmall?.copyWith(color: colorScheme.onSurfaceVariant),@@ -81,6 +77,91 @@ class SettingsSection extends StatelessWidget {}}+/// Rows laid out as an M3 split list: large corners at the group's two ends,+/// small ones in between, and a pressed row morphing out of the group. That+/// morph is what separates the rows, in place of a divider.+class SettingsSplitGroup extends StatelessWidget {+ const SettingsSplitGroup({super.key, required this.children});++ final List<Widget> children;++ /// Hand to a row's [InkWell.onHighlightChanged] to drive the morph. Null+ /// outside a group, which leaves the row's shape static.+ static ValueChanged<bool>? pressReporterOf(BuildContext context) {+ return context+ .dependOnInheritedWidgetOfExactType<_SplitRowScope>()+ ?.onPressChanged;+ }++ @override+ Widget build(BuildContext context) {+ return Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ for (int i = 0; i < children.length; i++) ...[+ if (i > 0) const SizedBox(height: _rowGap),+ _SplitRow(+ first: i == 0,+ last: i == children.length - 1,+ child: children[i],+ ),+ ],+ ],+ );+ }+}++class _SplitRow extends StatefulWidget {+ const _SplitRow({+ required this.first,+ required this.last,+ required this.child,+ });++ final bool first;+ final bool last;+ final Widget child;++ @override+ State<_SplitRow> createState() => _SplitRowState();+}++class _SplitRowState extends State<_SplitRow> {+ bool _pressed = false;++ @override+ Widget build(BuildContext context) {+ final top = widget.first || _pressed ? _outerRadius : _innerRadius;+ final bottom = widget.last || _pressed ? _outerRadius : _innerRadius;+ return Material(+ // Material animates its own shape, so the morph needs no controller.+ color: Theme.of(context).colorScheme.surfaceContainerLow,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.vertical(+ top: Radius.circular(top),+ bottom: Radius.circular(bottom),+ ),+ ),+ clipBehavior: Clip.antiAlias,+ child: _SplitRowScope(+ onPressChanged: (pressed) => setState(() => _pressed = pressed),+ child: widget.child,+ ),+ );+ }+}++class _SplitRowScope extends InheritedWidget {+ const _SplitRowScope({required this.onPressChanged, required super.child});++ final ValueChanged<bool> onPressChanged;++ // The callback always reaches the same state, so a rebuilt scope never+ // obsoletes the one a row already holds.+ @override+ bool updateShouldNotify(_SplitRowScope oldWidget) => false;+}+/// A [SettingsSection] whose tiles form a single radio group, so arrow keys/// traverse the options and screen readers announce them as one set.class SettingsRadioSection<T> extends StatelessWidget {@@ -111,6 +192,7 @@ class SettingsTile<T> extends StatelessWidget {const SettingsTile({super.key,required this.title,+ this.leading,this.description,this.trailing,this.value,@@ -127,6 +209,7 @@ class SettingsTile<T> extends StatelessWidget {required this.title,required this.initialValue,required this.onToggle,+ this.leading,this.description,this.enabled = true,}) : _kind = _TileKind.toggle,@@ -141,6 +224,7 @@ class SettingsTile<T> extends StatelessWidget {super.key,required this.title,required T this.radioValue,+ this.leading,this.description,this.enabled = true,}) : _kind = _TileKind.radio,@@ -151,6 +235,9 @@ class SettingsTile<T> extends StatelessWidget {initialValue = null;final Widget title;++ /// Flat, not a tonal badge — the badge marks a row opening a whole category.+ final IconData? leading;final Widget? description;final Widget? trailing;final Widget? value;@@ -186,12 +273,17 @@ class SettingsTile<T> extends StatelessWidget {return InkWell(onTap: _tapHandler(context),+ onHighlightChanged: SettingsSplitGroup.pressReporterOf(context),child: Padding(padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),child: ConstrainedBox(constraints: const BoxConstraints(minHeight: 32),child: Row(children: [+ if (leading != null) ...[+ Icon(leading, size: 24, color: secondary),+ const SizedBox(width: 16),+ ],Expanded(child: Column(mainAxisAlignment: MainAxisAlignment.center,diff --git a/lib/pages/about/about_page.dart b/lib/pages/about/about_page.dartindex 8dae2dad..cbc70d5d 100644--- a/lib/pages/about/about_page.dart+++ b/lib/pages/about/about_page.dart@@ -143,11 +143,12 @@ class _AboutPageState extends State<AboutPage> {child: SettingsDetailScaffold(title: const Text('关于'),body: SettingsList(- maxWidth: 1000,sections: [SettingsSection(+ title: Text('开源'),tiles: [SettingsTile(+ leading: Icons.gavel_rounded,onPressed: (_) {context.pushNamed('/settings/about/license');},@@ -160,6 +161,7 @@ class _AboutPageState extends State<AboutPage> {title: Text('外部链接'),tiles: [SettingsTile(+ leading: Icons.home_rounded,onPressed: (_) {launchUrl(Uri.parse(ApiEndpoints.projectUrl),mode: LaunchMode.externalApplication);@@ -167,6 +169,7 @@ class _AboutPageState extends State<AboutPage> {title: Text('项目主页'),),SettingsTile(+ leading: Icons.code_rounded,onPressed: (_) {launchUrl(Uri.parse(ApiEndpoints.sourceUrl),mode: LaunchMode.externalApplication);@@ -175,6 +178,7 @@ class _AboutPageState extends State<AboutPage> {value: Text('Github'),),SettingsTile(+ leading: Icons.brush_rounded,onPressed: (_) {launchUrl(Uri.parse(ApiEndpoints.iconUrl),mode: LaunchMode.externalApplication);@@ -183,6 +187,7 @@ class _AboutPageState extends State<AboutPage> {value: Text('Pixiv'),),SettingsTile(+ leading: Icons.menu_book_rounded,onPressed: (_) {launchUrl(Uri.parse(ApiEndpoints.bangumiIndex),mode: LaunchMode.externalApplication);@@ -191,6 +196,7 @@ class _AboutPageState extends State<AboutPage> {value: Text('Bangumi'),),SettingsTile(+ leading: Icons.image_search_rounded,onPressed: (_) {launchUrl(Uri.parse('https://trace.moe'),mode: LaunchMode.externalApplication);@@ -199,6 +205,7 @@ class _AboutPageState extends State<AboutPage> {value: Text('trace.moe'),),SettingsTile(+ leading: Icons.subtitles_rounded,onPressed: (_) {launchUrl(Uri.parse(ApiEndpoints.dandanIndex),mode: LaunchMode.externalApplication);@@ -213,6 +220,7 @@ class _AboutPageState extends State<AboutPage> {title: Text('社区'),tiles: [SettingsTile(+ leading: Icons.send_rounded,onPressed: (_) {launchUrl(Uri.parse(ApiEndpoints.telegramGroup),mode: LaunchMode.externalApplication);@@ -227,6 +235,7 @@ class _AboutPageState extends State<AboutPage> {title: Text('默认行为'),tiles: [SettingsTile(+ leading: Icons.exit_to_app_rounded,onPressed: (_) {if (menuController.isOpen) {menuController.close();@@ -272,14 +281,17 @@ class _AboutPageState extends State<AboutPage> {],),SettingsSection(+ title: Text('存储与日志'),tiles: [SettingsTile(+ leading: Icons.receipt_long_rounded,onPressed: (_) {context.pushNamed('/settings/about/logs');},title: Text('错误日志'),),SettingsTile(+ leading: Icons.cleaning_services_rounded,onPressed: (_) {_showCacheDialog();},@@ -294,6 +306,7 @@ class _AboutPageState extends State<AboutPage> {title: Text('应用更新'),tiles: [SettingsTile.switchTile(+ leading: Icons.update_rounded,onToggle: (value) async {autoUpdate = value ?? !autoUpdate;await GStorage.putSetting(@@ -304,6 +317,7 @@ class _AboutPageState extends State<AboutPage> {initialValue: autoUpdate,),SettingsTile(+ leading: Icons.system_update_rounded,onPressed: (_) {myController.checkUpdate();},@@ -316,6 +330,7 @@ class _AboutPageState extends State<AboutPage> {title: Text('规则更新'),tiles: [SettingsTile.switchTile(+ leading: Icons.extension_rounded,onToggle: (value) async {checkPluginUpdateOnStartup =value ?? !checkPluginUpdateOnStartup;diff --git a/lib/pages/bangumi/bangumi_setting.dart b/lib/pages/bangumi/bangumi_setting.dartindex a74ddbe0..d0fec0dd 100644--- a/lib/pages/bangumi/bangumi_setting.dart+++ b/lib/pages/bangumi/bangumi_setting.dart@@ -124,9 +124,11 @@ class _BangumiEditorPageState extends State<BangumiEditorPage> {),const SizedBox(height: 16),SettingsSection(+ title: Text('同步选项'),margin: EdgeInsetsDirectional.zero,tiles: [SettingsTile.switchTile(+ leading: Icons.notifications_active_rounded,onToggle: (value) async {bangumiImmediateSyncToastEnable =value ?? !bangumiImmediateSyncToastEnable;@@ -143,6 +145,7 @@ class _BangumiEditorPageState extends State<BangumiEditorPage> {initialValue: bangumiImmediateSyncToastEnable,),SettingsTile(+ leading: Icons.rule_rounded,onPressed: (_) async {if (syncPriorityMenuController.isOpen) {syncPriorityMenuController.close();@@ -184,6 +187,7 @@ class _BangumiEditorPageState extends State<BangumiEditorPage> {]),),SettingsTile(+ leading: Icons.cloud_sync_rounded,trailing: syncCollectiblesing? const SizedBox(width: 20,diff --git a/lib/pages/settings/danmaku/danmaku_settings.dart b/lib/pages/settings/danmaku/danmaku_settings.dartindex 2018819e..e6327e6f 100644--- a/lib/pages/settings/danmaku/danmaku_settings.dart+++ b/lib/pages/settings/danmaku/danmaku_settings.dart@@ -165,12 +165,12 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {child: SettingsDetailScaffold(title: const Text('弹幕设置'),body: SettingsList(- maxWidth: 1000,sections: [SettingsSection(title: Text('弹幕来源'),tiles: [SettingsTile.switchTile(+ leading: Icons.live_tv_rounded,onToggle: (value) async {danmakuBiliBiliSource = value ?? !danmakuBiliBiliSource;await GStorage.putSetting<bool>(@@ -182,6 +182,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuBiliBiliSource,),SettingsTile.switchTile(+ leading: Icons.sports_esports_rounded,onToggle: (value) async {danmakuGamerSource = value ?? !danmakuGamerSource;await GStorage.putSetting<bool>(@@ -192,6 +193,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuGamerSource,),SettingsTile.switchTile(+ leading: Icons.forum_rounded,onToggle: (value) async {danmakuDanDanSource = value ?? !danmakuDanDanSource;await GStorage.putSetting<bool>(@@ -207,6 +209,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {title: Text('弹幕屏蔽'),tiles: [SettingsTile(+ leading: Icons.block_rounded,onPressed: (_) {context.pushNamed('/settings/danmaku/shield');},@@ -218,6 +221,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {title: Text('弹幕显示'),tiles: [SettingsTile(+ leading: Icons.crop_free_rounded,title: Text('弹幕区域'),description: Slider(value: defaultDanmakuArea,@@ -231,6 +235,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {),),SettingsTile(+ leading: Icons.timer_rounded,title: Text('弹幕持续时间'),description: Slider(value: defaultDanmakuDuration,@@ -244,6 +249,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {),),SettingsTile(+ leading: Icons.format_line_spacing_rounded,title: Text('弹幕行高'),description: Slider(value: defaultDanmakuLineHeight,@@ -258,6 +264,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {),),SettingsTile.switchTile(+ leading: Icons.speed_rounded,onToggle: (value) async {danmakuFollowSpeed = value ?? !danmakuFollowSpeed;await GStorage.putSetting<bool>(@@ -269,6 +276,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuFollowSpeed,),SettingsTile.switchTile(+ leading: Icons.vertical_align_top_rounded,onToggle: (value) async {danmakuTop = value ?? !danmakuTop;await GStorage.putSetting<bool>(@@ -279,6 +287,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuTop,),SettingsTile.switchTile(+ leading: Icons.vertical_align_bottom_rounded,onToggle: (value) async {danmakuBottom = value ?? !danmakuBottom;await GStorage.putSetting<bool>(@@ -289,6 +298,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuBottom,),SettingsTile.switchTile(+ leading: Icons.swap_horiz_rounded,onToggle: (value) async {danmakuScroll = value ?? !danmakuScroll;await GStorage.putSetting<bool>(@@ -299,6 +309,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuScroll,),SettingsTile.switchTile(+ leading: Icons.layers_rounded,onToggle: (value) async {danmakuMassive = value ?? !danmakuMassive;await GStorage.putSetting<bool>(@@ -310,6 +321,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuMassive,),SettingsTile.switchTile(+ leading: Icons.filter_alt_rounded,onToggle: (value) async {danmakuDeduplication = value ?? !danmakuDeduplication;await GStorage.putSetting<bool>(@@ -327,6 +339,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {title: Text('弹幕样式'),tiles: [SettingsTile.switchTile(+ leading: Icons.border_color_rounded,onToggle: (value) async {danmakuBorder = value ?? !danmakuBorder;await GStorage.putSetting<bool>(@@ -337,6 +350,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuBorder,),SettingsTile(+ leading: Icons.line_weight_rounded,title: Text('弹幕描边粗细'),description: Slider(value: defaultdanmakuBorderSize,@@ -351,6 +365,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {),),SettingsTile.switchTile(+ leading: Icons.palette_rounded,onToggle: (value) async {danmakuColor = value ?? !danmakuColor;await GStorage.putSetting<bool>(@@ -361,6 +376,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {initialValue: danmakuColor,),SettingsTile(+ leading: Icons.format_size_rounded,title: Text('字体大小'),description: Slider(value: defaultDanmakuFontSize,@@ -373,6 +389,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {),),SettingsTile(+ leading: Icons.format_bold_rounded,title: Text('字体字重'),description: Slider(value: defaultDanmakuFontWeight.toDouble(),@@ -386,6 +403,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {),),SettingsTile(+ leading: Icons.opacity_rounded,title: Text('弹幕不透明度'),description: Slider(value: defaultDanmakuOpacity,@@ -403,6 +421,7 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {SettingsSection(tiles: [SettingsTile(+ leading: Icons.settings_backup_restore_rounded,onPressed: (_) => resetDanmakuSettings(),title: Text('恢复默认设置'),description: Text('将弹幕相关设置恢复为默认值'),diff --git a/lib/pages/settings/danmaku/danmaku_settings_sheet.dart b/lib/pages/settings/danmaku/danmaku_settings_sheet.dartindex 2b5ba3ca..b3ef486a 100644--- a/lib/pages/settings/danmaku/danmaku_settings_sheet.dart+++ b/lib/pages/settings/danmaku/danmaku_settings_sheet.dart@@ -84,6 +84,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {title: Text('弹幕屏蔽'),tiles: [SettingsTile(+ leading: Icons.block_rounded,onPressed: (_) {_showDanmakuShieldSheet();},@@ -95,6 +96,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {title: Text('弹幕样式'),tiles: [SettingsTile(+ leading: Icons.format_size_rounded,title: Text('字体大小'),description: Slider(value: widget.danmakuController.option.fontSize,@@ -116,6 +118,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {),),SettingsTile(+ leading: Icons.opacity_rounded,title: Text('弹幕不透明度'),description: Slider(value: widget.danmakuController.option.opacity,@@ -142,6 +145,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {title: Text('弹幕显示'),tiles: [SettingsTile(+ leading: Icons.schedule_rounded,onPressed: (context) {Navigator.of(context).pop(_DanmakuSettingsDestination.timeOffset);@@ -157,6 +161,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {),),SettingsTile(+ leading: Icons.crop_free_rounded,title: Text('弹幕区域'),description: Slider(value: widget.danmakuController.option.area,@@ -178,6 +183,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {),),SettingsTile(+ leading: Icons.timer_rounded,title: Text('持续时间'),description: Slider(value: widget.danmakuController.option.duration@@ -201,6 +207,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {),),SettingsTile(+ leading: Icons.format_line_spacing_rounded,title: Text('行高'),description: Slider(value: widget.danmakuController.option.lineHeight,@@ -224,6 +231,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {),),SettingsTile.switchTile(+ leading: Icons.vertical_align_top_rounded,onToggle: (value) {bool show =value ?? widget.danmakuController.option.hideTop;@@ -239,6 +247,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {initialValue: !widget.danmakuController.option.hideTop,),SettingsTile.switchTile(+ leading: Icons.vertical_align_bottom_rounded,onToggle: (value) {bool show = value ??widget.danmakuController.option.hideBottom;@@ -255,6 +264,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {!widget.danmakuController.option.hideBottom,),SettingsTile.switchTile(+ leading: Icons.swap_horiz_rounded,onToggle: (value) {bool show = value ??widget.danmakuController.option.hideScroll;@@ -271,6 +281,7 @@ class _DanmakuSettingsSheetState extends State<_DanmakuSettingsSheet> {!widget.danmakuController.option.hideScroll,),SettingsTile.switchTile(+ leading: Icons.speed_rounded,onToggle: (value) {bool followSpeed = value ??!GStorage.getSetting<bool>(diff --git a/lib/pages/settings/decoder_settings.dart b/lib/pages/settings/decoder_settings.dartindex f52ae2df..aa6bf7e2 100644--- a/lib/pages/settings/decoder_settings.dart+++ b/lib/pages/settings/decoder_settings.dart@@ -29,7 +29,6 @@ class _DecoderSettingsState extends State<DecoderSettings> {title: Text('硬件解码器'),),body: SettingsList(- maxWidth: 1000,sections: [SettingsRadioSection<String>(title: Text('选择不受支持的解码器将回退到软件解码'),diff --git a/lib/pages/settings/displaymode_settings.dart b/lib/pages/settings/displaymode_settings.dartindex 04c0732b..21e750a3 100644--- a/lib/pages/settings/displaymode_settings.dart+++ b/lib/pages/settings/displaymode_settings.dart@@ -72,7 +72,6 @@ class _SetDisplayModeState extends State<SetDisplayMode> {body: (modes.isEmpty)? const CircularProgressIndicator(): SettingsList(- maxWidth: 1000,sections: [SettingsRadioSection<DisplayMode>(title: Text('没有生效? 重启app试试'),diff --git a/lib/pages/settings/download_settings.dart b/lib/pages/settings/download_settings.dartindex a2722ee2..874d7b64 100644--- a/lib/pages/settings/download_settings.dart+++ b/lib/pages/settings/download_settings.dart@@ -111,12 +111,12 @@ class _DownloadSettingsPageState extends State<DownloadSettingsPage> {return SettingsDetailScaffold(title: const Text('下载设置'),body: SettingsList(- maxWidth: 1000,sections: [SettingsSection(title: Text('并发设置'),tiles: [SettingsTile(+ leading: Icons.video_library_rounded,title: Text('同时下载集数'),description: Column(crossAxisAlignment: CrossAxisAlignment.start,@@ -142,6 +142,7 @@ class _DownloadSettingsPageState extends State<DownloadSettingsPage> {),),SettingsTile(+ leading: Icons.call_split_rounded,title: Text('分片并发数'),description: Column(crossAxisAlignment: CrossAxisAlignment.start,@@ -172,6 +173,7 @@ class _DownloadSettingsPageState extends State<DownloadSettingsPage> {title: Text('缓存设置'),tiles: [SettingsTile(+ leading: Icons.folder_rounded,title: Text('下载位置'),description: Column(crossAxisAlignment: CrossAxisAlignment.start,@@ -208,6 +210,7 @@ class _DownloadSettingsPageState extends State<DownloadSettingsPage> {onPressed: (_) => _selectDownloadDirectory(),),SettingsTile.switchTile(+ leading: Icons.subtitles_rounded,onToggle: (value) {setState(() => downloadDanmaku = value ?? !downloadDanmaku);GStorage.putSetting(@@ -225,6 +228,7 @@ class _DownloadSettingsPageState extends State<DownloadSettingsPage> {title: Text('说明'),tiles: [SettingsTile(+ leading: Icons.info_outline_rounded,title: Text('关于并发设置'),description: Text('• 集数并发:同时下载多少集视频\n'diff --git a/lib/pages/settings/interface_settings.dart b/lib/pages/settings/interface_settings.dartindex 4cb8a045..55ea941d 100644--- a/lib/pages/settings/interface_settings.dart+++ b/lib/pages/settings/interface_settings.dart@@ -44,8 +44,9 @@ class _InterfaceSettingsPageState extends State<InterfaceSettingsPage> {title: Text('界面设置'),body: SettingsList(sections: [- SettingsSection(tiles: [+ SettingsSection(title: Text('启动'), tiles: [SettingsTile(+ leading: Icons.home_rounded,onPressed: (_) async {if (defaultPageMenuController.isOpen) {defaultPageMenuController.close();@@ -88,8 +89,9 @@ class _InterfaceSettingsPageState extends State<InterfaceSettingsPage> {),),]),- SettingsSection(tiles: [+ SettingsSection(title: Text('展示信息'), tiles: [SettingsTile.switchTile(+ leading: Icons.star_rounded,onToggle: (value) async {showRating = value ?? !showRating;await GStorage.putSetting(SettingsKeys.showRating, showRating);@@ -99,9 +101,8 @@ class _InterfaceSettingsPageState extends State<InterfaceSettingsPage> {description: Text('关闭后将在概览中隐藏评分信息'),initialValue: showRating,),- ]),- SettingsSection(tiles: [SettingsTile.switchTile(+ leading: Icons.insights_rounded,onToggle: (value) async {showAnimeCounter = value ?? !showAnimeCounter;await GStorage.putSetting(diff --git a/lib/pages/settings/keyboard_settings.dart b/lib/pages/settings/keyboard_settings.dartindex c1a2731b..5c1bedcf 100644--- a/lib/pages/settings/keyboard_settings.dart+++ b/lib/pages/settings/keyboard_settings.dart@@ -284,7 +284,7 @@ class _KeyboardSettingsPageState extends State<KeyboardSettingsPage> {elevation: 0,margin: const EdgeInsets.only(bottom: 12),color: colorScheme.surfaceContainerLow,- shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),clipBehavior: Clip.antiAlias,child: Padding(padding: const EdgeInsets.fromLTRB(16, 16, 16, 12),diff --git a/lib/pages/settings/player_settings.dart b/lib/pages/settings/player_settings.dartindex 7d9e0e21..2cb60a1e 100644--- a/lib/pages/settings/player_settings.dart+++ b/lib/pages/settings/player_settings.dart@@ -273,11 +273,12 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {child: SettingsDetailScaffold(title: const Text('播放设置'),body: SettingsList(- maxWidth: 1000,sections: [SettingsSection(+ title: Text('解码与渲染'),tiles: [SettingsTile.switchTile(+ leading: Icons.memory_rounded,onToggle: (value) async {hAenable = value ?? !hAenable;await GStorage.putSetting<bool>(@@ -288,6 +289,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: hAenable,),SettingsTile(+ leading: Icons.developer_board_rounded,onPressed: (_) async {await context.pushNamed('/settings/player/decoder');},@@ -296,6 +298,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),if (Platform.isAndroid) ...[SettingsTile(+ leading: Icons.tv_rounded,onPressed: (_) async {await context.pushNamed('/settings/player/renderer');},@@ -304,6 +307,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),],SettingsTile.switchTile(+ leading: Icons.data_saver_on_rounded,enabled: !MeteredNetworkService.isMetered,onToggle: (value) async {lowMemoryMode = value ?? !lowMemoryMode;@@ -321,6 +325,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),if (Platform.isAndroid) ...[SettingsTile.switchTile(+ leading: Icons.graphic_eq_rounded,onToggle: (value) async {androidEnableOpenSLES = value ?? !androidEnableOpenSLES;await GStorage.putSetting<bool>(@@ -334,6 +339,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),],SettingsTile(+ leading: Icons.auto_awesome_rounded,onPressed: (_) async {context.pushNamed('/settings/player/super');},@@ -342,8 +348,10 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {],),SettingsSection(+ title: Text('播放行为'),tiles: [SettingsTile.switchTile(+ leading: Icons.headphones_rounded,onToggle: (value) async {backgroundPlayback = value ?? !backgroundPlayback;await GStorage.putSetting<bool>(@@ -355,6 +363,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: backgroundPlayback,),SettingsTile.switchTile(+ leading: Icons.history_rounded,onToggle: (value) async {playResume = value ?? !playResume;await GStorage.putSetting<bool>(@@ -366,6 +375,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: playResume,),SettingsTile.switchTile(+ leading: Icons.playlist_play_rounded,onToggle: (value) async {autoPlayNext = value ?? !autoPlayNext;await GStorage.putSetting<bool>(@@ -378,6 +388,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),if (Platform.isAndroid)SettingsTile.switchTile(+ leading: Icons.picture_in_picture_alt_rounded,onToggle: (value) async {androidAutoEnterPIP = value ?? !androidAutoEnterPIP;await GStorage.putSetting<bool>(@@ -392,6 +403,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: androidAutoEnterPIP,),SettingsTile.switchTile(+ leading: Icons.block_rounded,onToggle: (value) async {forceAdBlocker = value ?? !forceAdBlocker;await GStorage.putSetting<bool>(@@ -403,6 +415,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: forceAdBlocker,),SettingsTile.switchTile(+ leading: Icons.animation_rounded,onToggle: (value) async {playerDisableAnimations = value ?? !playerDisableAnimations;await GStorage.putSetting<bool>(@@ -416,6 +429,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),if (!isDesktop())SettingsTile.switchTile(+ leading: Icons.swipe_vertical_rounded,onToggle: (value) async {brightnessVolumeGesture =value ?? !brightnessVolumeGesture;@@ -429,6 +443,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: brightnessVolumeGesture,),SettingsTile.switchTile(+ leading: Icons.visibility_off_rounded,onToggle: (value) async {privateMode = value ?? !privateMode;await GStorage.putSetting<bool>(@@ -442,8 +457,10 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {],),SettingsSection(+ title: Text('诊断'),tiles: [SettingsTile.switchTile(+ leading: Icons.error_outline_rounded,onToggle: (value) async {showPlayerError = value ?? !showPlayerError;await GStorage.putSetting<bool>(@@ -455,6 +472,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: showPlayerError,),SettingsTile.switchTile(+ leading: Icons.bug_report_rounded,onToggle: (value) async {playerDebugMode = value ?? !playerDebugMode;await GStorage.putSetting<bool>(@@ -466,6 +484,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {initialValue: playerDebugMode,),SettingsTile(+ leading: Icons.receipt_long_rounded,onPressed: (_) async {if (playerLogLevelMenuController.isOpen) {playerLogLevelMenuController.close();@@ -510,8 +529,10 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {],),SettingsSection(+ title: Text('播放参数'),tiles: [SettingsTile(+ leading: Icons.speed_rounded,title: Text('默认倍速'),description: Slider(value: defaultPlaySpeed,@@ -526,6 +547,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),),SettingsTile(+ leading: Icons.fast_forward_rounded,title: Text('默认方向键/长按倍速'),description: Slider(value: defaultShortcutForwardPlaySpeed,@@ -540,6 +562,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),),SettingsTile(+ leading: Icons.swap_horiz_rounded,description: Slider(value: playerArrowKeySkipTime.toDouble(),min: 0,@@ -561,6 +584,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {title: Text('左右方向键的快进/快退秒数'),),SettingsTile(+ leading: Icons.skip_next_rounded,onPressed: (_) async {await updateButtonSkipTime();},@@ -569,6 +593,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {value: Text('$playerButtonSkipTime 秒'),),SettingsTile(+ leading: Icons.timer_rounded,title: Text('播放控制器消失时间:${formatPlayerControllerLayerDisappearSeconds(playerControllerLayerDisappearSeconds)}'),description: Slider(@@ -582,6 +607,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {),),SettingsTile(+ leading: Icons.aspect_ratio_rounded,onPressed: (_) async {if (playerAspectRatioMenuController.isOpen) {playerAspectRatioMenuController.close();@@ -629,6 +655,7 @@ class _PlayerSettingsPageState extends State<PlayerSettingsPage> {SettingsSection(tiles: [SettingsTile(+ leading: Icons.settings_backup_restore_rounded,onPressed: (_) => resetPlayerSettings(),title: Text('恢复默认设置'),description: Text('将播放相关设置恢复为默认值'),diff --git a/lib/pages/settings/proxy/proxy_settings_page.dart b/lib/pages/settings/proxy/proxy_settings_page.dartindex 6c7aa00f..ed1d4277 100644--- a/lib/pages/settings/proxy/proxy_settings_page.dart+++ b/lib/pages/settings/proxy/proxy_settings_page.dart@@ -57,12 +57,12 @@ class _ProxySettingsPageState extends State<ProxySettingsPage> {child: SettingsDetailScaffold(title: const Text('代理设置'),body: SettingsList(- maxWidth: 800,sections: [SettingsSection(title: Text('代理'),tiles: [SettingsTile.switchTile(+ leading: Icons.vpn_key_rounded,onToggle: (value) async {await updateProxyEnable(value ?? !proxyEnable);},@@ -71,6 +71,7 @@ class _ProxySettingsPageState extends State<ProxySettingsPage> {initialValue: proxyEnable,),SettingsTile(+ leading: Icons.tune_rounded,onPressed: (_) async {await context.pushNamed('/settings/proxy/editor');setState(() {diff --git a/lib/pages/settings/renderer_settings.dart b/lib/pages/settings/renderer_settings.dartindex 2283a3ac..69dcd8b7 100644--- a/lib/pages/settings/renderer_settings.dart+++ b/lib/pages/settings/renderer_settings.dart@@ -29,7 +29,6 @@ class _RendererSettingsState extends State<RendererSettings> {title: Text('视频渲染器'),),body: SettingsList(- maxWidth: 1000,sections: [SettingsRadioSection<String>(title: Text('选择合适的渲染器以获得最佳播放体验'),diff --git a/lib/pages/settings/settings_page.dart b/lib/pages/settings/settings_page.dartindex 145431f8..2d2a3015 100644--- a/lib/pages/settings/settings_page.dart+++ b/lib/pages/settings/settings_page.dart@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';import 'package:flutter_modular/flutter_modular.dart';import 'package:kazumi/bean/appbar/sys_app_bar.dart';import 'package:kazumi/bean/settings/settings_detail_scaffold.dart';+import 'package:kazumi/bean/settings/settings_list.dart';import 'package:kazumi/pages/about/about_page.dart';import 'package:kazumi/pages/my/my_controller.dart';import 'package:kazumi/pages/plugin_editor/plugin_view_page.dart';@@ -330,8 +331,8 @@ class _SettingsPageState extends State<SettingsPage> {padding: const EdgeInsets.fromLTRB(28, 16, 28, 8),child: Text(group.title,- style: textTheme.titleSmall- ?.copyWith(color: colorScheme.onSurfaceVariant),+ style:+ textTheme.titleSmall?.copyWith(color: colorScheme.primary),),),for (final category in group.categories)@@ -354,27 +355,20 @@ class _SettingsPageState extends State<SettingsPage> {children: [for (final group in _settingsGroups) ...[Padding(- padding: const EdgeInsets.fromLTRB(4, 16, 4, 8),+ padding: const EdgeInsets.fromLTRB(16, 16, 16, 8),child: Text(group.title,- style: textTheme.titleSmall- ?.copyWith(color: colorScheme.onSurfaceVariant),+ style: textTheme.titleSmall?.copyWith(color: colorScheme.primary),),),- Material(- // Material, not Container, so the ink ripple paints above the fill.- color: colorScheme.surfaceContainerLow,- borderRadius: BorderRadius.circular(16),- clipBehavior: Clip.antiAlias,- child: Column(- children: [- for (final category in group.categories)- _CategoryTile(- category: category,- onTap: () => setState(() => _selected = category),- ),- ],- ),+ SettingsSplitGroup(+ children: [+ for (final category in group.categories)+ _CategoryTile(+ category: category,+ onTap: () => setState(() => _selected = category),+ ),+ ],),],],@@ -445,6 +439,7 @@ class _CategoryTile extends StatelessWidget {final textTheme = Theme.of(context).textTheme;return InkWell(onTap: onTap,+ onHighlightChanged: SettingsSplitGroup.pressReporterOf(context),child: Padding(padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),child: Row(diff --git a/lib/pages/settings/super_resolution_settings.dart b/lib/pages/settings/super_resolution_settings.dartindex e0724d39..ebe4eaa7 100644--- a/lib/pages/settings/super_resolution_settings.dart+++ b/lib/pages/settings/super_resolution_settings.dart@@ -34,7 +34,6 @@ class _SuperResolutionSettingsState extends State<SuperResolutionSettings> {title: Text('超分辨率'),),body: SettingsList(- maxWidth: 1000,sections: [SettingsRadioSection<SuperResolutionMode>(title: Text('超分辨率需要启用硬件解码, 若启用硬件解码后仍然不生效, 尝试切换视频渲染器为 gpu'),@@ -62,6 +61,7 @@ class _SuperResolutionSettingsState extends State<SuperResolutionSettings> {title: Text('默认行为'),tiles: [SettingsTile.switchTile(+ leading: Icons.notifications_off_rounded,title: Text('关闭提示'),description: Text('关闭每次启用超分辨率时的提示'),initialValue: disableWarning,diff --git a/lib/pages/settings/theme_settings_page.dart b/lib/pages/settings/theme_settings_page.dartindex 8c3cffbd..cce0b444 100644--- a/lib/pages/settings/theme_settings_page.dart+++ b/lib/pages/settings/theme_settings_page.dart@@ -143,12 +143,12 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {child: SettingsDetailScaffold(title: const Text('外观设置'),body: SettingsList(- maxWidth: 1000,sections: [SettingsSection(title: Text('外观'),tiles: [SettingsTile(+ leading: Icons.dark_mode_rounded,onPressed: (_) {if (menuController.isOpen) {menuController.close();@@ -263,6 +263,7 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {),),SettingsTile(+ leading: Icons.palette_rounded,enabled: !useDynamicColor,onPressed: (_) async {KazumiDialog.show(builder: (context) {@@ -313,6 +314,7 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {title: Text('配色方案'),),SettingsTile.switchTile(+ leading: Icons.colorize_rounded,enabled: !Platform.isIOS,onToggle: (value) async {useDynamicColor = value ?? !useDynamicColor;@@ -325,6 +327,7 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {initialValue: useDynamicColor,),SettingsTile.switchTile(+ leading: Icons.font_download_rounded,onToggle: (value) async {useSystemFont = value ?? !useSystemFont;await GStorage.putSetting(@@ -347,8 +350,10 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {bottomInfo: Text('动态配色仅支持安卓12及以上和桌面平台'),),SettingsSection(+ title: Text('显示'),tiles: [SettingsTile.switchTile(+ leading: Icons.contrast_rounded,onToggle: (value) async {oledEnhance = value ?? !oledEnhance;await GStorage.putSetting(@@ -364,8 +369,10 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {),if (isDesktop())SettingsSection(+ title: Text('窗口'),tiles: [SettingsTile.switchTile(+ leading: Icons.web_asset_rounded,onToggle: (value) async {showWindowButton = value ?? !showWindowButton;await GStorage.putSetting(@@ -380,8 +387,10 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {),if (Platform.isAndroid)SettingsSection(+ title: Text('屏幕'),tiles: [SettingsTile(+ leading: Icons.sixty_fps_rounded,onPressed: (_) async {context.pushNamed('/settings/theme/display');},diff --git a/lib/pages/webdav_editor/webdav_setting.dart b/lib/pages/webdav_editor/webdav_setting.dartindex 2b3d208a..de99b798 100644--- a/lib/pages/webdav_editor/webdav_setting.dart+++ b/lib/pages/webdav_editor/webdav_setting.dart@@ -78,12 +78,12 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {child: SettingsDetailScaffold(title: const Text('同步设置'),body: SettingsList(- maxWidth: 1000,sections: [SettingsSection(title: Text('规则仓库'),tiles: [SettingsTile.switchTile(+ leading: Icons.hub_rounded,onToggle: (value) async {enableGitProxy = value ?? !enableGitProxy;await GStorage.putSetting(@@ -100,6 +100,7 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {title: Text('Bangumi'),tiles: [SettingsTile.switchTile(+ leading: Icons.cloud_rounded,onToggle: (value) async {enableBangumiProxy = value ?? !enableBangumiProxy;await GStorage.putSetting(@@ -113,6 +114,7 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {initialValue: enableBangumiProxy,),SettingsTile.switchTile(+ leading: Icons.sync_rounded,onToggle: (value) async {final tBangumiEnableSync = value ?? !bangumiSyncEnable;final bangumi = BangumiSyncService();@@ -149,6 +151,7 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {initialValue: bangumiSyncEnable,),SettingsTile(+ leading: Icons.tune_rounded,onPressed: (_) async {await context.pushNamed('/settings/bangumi/');bangumiSyncEnable =@@ -163,6 +166,7 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {title: Text('WEBDAV'),tiles: [SettingsTile.switchTile(+ leading: Icons.cloud_sync_rounded,onToggle: (value) async {webDavEnable = value ?? !webDavEnable;if (!WebDav().initialized && webDavEnable) {@@ -191,6 +195,7 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {initialValue: webDavEnable,),SettingsTile.switchTile(+ leading: Icons.history_rounded,onToggle: (value) async {if (!webDavEnable) {KazumiDialog.showToast(message: '请先开启WEBDAV同步');@@ -206,6 +211,7 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {initialValue: webDavEnableHistory,),SettingsTile.switchTile(+ leading: Icons.favorite_rounded,onToggle: (value) async {if (!webDavEnable) {KazumiDialog.showToast(message: '请先开启WEBDAV同步');@@ -221,12 +227,14 @@ class _PlayerSettingsPageState extends State<WebDavSettingsPage> {initialValue: webDavEnableCollect,),SettingsTile(+ leading: Icons.tune_rounded,onPressed: (_) async {context.pushNamed('/settings/webdav/editor');},title: Text('WEBDAV配置'),),SettingsTile(+ leading: Icons.cloud_upload_rounded,trailing: const Icon(Icons.sync_rounded),onPressed: (_) {syncHistoryWithWebDav();