diff --git a/lib/common/widgets/list_sheet.dart b/lib/common/widgets/list_sheet.dart index 2657e339a..7ab6d7c5d 100644 --- a/lib/common/widgets/list_sheet.dart +++ b/lib/common/widgets/list_sheet.dart @@ -275,174 +275,168 @@ class _ListSheetContentState extends State @override Widget build(BuildContext context) { - return ColoredBox( - color: Theme.of(context).colorScheme.surface, - child: Column( - children: [ - Container( - height: 45, - padding: EdgeInsets.symmetric( - horizontal: widget.showTitle != false ? 14 : 6), - child: Row( - children: [ - if (widget.showTitle != false) - Text( - '合集(${_isList ? widget.season.epCount : episodes?.length ?? ''})', - style: Theme.of(context).textTheme.titleMedium, - ), - StreamBuilder( - stream: _favStream?.stream, - builder: (context, snapshot) => snapshot.hasData - ? mediumButton( - tooltip: _seasonFav == 1 ? '取消订阅' : '订阅', - icon: _seasonFav == 1 - ? Icons.notifications_off_outlined - : Icons.notifications_active_outlined, - onPressed: () async { - dynamic result = await VideoHttp.seasonFav( - isFav: _seasonFav == 1, - seasonId: widget.season.id, - ); - if (result['status']) { - SmartDialog.showToast( - '${_seasonFav == 1 ? '取消' : ''}订阅成功'); - _seasonFav = _seasonFav == 1 ? 0 : 1; - _favStream?.add(_seasonFav); - } else { - SmartDialog.showToast(result['msg']); - } - }, - ) - : const SizedBox.shrink(), - ), - mediumButton( - tooltip: '跳至顶部', - icon: Icons.vertical_align_top, - onPressed: () { - try { - itemScrollController[_ctr?.index ?? 0].scrollTo( - index: !reverse[_ctr?.index ?? 0] - ? 0 - : _isList - ? widget.season.sections[_ctr?.index].episodes - .length - - 1 - : episodes.length - 1, - duration: const Duration(milliseconds: 200), - ); - } catch (_) {} - }, + return Column( + children: [ + Container( + height: 45, + padding: EdgeInsets.symmetric( + horizontal: widget.showTitle != false ? 14 : 6), + child: Row( + children: [ + if (widget.showTitle != false) + Text( + '合集(${_isList ? widget.season.epCount : episodes?.length ?? ''})', + style: Theme.of(context).textTheme.titleMedium, ), - mediumButton( - tooltip: '跳至底部', - icon: Icons.vertical_align_bottom, + StreamBuilder( + stream: _favStream?.stream, + builder: (context, snapshot) => snapshot.hasData + ? mediumButton( + tooltip: _seasonFav == 1 ? '取消订阅' : '订阅', + icon: _seasonFav == 1 + ? Icons.notifications_off_outlined + : Icons.notifications_active_outlined, + onPressed: () async { + dynamic result = await VideoHttp.seasonFav( + isFav: _seasonFav == 1, + seasonId: widget.season.id, + ); + if (result['status']) { + SmartDialog.showToast( + '${_seasonFav == 1 ? '取消' : ''}订阅成功'); + _seasonFav = _seasonFav == 1 ? 0 : 1; + _favStream?.add(_seasonFav); + } else { + SmartDialog.showToast(result['msg']); + } + }, + ) + : const SizedBox.shrink(), + ), + mediumButton( + tooltip: '跳至顶部', + icon: Icons.vertical_align_top, + onPressed: () { + try { + itemScrollController[_ctr?.index ?? 0].scrollTo( + index: !reverse[_ctr?.index ?? 0] + ? 0 + : _isList + ? widget.season.sections[_ctr?.index].episodes + .length - + 1 + : episodes.length - 1, + duration: const Duration(milliseconds: 200), + ); + } catch (_) {} + }, + ), + mediumButton( + tooltip: '跳至底部', + icon: Icons.vertical_align_bottom, + onPressed: () { + try { + itemScrollController[_ctr?.index ?? 0].scrollTo( + index: !reverse[_ctr?.index ?? 0] + ? _isList + ? widget.season.sections[_ctr?.index].episodes + .length - + 1 + : episodes.length - 1 + : 0, + duration: const Duration(milliseconds: 200), + ); + } catch (_) {} + }, + ), + mediumButton( + tooltip: '跳至当前', + icon: Icons.my_location, + onPressed: () async { + if (_ctr != null && _ctr?.index != (_index)) { + _ctr?.animateTo(_index); + await Future.delayed(const Duration(milliseconds: 225)); + } + try { + itemScrollController[_ctr?.index ?? 0].scrollTo( + index: currentIndex, + duration: const Duration(milliseconds: 200), + ); + } catch (_) {} + }, + ), + if (widget.isSupportReverse == true) + if (!_isList) + _reverseButton + else + StreamBuilder( + stream: _indexStream?.stream, + initialData: _index, + builder: (context, snapshot) { + return snapshot.data == _index + ? _reverseButton + : const SizedBox.shrink(); + }, + ), + const Spacer(), + StreamBuilder( + stream: _indexStream?.stream, + initialData: _index, + builder: (context, snapshot) => mediumButton( + tooltip: reverse[snapshot.data] ? '顺序' : '倒序', + icon: !reverse[snapshot.data] + ? MdiIcons.sortNumericAscending + : MdiIcons.sortNumericDescending, onPressed: () { - try { - itemScrollController[_ctr?.index ?? 0].scrollTo( - index: !reverse[_ctr?.index ?? 0] - ? _isList - ? widget.season.sections[_ctr?.index].episodes - .length - - 1 - : episodes.length - 1 - : 0, - duration: const Duration(milliseconds: 200), - ); - } catch (_) {} + setState(() { + reverse[_ctr?.index ?? 0] = !reverse[_ctr?.index ?? 0]; + }); }, ), + ), + if (widget.onClose != null) mediumButton( - tooltip: '跳至当前', - icon: Icons.my_location, - onPressed: () async { - if (_ctr != null && _ctr?.index != (_index)) { - _ctr?.animateTo(_index); - await Future.delayed(const Duration(milliseconds: 225)); - } - try { - itemScrollController[_ctr?.index ?? 0].scrollTo( - index: currentIndex, - duration: const Duration(milliseconds: 200), - ); - } catch (_) {} - }, - ), - if (widget.isSupportReverse == true) - if (!_isList) - _reverseButton - else - StreamBuilder( - stream: _indexStream?.stream, - initialData: _index, - builder: (context, snapshot) { - return snapshot.data == _index - ? _reverseButton - : const SizedBox.shrink(); - }, - ), - const Spacer(), - StreamBuilder( - stream: _indexStream?.stream, - initialData: _index, - builder: (context, snapshot) => mediumButton( - tooltip: reverse[snapshot.data] ? '顺序' : '倒序', - icon: !reverse[snapshot.data] - ? MdiIcons.sortNumericAscending - : MdiIcons.sortNumericDescending, - onPressed: () { - setState(() { - reverse[_ctr?.index ?? 0] = !reverse[_ctr?.index ?? 0]; - }); - }, - ), + tooltip: '关闭', + icon: Icons.close, + onPressed: widget.onClose, ), - if (widget.onClose != null) - mediumButton( - tooltip: '关闭', - icon: Icons.close, - onPressed: widget.onClose, - ), - ], - ), + ], ), - Divider( - height: 1, - color: Theme.of(context).dividerColor.withOpacity(0.1), + ), + Divider( + height: 1, + color: Theme.of(context).dividerColor.withOpacity(0.1), + ), + if (_isList) + TabBar( + controller: _ctr, + padding: const EdgeInsets.only(right: 60), + isScrollable: true, + tabs: (widget.season.sections as List) + .map((item) => Tab(text: item.title)) + .toList(), + dividerHeight: 1, + dividerColor: Theme.of(context).dividerColor.withOpacity(0.1), ), - if (_isList) - Material( - color: Theme.of(context).colorScheme.surface, - child: TabBar( - controller: _ctr, - padding: const EdgeInsets.only(right: 60), - isScrollable: true, - tabs: (widget.season.sections as List) - .map((item) => Tab(text: item.title)) - .toList(), - dividerHeight: 1, - dividerColor: Theme.of(context).dividerColor.withOpacity(0.1), - ), - ), - Expanded( - child: _isList - ? Material( - color: Theme.of(context).colorScheme.surface, - child: TabBarView( - controller: _ctr, - children: List.generate( - widget.season.sections.length, - (index) => _buildBody( - index, widget.season.sections[index].episodes), - ), + Expanded( + child: _isList + ? Material( + color: Colors.transparent, + child: TabBarView( + controller: _ctr, + children: List.generate( + widget.season.sections.length, + (index) => _buildBody( + index, widget.season.sections[index].episodes), ), - ) - : Material( - color: Theme.of(context).colorScheme.surface, - child: _buildBody(null, episodes), ), - ), - ], - ), + ) + : Material( + color: Colors.transparent, + child: _buildBody(null, episodes), + ), + ), + ], ); } diff --git a/lib/common/widgets/video_card_h.dart b/lib/common/widgets/video_card_h.dart index 58b7c5614..1bfb9d455 100644 --- a/lib/common/widgets/video_card_h.dart +++ b/lib/common/widgets/video_card_h.dart @@ -42,133 +42,135 @@ class VideoCardH extends StatelessWidget { try { type = videoItem.type; } catch (_) {} - return Stack(children: [ - Semantics( - label: Utils.videoItemSemantics(videoItem), - excludeSemantics: true, - // customSemanticsActions: { - // for (var item in actions) - // CustomSemanticsAction( - // label: item.title.isEmpty ? 'label' : item.title): item.onTap!, - // }, - child: InkWell( - onLongPress: () { - if (onLongPress != null) { - onLongPress!(); - } else { - imageSaveDialog( - context: context, - title: videoItem.title is String - ? videoItem.title - : videoItem.title is List - ? (videoItem.title as List) - .map((item) => item['text']) - .join() - : '', - cover: videoItem.pic, - ); - } - }, - onTap: () async { - if (onTap != null) { - onTap?.call(); - return; - } - if (type == 'ketang') { - SmartDialog.showToast('课堂视频暂不支持播放'); - return; - } - if (videoItem is HotVideoItemModel && - videoItem.redirectUrl?.isNotEmpty == true) { - if (Utils.viewPgcFromUri(videoItem.redirectUrl!)) { + return Stack( + children: [ + Semantics( + label: Utils.videoItemSemantics(videoItem), + excludeSemantics: true, + // customSemanticsActions: { + // for (var item in actions) + // CustomSemanticsAction( + // label: item.title.isEmpty ? 'label' : item.title): item.onTap!, + // }, + child: InkWell( + onLongPress: () { + if (onLongPress != null) { + onLongPress!(); + } else { + imageSaveDialog( + context: context, + title: videoItem.title is String + ? videoItem.title + : videoItem.title is List + ? (videoItem.title as List) + .map((item) => item['text']) + .join() + : '', + cover: videoItem.pic, + ); + } + }, + onTap: () async { + if (onTap != null) { + onTap?.call(); return; } - } - try { - final int cid = - videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid); - Get.toNamed( - '/video?bvid=$bvid&cid=$cid', - arguments: { - 'videoItem': videoItem, - 'heroTag': Utils.makeHeroTag(aid) - }, - ); - } catch (err) { - SmartDialog.showToast(err.toString()); - } - }, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: - (BuildContext context, BoxConstraints boxConstraints) { - final double maxWidth = boxConstraints.maxWidth; - final double maxHeight = boxConstraints.maxHeight; - return Stack( - children: [ - NetworkImgLayer( - src: videoItem.pic as String, - width: maxWidth, - height: maxHeight, - ), - if (videoItem is HotVideoItemModel && - videoItem.pgcLabel?.isNotEmpty == true) - PBadge( - text: videoItem.pgcLabel, - top: 6.0, - right: 6.0, - ), - if (videoItem.duration != 0) - PBadge( - text: Utils.timeFormat(videoItem.duration!), - right: 6.0, - bottom: 6.0, - type: 'gray', - ), - if (type != 'video') - PBadge( - text: type, - left: 6.0, - bottom: 6.0, - type: 'primary', + if (type == 'ketang') { + SmartDialog.showToast('课堂视频暂不支持播放'); + return; + } + if (videoItem is HotVideoItemModel && + videoItem.redirectUrl?.isNotEmpty == true) { + if (Utils.viewPgcFromUri(videoItem.redirectUrl!)) { + return; + } + } + try { + final int cid = videoItem.cid ?? + await SearchHttp.ab2c(aid: aid, bvid: bvid); + Get.toNamed( + '/video?bvid=$bvid&cid=$cid', + arguments: { + 'videoItem': videoItem, + 'heroTag': Utils.makeHeroTag(aid) + }, + ); + } catch (err) { + SmartDialog.showToast(err.toString()); + } + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (BuildContext context, + BoxConstraints boxConstraints) { + final double maxWidth = boxConstraints.maxWidth; + final double maxHeight = boxConstraints.maxHeight; + return Stack( + children: [ + NetworkImgLayer( + src: videoItem.pic as String, + width: maxWidth, + height: maxHeight, ), - // if (videoItem.rcmdReason != null && - // videoItem.rcmdReason.content != '') - // pBadge(videoItem.rcmdReason.content, context, - // 6.0, 6.0, null, null), - ], - ); - }, + if (videoItem is HotVideoItemModel && + videoItem.pgcLabel?.isNotEmpty == true) + PBadge( + text: videoItem.pgcLabel, + top: 6.0, + right: 6.0, + ), + if (videoItem.duration != 0) + PBadge( + text: Utils.timeFormat(videoItem.duration!), + right: 6.0, + bottom: 6.0, + type: 'gray', + ), + if (type != 'video') + PBadge( + text: type, + left: 6.0, + bottom: 6.0, + type: 'primary', + ), + // if (videoItem.rcmdReason != null && + // videoItem.rcmdReason.content != '') + // pBadge(videoItem.rcmdReason.content, context, + // 6.0, 6.0, null, null), + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - videoContent(context), - ], + const SizedBox(width: 10), + videoContent(context), + ], + ), ), ), ), - ), - if (source == 'normal') - Positioned( - bottom: 0, - right: 12, - child: VideoPopupMenu( - size: 29, - iconSize: 17, - videoItem: videoItem, + if (source == 'normal') + Positioned( + bottom: 0, + right: 12, + child: VideoPopupMenu( + size: 29, + iconSize: 17, + videoItem: videoItem, + ), ), - ), - ]); + ], + ); } Widget videoContent(context) { diff --git a/lib/main.dart b/lib/main.dart index a54f6d0ed..66f727988 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -53,7 +53,7 @@ void main() async { ], ); } - if (GStorage.badCertificateCallback) { + if (BuildConfig.isDebug || GStorage.badCertificateCallback) { HttpOverrides.global = _CustomHttpOverrides(); } await setupServiceLocator(); diff --git a/lib/pages/bangumi/introduction/widgets/intro_detail.dart b/lib/pages/bangumi/introduction/widgets/intro_detail.dart index 2684dd207..60f09802d 100644 --- a/lib/pages/bangumi/introduction/widgets/intro_detail.dart +++ b/lib/pages/bangumi/introduction/widgets/intro_detail.dart @@ -22,10 +22,8 @@ class IntroDetail extends StatelessWidget { fontSize: 12, color: Theme.of(context).colorScheme.onSurface, ); - return Container( - color: Theme.of(context).colorScheme.surface, + return Padding( padding: const EdgeInsets.only(left: 14, right: 14), - // height: Utils.getSheetHeight(context), child: Column( children: [ Container( diff --git a/lib/pages/common/reply_controller.dart b/lib/pages/common/reply_controller.dart index 430fb4c58..e0daf4be9 100644 --- a/lib/pages/common/reply_controller.dart +++ b/lib/pages/common/reply_controller.dart @@ -329,7 +329,7 @@ abstract class ReplyController extends CommonController { dynamic mid, }) async { // biliSendCommAntifraud - if (_biliSendCommAntifraud && Platform.isAndroid) { + if (Platform.isAndroid && _biliSendCommAntifraud) { try { List cookies = await Request.cookieManager.cookieJar .loadForRequest(Uri.parse(HttpString.apiBaseUrl)); diff --git a/lib/pages/dynamics/detail/view.dart b/lib/pages/dynamics/detail/view.dart index 3a8270d59..0679ee437 100644 --- a/lib/pages/dynamics/detail/view.dart +++ b/lib/pages/dynamics/detail/view.dart @@ -179,6 +179,7 @@ class _DynamicDetailPageState extends State ScaffoldState? scaffoldState = Scaffold.maybeOf(context); if (scaffoldState != null) { scaffoldState.showBottomSheet( + backgroundColor: Colors.transparent, (context) => MediaQuery.removePadding( context: context, removeLeft: true, diff --git a/lib/pages/html/view.dart b/lib/pages/html/view.dart index bd3103311..85c538439 100644 --- a/lib/pages/html/view.dart +++ b/lib/pages/html/view.dart @@ -168,6 +168,7 @@ class _HtmlRenderPageState extends State ScaffoldState? scaffoldState = Scaffold.maybeOf(context); if (scaffoldState != null) { scaffoldState.showBottomSheet( + backgroundColor: Colors.transparent, (context) => MediaQuery.removePadding( context: context, removeLeft: true, diff --git a/lib/pages/member/controller.dart b/lib/pages/member/controller.dart index 21835f912..1c2ab3c48 100644 --- a/lib/pages/member/controller.dart +++ b/lib/pages/member/controller.dart @@ -120,6 +120,7 @@ class MemberController extends GetxController { await Get.bottomSheet( GroupPanel(mid: mid), isScrollControlled: true, + backgroundColor: Theme.of(context).colorScheme.surface, ); Get.back(); }, diff --git a/lib/pages/setting/pages/play_speed_set.dart b/lib/pages/setting/pages/play_speed_set.dart index 7d6fb0b73..bc3fc35da 100644 --- a/lib/pages/setting/pages/play_speed_set.dart +++ b/lib/pages/setting/pages/play_speed_set.dart @@ -133,6 +133,7 @@ class _PlaySpeedPageState extends State { context: context, isScrollControlled: true, clipBehavior: Clip.hardEdge, + backgroundColor: Theme.of(context).colorScheme.surface, builder: (context) { return Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 761fb82db..957e6d303 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -298,9 +298,10 @@ class VideoDetailController extends GetxController } // 稍后再看面板展开 - showMediaListPanel() { + showMediaListPanel(context) { if (mediaList.isNotEmpty) { childKey.currentState?.showBottomSheet( + backgroundColor: Theme.of(context).colorScheme.surface, (context) => MediaListPanel( mediaList: mediaList, changeMediaList: (bvid, cid, aid, cover) { @@ -1235,6 +1236,7 @@ class VideoDetailController extends GetxController childKey.currentState?.showBottomSheet( enableDrag: false, (context) => _postPanel(), + backgroundColor: Colors.transparent, ); } } diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 3f9a1771f..199196ab1 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -28,7 +28,6 @@ import 'package:share_plus/share_plus.dart'; import '../../../../http/search.dart'; import '../../../../models/model_hot_video_item.dart'; import '../related/index.dart'; -import 'widgets/group_panel.dart'; class VideoIntroController extends GetxController with GetTickerProviderStateMixin { @@ -852,17 +851,6 @@ class VideoIntroController extends GetxController return true; } - // 设置关注分组 - void setFollowGroup() { - if (videoDetail.value.owner == null) { - return; - } - Get.bottomSheet( - GroupPanel(mid: videoDetail.value.owner!.mid!), - isScrollControlled: true, - ); - } - // ai总结 Future aiConclusion() async { SmartDialog.showLoading(msg: '正在获取AI总结'); diff --git a/lib/pages/video/detail/introduction/widgets/fav_panel.dart b/lib/pages/video/detail/introduction/widgets/fav_panel.dart index 85ef5ee76..bfabc4ef9 100644 --- a/lib/pages/video/detail/introduction/widgets/fav_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/fav_panel.dart @@ -38,184 +38,172 @@ class _FavPanelState extends State { } return false; }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(18), - color: Theme.of(context).colorScheme.surface, - ), - child: Column( - children: [ - AppBar( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(18), + child: Column( + children: [ + AppBar( + backgroundColor: Colors.transparent, + leading: IconButton( + tooltip: '关闭', + onPressed: Get.back, + icon: const Icon(Icons.close_outlined), + ), + title: const Text('添加到收藏夹'), + actions: [ + TextButton.icon( + onPressed: () { + Get.toNamed('/createFav')?.then((data) { + if (data != null) { + (widget.ctr?.favFolderData.value as FavFolderData?) + ?.list + ?.insert(1, data); + widget.ctr?.favFolderData.refresh(); + } + }); + }, + icon: Icon( + Icons.add, + color: Theme.of(context).colorScheme.primary, ), - ), - leading: IconButton( - tooltip: '关闭', - onPressed: Get.back, - icon: const Icon(Icons.close_outlined), - ), - title: const Text('添加到收藏夹'), - actions: [ - TextButton.icon( - onPressed: () { - Get.toNamed('/createFav')?.then((data) { - if (data != null) { - (widget.ctr?.favFolderData.value as FavFolderData?) - ?.list - ?.insert(1, data); - widget.ctr?.favFolderData.refresh(); - } - }); - }, - icon: Icon( - Icons.add, - color: Theme.of(context).colorScheme.primary, - ), - label: const Text('新建收藏夹'), - style: TextButton.styleFrom( - padding: const EdgeInsets.symmetric( - horizontal: 18, vertical: 14), - visualDensity: const VisualDensity( - horizontal: -2, - vertical: -2, - ), + label: const Text('新建收藏夹'), + style: TextButton.styleFrom( + padding: + const EdgeInsets.symmetric(horizontal: 18, vertical: 14), + visualDensity: const VisualDensity( + horizontal: -2, + vertical: -2, ), ), - const SizedBox(width: 16), - ], - ), - Expanded( - child: Material( - color: Theme.of(context).colorScheme.surface, - child: FutureBuilder( - future: _futureBuilderFuture, - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.done) { - // TODO: refactor - if (snapshot.data is! Map) { - return HttpError( - isSliver: false, + ), + const SizedBox(width: 16), + ], + ), + Expanded( + child: FutureBuilder( + future: _futureBuilderFuture, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + // TODO: refactor + if (snapshot.data is! Map) { + return HttpError( + isSliver: false, + callback: () => setState(() { + _futureBuilderFuture = widget.ctr.queryVideoInFolder(); + }), + ); + } + Map data = snapshot.data as Map; + if (data['status']) { + return Obx( + () => Material( + color: Colors.transparent, + child: ListView.builder( + controller: widget.scrollController, + itemCount: widget.ctr.favFolderData.value.list.length, + itemBuilder: (context, index) { + return ListTile( + onTap: () => widget.ctr.onChoose( + widget.ctr.favFolderData.value.list[index] + .favState != + 1, + index), + dense: true, + leading: Utils.isPublic(widget + .ctr.favFolderData.value.list[index].attr) + ? const Icon(Icons.folder_outlined) + : const Icon(Icons.lock_outline), + minLeadingWidth: 0, + title: Text(widget + .ctr.favFolderData.value.list[index].title!), + subtitle: Text( + '${widget.ctr.favFolderData.value.list[index].mediaCount}个内容 . ${Utils.isPublicText(widget.ctr.favFolderData.value.list[index].attr)}', + ), + trailing: Transform.scale( + scale: 0.9, + child: Checkbox( + value: widget.ctr.favFolderData.value + .list[index].favState == + 1, + onChanged: (bool? checkValue) => + widget.ctr.onChoose(checkValue!, index), + ), + ), + ); + }, + ), + ), + ); + } else { + return CustomScrollView( + controller: widget.scrollController, + slivers: [ + HttpError( + errMsg: data['msg'], callback: () => setState(() { _futureBuilderFuture = widget.ctr.queryVideoInFolder(); }), - ); - } - Map data = snapshot.data as Map; - if (data['status']) { - return Obx( - () => ListView.builder( - controller: widget.scrollController, - itemCount: - widget.ctr.favFolderData.value.list.length, - itemBuilder: (context, index) { - return ListTile( - onTap: () => widget.ctr.onChoose( - widget.ctr.favFolderData.value.list[index] - .favState != - 1, - index), - dense: true, - leading: Utils.isPublic(widget.ctr.favFolderData - .value.list[index].attr) - ? const Icon(Icons.folder_outlined) - : const Icon(Icons.lock_outline), - minLeadingWidth: 0, - title: Text(widget.ctr.favFolderData.value - .list[index].title!), - subtitle: Text( - '${widget.ctr.favFolderData.value.list[index].mediaCount}个内容 . ${Utils.isPublicText(widget.ctr.favFolderData.value.list[index].attr)}', - ), - trailing: Transform.scale( - scale: 0.9, - child: Checkbox( - value: widget.ctr.favFolderData.value - .list[index].favState == - 1, - onChanged: (bool? checkValue) => - widget.ctr.onChoose(checkValue!, index), - ), - ), - ); - }, - ), - ); - } else { - return CustomScrollView( - controller: widget.scrollController, - slivers: [ - HttpError( - errMsg: data['msg'], - callback: () => setState(() { - _futureBuilderFuture = - widget.ctr.queryVideoInFolder(); - }), - ) - ], - ); - } - } else { - // 骨架屏 - return const Center( - child: CircularProgressIndicator(), - ); - } - }, - ), - ), + ) + ], + ); + } + } else { + // 骨架屏 + return const Center( + child: CircularProgressIndicator(), + ); + } + }, ), - Divider( - height: 1, - color: Theme.of(context).disabledColor.withOpacity(0.08), + ), + Divider( + height: 1, + color: Theme.of(context).disabledColor.withOpacity(0.08), + ), + Padding( + padding: EdgeInsets.only( + left: 20, + right: 20, + top: 12, + bottom: MediaQuery.of(context).padding.bottom + 12, ), - Padding( - padding: EdgeInsets.only( - left: 20, - right: 20, - top: 12, - bottom: MediaQuery.of(context).padding.bottom + 12, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - onPressed: () => Get.back(), - style: TextButton.styleFrom( - padding: const EdgeInsets.symmetric( - horizontal: 20, vertical: 10), - visualDensity: const VisualDensity( - horizontal: -1, - vertical: -2, - ), - foregroundColor: Theme.of(context).colorScheme.outline, - backgroundColor: - Theme.of(context).colorScheme.onInverseSurface, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () => Get.back(), + style: TextButton.styleFrom( + padding: const EdgeInsets.symmetric( + horizontal: 20, vertical: 10), + visualDensity: const VisualDensity( + horizontal: -1, + vertical: -2, ), - child: const Text('取消'), + foregroundColor: Theme.of(context).colorScheme.outline, + backgroundColor: + Theme.of(context).colorScheme.onInverseSurface, ), - const SizedBox(width: 25), - FilledButton.tonal( - onPressed: () async { - feedBack(); - await widget.ctr.actionFavVideo(); - }, - style: FilledButton.styleFrom( - padding: const EdgeInsets.symmetric( - horizontal: 20, vertical: 10), - visualDensity: const VisualDensity( - horizontal: -1, - vertical: -2, - ), + child: const Text('取消'), + ), + const SizedBox(width: 25), + FilledButton.tonal( + onPressed: () async { + feedBack(); + await widget.ctr.actionFavVideo(); + }, + style: FilledButton.styleFrom( + padding: const EdgeInsets.symmetric( + horizontal: 20, vertical: 10), + visualDensity: const VisualDensity( + horizontal: -1, + vertical: -2, ), - child: const Text('完成'), ), - ], - ), + child: const Text('完成'), + ), + ], ), - ], - ), + ), + ], ), ); } diff --git a/lib/pages/video/detail/introduction/widgets/group_panel.dart b/lib/pages/video/detail/introduction/widgets/group_panel.dart index 306e259ec..4dab4a87f 100644 --- a/lib/pages/video/detail/introduction/widgets/group_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/group_panel.dart @@ -77,126 +77,116 @@ class _GroupPanelState extends State { } return false; }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(18), - color: Theme.of(context).colorScheme.surface, - ), - child: Column( - children: [ - AppBar( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(18), - ), - ), - leading: IconButton( - tooltip: '关闭', - onPressed: Get.back, - icon: const Icon(Icons.close_outlined)), - title: const Text('设置关注分组'), - ), - Expanded( - child: Material( - color: Theme.of(context).colorScheme.surface, - child: FutureBuilder( - future: _futureBuilderFuture, - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.done) { - // TODO: refactor - if (snapshot.data is! Map) { - return HttpError( - isSliver: false, - callback: () => setState(() { - _futureBuilderFuture = MemberHttp.followUpTags(); - }), - ); - } - Map data = snapshot.data as Map; - if (data['status']) { - return ListView.builder( - controller: widget.scrollController, - itemCount: tagsList.length, - itemBuilder: (context, index) { - return ListTile( - onTap: () { - tagsList[index].checked = - !tagsList[index].checked!; - showDefaultBtn = - !tagsList.any((e) => e.checked == true); - setState(() {}); - }, - dense: true, - leading: const Icon(Icons.group_outlined), - minLeadingWidth: 0, - title: Text(tagsList[index].name ?? ''), - subtitle: tagsList[index].tip != '' - ? Text(tagsList[index].tip ?? '') - : null, - trailing: Transform.scale( - scale: 0.9, - child: Checkbox( - value: tagsList[index].checked, - onChanged: (bool? checkValue) { - tagsList[index].checked = checkValue; - showDefaultBtn = - !tagsList.any((e) => e.checked == true); - setState(() {}); - }, - ), + child: Column( + children: [ + AppBar( + backgroundColor: Colors.transparent, + leading: IconButton( + tooltip: '关闭', + onPressed: Get.back, + icon: const Icon(Icons.close_outlined)), + title: const Text('设置关注分组'), + ), + Expanded( + child: FutureBuilder( + future: _futureBuilderFuture, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + // TODO: refactor + if (snapshot.data is! Map) { + return HttpError( + isSliver: false, + callback: () => setState(() { + _futureBuilderFuture = MemberHttp.followUpTags(); + }), + ); + } + Map data = snapshot.data as Map; + if (data['status']) { + return Material( + color: Colors.transparent, + child: ListView.builder( + controller: widget.scrollController, + itemCount: tagsList.length, + itemBuilder: (context, index) { + return ListTile( + onTap: () { + tagsList[index].checked = + !tagsList[index].checked!; + showDefaultBtn = + !tagsList.any((e) => e.checked == true); + setState(() {}); + }, + dense: true, + leading: const Icon(Icons.group_outlined), + minLeadingWidth: 0, + title: Text(tagsList[index].name ?? ''), + subtitle: tagsList[index].tip != '' + ? Text(tagsList[index].tip ?? '') + : null, + trailing: Transform.scale( + scale: 0.9, + child: Checkbox( + value: tagsList[index].checked, + onChanged: (bool? checkValue) { + tagsList[index].checked = checkValue; + showDefaultBtn = + !tagsList.any((e) => e.checked == true); + setState(() {}); + }, ), - ); - }, - ); - } else { - return CustomScrollView( - controller: widget.scrollController, - slivers: [ - HttpError( - errMsg: data['msg'], - callback: () => setState(() {}), ), - ], - ); - } - } else { - // 骨架屏 - return const Center( - child: CircularProgressIndicator(), - ); - } - }, - ), - ), + ); + }, + ), + ); + } else { + return CustomScrollView( + controller: widget.scrollController, + slivers: [ + HttpError( + errMsg: data['msg'], + callback: () => setState(() {}), + ), + ], + ); + } + } else { + // 骨架屏 + return const Center( + child: CircularProgressIndicator(), + ); + } + }, ), - Divider( - height: 1, - color: Theme.of(context).disabledColor.withOpacity(0.08), + ), + Divider( + height: 1, + color: Theme.of(context).disabledColor.withOpacity(0.08), + ), + Padding( + padding: EdgeInsets.only( + left: 20, + right: 20, + top: 12, + bottom: MediaQuery.of(context).padding.bottom + 12, ), - Padding( - padding: EdgeInsets.only( - left: 20, - right: 20, - top: 12, - bottom: MediaQuery.of(context).padding.bottom + 12, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - onPressed: () => onSave(), - style: TextButton.styleFrom( - padding: const EdgeInsets.only(left: 30, right: 30), - foregroundColor: Theme.of(context).colorScheme.onPrimary, - backgroundColor: Theme.of(context).colorScheme.primary, - ), - child: Text(showDefaultBtn ? '保存至默认分组' : '保存'), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + onPressed: () => onSave(), + style: TextButton.styleFrom( + padding: const EdgeInsets.only(left: 30, right: 30), + foregroundColor: Theme.of(context).colorScheme.onPrimary, + backgroundColor: Theme.of(context).colorScheme.primary, ), - ], - ), + child: Text(showDefaultBtn ? '保存至默认分组' : '保存'), + ), + ], ), - ], - ), + ), + ], ), ); } diff --git a/lib/pages/video/detail/introduction/widgets/intro_detail.dart b/lib/pages/video/detail/introduction/widgets/intro_detail.dart index 88c1ba78f..2008d5d01 100644 --- a/lib/pages/video/detail/introduction/widgets/intro_detail.dart +++ b/lib/pages/video/detail/introduction/widgets/intro_detail.dart @@ -19,10 +19,8 @@ class IntroDetail extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - color: Theme.of(context).colorScheme.surface, + return Padding( padding: const EdgeInsets.only(left: 14, right: 14), - // height: Utils.getSheetHeight(context), child: Column( children: [ InkWell( diff --git a/lib/pages/video/detail/member/horizontal_member_page.dart b/lib/pages/video/detail/member/horizontal_member_page.dart index 0640e1b6b..a0f598d3a 100644 --- a/lib/pages/video/detail/member/horizontal_member_page.dart +++ b/lib/pages/video/detail/member/horizontal_member_page.dart @@ -64,24 +64,8 @@ class _HorizontalMemberPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - toolbarHeight: 36, - actions: [ - iconButton( - context: context, - onPressed: Get.back, - tooltip: '关闭', - icon: Icons.clear, - size: 28, - ), - const SizedBox(width: 16), - ], - ), - body: Obx( - () => _buildUserPage(_controller.userState.value), - ), + return Obx( + () => _buildUserPage(_controller.userState.value), ); } @@ -90,11 +74,25 @@ class _HorizontalMemberPageState extends State { Loading() => loadingWidget, Success() => Column( children: [ + const SizedBox(height: 4), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + iconButton( + context: context, + onPressed: Get.back, + tooltip: '关闭', + icon: Icons.clear, + size: 32, + ), + const SizedBox(width: 16), + ], + ), _buildUserInfo(userState.response), const SizedBox(height: 5), Expanded( child: Obx(() => _buildVideoList(_controller.loadingState.value)), - ) + ), ], ), Error() => errorWidget( @@ -159,46 +157,49 @@ class _HorizontalMemberPageState extends State { Widget _buildVideoList(LoadingState loadingState) { return switch (loadingState) { Loading() => loadingWidget, - Success() => CustomScrollView( - slivers: [ - _buildSliverHeader, - SliverPadding( - padding: EdgeInsets.only( - bottom: MediaQuery.of(context).padding.bottom + 80, - ), - sliver: SliverGrid( - gridDelegate: SliverGridDelegateWithExtentAndRatio( - mainAxisSpacing: 2, - maxCrossAxisExtent: Grid.mediumCardWidth * 2, - childAspectRatio: StyleString.aspectRatio * 2.2, + Success() => Material( + color: Colors.transparent, + child: CustomScrollView( + slivers: [ + _buildSliverHeader, + SliverPadding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom + 80, ), - delegate: SliverChildBuilderDelegate( - (context, index) { - if (index == loadingState.response.length - 1) { - _controller.onLoadMore(); - } - return VideoCardHMemberVideo( - videoItem: loadingState.response[index], - bvid: _bvid, - onTap: () { - final Item videoItem = loadingState.response[index]; - widget.videoIntroController.changeSeasonOrbangu( - null, - videoItem.bvid, - videoItem.firstCid, - IdUtils.bv2av(videoItem.bvid!), - videoItem.cover, - ); - _bvid = videoItem.bvid; - setState(() {}); - }, - ); - }, - childCount: loadingState.response.length, + sliver: SliverGrid( + gridDelegate: SliverGridDelegateWithExtentAndRatio( + mainAxisSpacing: 2, + maxCrossAxisExtent: Grid.mediumCardWidth * 2, + childAspectRatio: StyleString.aspectRatio * 2.2, + ), + delegate: SliverChildBuilderDelegate( + (context, index) { + if (index == loadingState.response.length - 1) { + _controller.onLoadMore(); + } + return VideoCardHMemberVideo( + videoItem: loadingState.response[index], + bvid: _bvid, + onTap: () { + final Item videoItem = loadingState.response[index]; + widget.videoIntroController.changeSeasonOrbangu( + null, + videoItem.bvid, + videoItem.firstCid, + IdUtils.bv2av(videoItem.bvid!), + videoItem.cover, + ); + _bvid = videoItem.bvid; + setState(() {}); + }, + ); + }, + childCount: loadingState.response.length, + ), ), ), - ), - ], + ], + ), ), Error() => errorWidget( errMsg: loadingState.errMsg, diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 46b9ccd25..3f75de175 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -1116,7 +1116,7 @@ class MorePanel extends StatelessWidget { @override Widget build(BuildContext context) { Color errorColor = Theme.of(context).colorScheme.error; - return Container( + return Padding( padding: EdgeInsets.only( bottom: MediaQueryData.fromView( WidgetsBinding.instance.platformDispatcher.views.single) diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index d45b1bf78..7700bf9b1 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -1159,7 +1159,7 @@ class ReplyItemGrpc extends StatelessWidget { } Color errorColor = Theme.of(context).colorScheme.error; - return Container( + return Padding( padding: EdgeInsets.only( bottom: MediaQueryData.fromView( WidgetsBinding.instance.platformDispatcher.views.single) diff --git a/lib/pages/video/detail/reply_reply/view.dart b/lib/pages/video/detail/reply_reply/view.dart index dbcc0fd2a..bc811c610 100644 --- a/lib/pages/video/detail/reply_reply/view.dart +++ b/lib/pages/video/detail/reply_reply/view.dart @@ -497,6 +497,7 @@ class _VideoReplyReplyPanelState extends State upMid: _videoReplyReplyController.upMid, showDialogue: () { _key.currentState?.showBottomSheet( + backgroundColor: Colors.transparent, (context) => VideoReplyReplyPanel( oid: replyItem.oid.toInt(), rpid: replyItem.root.toInt(), diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 9d3a10f14..81504288c 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -887,13 +887,16 @@ class _VideoDetailPageState extends State if (videoDetailController.videoType == SearchType.video && videoDetailController.showRelatedVideo) - CustomScrollView( - controller: _introController, - slivers: [ - RelatedVideoPanel( - key: relatedVideoPanelKey, - heroTag: heroTag), - ], + Material( + color: Colors.transparent, + child: CustomScrollView( + controller: _introController, + slivers: [ + RelatedVideoPanel( + key: relatedVideoPanelKey, + heroTag: heroTag), + ], + ), ), if (videoDetailController.showReply) videoReplyPanel, @@ -1502,62 +1505,67 @@ class _VideoDetailPageState extends State ); Widget videoIntro([bool needRelated = true]) { - Widget introPanel() => CustomScrollView( - key: const PageStorageKey('简介'), - controller: needRelated ? _introController : null, - slivers: [ - if (videoDetailController.videoType == SearchType.video) ...[ - VideoIntroPanel( - heroTag: heroTag, - showAiBottomSheet: showAiBottomSheet, - showIntroDetail: showIntroDetail, - showEpisodes: showEpisodes, - onShowMemberPage: onShowMemberPage, - ), - if (needRelated && videoDetailController.showRelatedVideo) ...[ - SliverToBoxAdapter( - child: Padding( - padding: const EdgeInsets.only(top: StyleString.safeSpace), - child: Divider( - height: 1, - indent: 12, - endIndent: 12, - color: Theme.of(context) - .colorScheme - .outline - .withOpacity(0.08), + Widget introPanel() => Material( + color: Colors.transparent, + child: CustomScrollView( + key: const PageStorageKey('简介'), + controller: needRelated ? _introController : null, + slivers: [ + if (videoDetailController.videoType == SearchType.video) ...[ + VideoIntroPanel( + heroTag: heroTag, + showAiBottomSheet: showAiBottomSheet, + showIntroDetail: showIntroDetail, + showEpisodes: showEpisodes, + onShowMemberPage: onShowMemberPage, + ), + if (needRelated && videoDetailController.showRelatedVideo) ...[ + SliverToBoxAdapter( + child: Padding( + padding: + const EdgeInsets.only(top: StyleString.safeSpace), + child: Divider( + height: 1, + indent: 12, + endIndent: 12, + color: Theme.of(context) + .colorScheme + .outline + .withOpacity(0.08), + ), ), ), - ), - RelatedVideoPanel(key: relatedVideoPanelKey, heroTag: heroTag), - ] else - SliverToBoxAdapter( - child: SizedBox( - height: MediaQuery.paddingOf(context).bottom + - StyleString.safeSpace, + RelatedVideoPanel( + key: relatedVideoPanelKey, heroTag: heroTag), + ] else + SliverToBoxAdapter( + child: SizedBox( + height: MediaQuery.paddingOf(context).bottom + + StyleString.safeSpace, + ), + ), + ] else if (videoDetailController.videoType == + SearchType.media_bangumi) + Obx( + () => BangumiIntroPanel( + heroTag: heroTag, + cid: videoDetailController.cid.value, + showEpisodes: showEpisodes, + showIntroDetail: showIntroDetail, ), ), - ] else if (videoDetailController.videoType == - SearchType.media_bangumi) - Obx( - () => BangumiIntroPanel( - heroTag: heroTag, - cid: videoDetailController.cid.value, - showEpisodes: showEpisodes, - showIntroDetail: showIntroDetail, + SliverToBoxAdapter( + child: SizedBox( + height: MediaQuery.paddingOf(context).bottom + + (videoDetailController.isPlayAll && + MediaQuery.orientationOf(context) == + Orientation.landscape + ? 75 + : 0), ), - ), - SliverToBoxAdapter( - child: SizedBox( - height: MediaQuery.paddingOf(context).bottom + - (videoDetailController.isPlayAll && - MediaQuery.orientationOf(context) == - Orientation.landscape - ? 75 - : 0), - ), - ) - ], + ) + ], + ), ); if (videoDetailController.isPlayAll) { return Stack( @@ -1570,7 +1578,7 @@ class _VideoDetailPageState extends State child: Material( color: Colors.transparent, child: InkWell( - onTap: videoDetailController.showMediaListPanel, + onTap: () => videoDetailController.showMediaListPanel(context), borderRadius: const BorderRadius.all(Radius.circular(14)), child: Container( height: 54, @@ -1745,6 +1753,7 @@ class _VideoDetailPageState extends State int oid = replyItem.oid.toInt(); int rpid = GlobalData().grpcReply ? replyItem.id.toInt() : replyItem.rpid; videoDetailController.childKey.currentState?.showBottomSheet( + backgroundColor: Colors.transparent, (context) => VideoReplyReplyPanel( id: id, oid: oid, @@ -1764,6 +1773,7 @@ class _VideoDetailPageState extends State showAiBottomSheet() { videoDetailController.childKey.currentState?.showBottomSheet( enableDrag: true, + backgroundColor: Theme.of(context).colorScheme.surface, (context) => AiDetail(modelResult: videoIntroController.modelResult), ); } @@ -1771,6 +1781,7 @@ class _VideoDetailPageState extends State showIntroDetail(videoDetail, videoTags) { videoDetailController.childKey.currentState?.showBottomSheet( enableDrag: true, + backgroundColor: Theme.of(context).colorScheme.surface, (context) => videoDetail is BangumiInfoModel ? bangumi.IntroDetail( bangumiDetail: videoDetail, @@ -1814,9 +1825,16 @@ class _VideoDetailPageState extends State }, ); if (isFullScreen) { - Utils.showFSSheet(child: listSheetContent(), isFullScreen: isFullScreen); + Utils.showFSSheet( + child: Material( + color: Theme.of(context).colorScheme.surface, + child: listSheetContent(), + ), + isFullScreen: isFullScreen, + ); } else { videoDetailController.childKey.currentState?.showBottomSheet( + backgroundColor: Theme.of(context).colorScheme.surface, (context) => listSheetContent(), ); } @@ -2035,6 +2053,7 @@ class _VideoDetailPageState extends State Utils.showFSSheet(child: listSheetContent(), isFullScreen: isFullScreen); } else { videoDetailController.childKey.currentState?.showBottomSheet( + backgroundColor: Colors.transparent, (context) => listSheetContent(), ); } @@ -2056,6 +2075,7 @@ class _VideoDetailPageState extends State void onShowMemberPage(mid) { videoDetailController.childKey.currentState?.showBottomSheet( + backgroundColor: Theme.of(context).colorScheme.surface, (context) { return HorizontalMemberPage( mid: mid, diff --git a/lib/pages/video/detail/widgets/watch_later_list.dart b/lib/pages/video/detail/widgets/watch_later_list.dart index 13546a0af..5b4d17454 100644 --- a/lib/pages/video/detail/widgets/watch_later_list.dart +++ b/lib/pages/video/detail/widgets/watch_later_list.dart @@ -63,53 +63,45 @@ class _MediaListPanelState extends State { @override Widget build(BuildContext context) { - return DecoratedBox( - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, - ), - child: Column( - children: [ - AppBar( - toolbarHeight: 45, - automaticallyImplyLeading: false, - titleSpacing: 16, - title: Text(widget.panelTitle ?? '稍后再看'), - actions: [ - Obx( - () => mediumButton( - tooltip: desc.value ? '顺序播放' : '倒序播放', - icon: desc.value - ? MdiIcons.sortAscending - : MdiIcons.sortDescending, - onPressed: () { - widget.onReverse(); - desc.value = !desc.value; - }, - ), - ), - mediumButton( - tooltip: '关闭', - icon: Icons.close, - onPressed: Get.back, + return Column( + children: [ + AppBar( + toolbarHeight: 45, + automaticallyImplyLeading: false, + titleSpacing: 16, + title: Text(widget.panelTitle ?? '稍后再看'), + actions: [ + Obx( + () => mediumButton( + tooltip: desc.value ? '顺序播放' : '倒序播放', + icon: desc.value + ? MdiIcons.sortAscending + : MdiIcons.sortDescending, + onPressed: () { + widget.onReverse(); + desc.value = !desc.value; + }, ), - const SizedBox(width: 14), - ], - ), - Expanded( - child: Material( - color: Theme.of(context).colorScheme.surface, - child: widget.loadPrevious != null - ? refreshIndicator( - onRefresh: () async { - await widget.loadPrevious!(); - }, - child: _buildList, - ) - : _buildList, ), - ), - ], - ), + mediumButton( + tooltip: '关闭', + icon: Icons.close, + onPressed: Get.back, + ), + const SizedBox(width: 14), + ], + ), + Expanded( + child: widget.loadPrevious != null + ? refreshIndicator( + onRefresh: () async { + await widget.loadPrevious!(); + }, + child: _buildList, + ) + : _buildList, + ), + ], ); } diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index f736e4882..aff73ded3 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -320,6 +320,7 @@ class Utils { context: context, useSafeArea: true, isScrollControlled: true, + backgroundColor: Theme.of(context).colorScheme.surface, sheetAnimationStyle: AnimationStyle(curve: Curves.ease), builder: (BuildContext context) { return DraggableScrollableSheet( @@ -701,6 +702,7 @@ class Utils { context: context, useSafeArea: true, isScrollControlled: true, + backgroundColor: Theme.of(context).colorScheme.surface, sheetAnimationStyle: AnimationStyle(curve: Curves.ease), builder: (BuildContext context) { return DraggableScrollableSheet(