diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 9c0ad64b..30e03130 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -1407,6 +1407,7 @@ class VideoDetailController extends GetxController (index) => Stack( children: [ Container( + width: double.infinity, margin: const EdgeInsets.symmetric( horizontal: 16, vertical: 5, @@ -1420,174 +1421,204 @@ class VideoDetailController extends GetxController ), child: Column( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ if (list![index].actionType != ActionType.full) ...[ - Row( + Wrap( + runSpacing: 8, + spacing: 16, children: [ - ...segmentWidget( - isFirst: true, - index: index, - ), - if (list![index].category != - SegmentType - .poi_highlight) ...[ - const SizedBox(width: 16), - ...segmentWidget( - isFirst: false, + Row( + mainAxisSize: MainAxisSize.min, + children: segmentWidget( + isFirst: true, index: index, ), - ], + ), + if (list![index].category != + SegmentType.poi_highlight) + Row( + mainAxisSize: + MainAxisSize.min, + children: segmentWidget( + isFirst: false, + index: index, + ), + ), ], ), const SizedBox(height: 8), ], - Row( + Wrap( + runSpacing: 8, + spacing: 16, children: [ - const Text('分类: '), - PopupMenuButton( - initialValue: - list![index].category, - onSelected: (item) async { - list![index].category = item; - List - constraintList = - _segmentType2ActionType( - item); - if (constraintList - .contains( - list![index].actionType) - .not) { - list![index].actionType = - constraintList.first; - } - switch (item) { - case SegmentType - .poi_highlight: - updateSegment( - isFirst: false, - index: index, - value: list![index] - .segment - .first, - ); - break; - case SegmentType - .exclusive_access: - updateSegment( - isFirst: true, - index: index, - value: 0, - ); - break; - case _: - } - setState(() {}); - }, - itemBuilder: (context) => - SegmentType.values - .map((item) => - PopupMenuItem< - SegmentType>( - value: item, - child: Text( - item.title), - )) - .toList(), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - list![index].category.title, - style: TextStyle( - height: 1, - fontSize: 14, - color: Theme.of(context) - .colorScheme - .secondary, - ), - strutStyle: StrutStyle( - height: 1, - leading: 0, - ), - ), - Icon( - MdiIcons - .unfoldMoreHorizontal, - size: - MediaQuery.textScalerOf( - context) - .scale(14), - color: Theme.of(context) - .colorScheme - .secondary, - ), - ], - ), - ), - const SizedBox(width: 16), - const Text('行为类别: '), - PopupMenuButton( - initialValue: - list![index].actionType, - onSelected: (item) async { - list![index].actionType = item; - if (item == ActionType.full) { - updateSegment( - isFirst: true, - index: index, - value: 0, - ); - } - setState(() {}); - }, - itemBuilder: (context) => - ActionType.values - .map( - (item) => PopupMenuItem< - ActionType>( - enabled: _segmentType2ActionType( - list![index] - .category) - .contains(item), - value: item, - child: - Text(item.title), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Text('分类: '), + PopupMenuButton( + initialValue: + list![index].category, + onSelected: (item) async { + list![index].category = + item; + List + constraintList = + _segmentType2ActionType( + item); + if (constraintList + .contains(list![index] + .actionType) + .not) { + list![index].actionType = + constraintList.first; + } + switch (item) { + case SegmentType + .poi_highlight: + updateSegment( + isFirst: false, + index: index, + value: list![index] + .segment + .first, + ); + break; + case SegmentType + .exclusive_access: + updateSegment( + isFirst: true, + index: index, + value: 0, + ); + break; + case _: + } + setState(() {}); + }, + itemBuilder: (context) => + SegmentType.values + .map((item) => + PopupMenuItem< + SegmentType>( + value: item, + child: Text( + item.title), + )) + .toList(), + child: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Text( + list![index] + .category + .title, + style: TextStyle( + height: 1, + fontSize: 14, + color: + Theme.of(context) + .colorScheme + .secondary, ), - ) - .toList(), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - list![index] - .actionType - .title, - style: TextStyle( - height: 1, - fontSize: 14, - color: Theme.of(context) - .colorScheme - .secondary, - ), - strutStyle: StrutStyle( - height: 1, - leading: 0, - ), - ), - Icon( - MdiIcons - .unfoldMoreHorizontal, - size: - MediaQuery.textScalerOf( - context) + strutStyle: StrutStyle( + height: 1, + leading: 0, + ), + ), + Icon( + MdiIcons + .unfoldMoreHorizontal, + size: MediaQuery + .textScalerOf( + context) .scale(14), - color: Theme.of(context) - .colorScheme - .secondary, + color: Theme.of(context) + .colorScheme + .secondary, + ), + ], ), - ], - ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Text('行为类别: '), + PopupMenuButton( + initialValue: + list![index].actionType, + onSelected: (item) async { + list![index].actionType = + item; + if (item == + ActionType.full) { + updateSegment( + isFirst: true, + index: index, + value: 0, + ); + } + setState(() {}); + }, + itemBuilder: (context) => + ActionType.values + .map( + (item) => + PopupMenuItem< + ActionType>( + enabled: _segmentType2ActionType( + list![index] + .category) + .contains( + item), + value: item, + child: Text( + item.title), + ), + ) + .toList(), + child: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Text( + list![index] + .actionType + .title, + style: TextStyle( + height: 1, + fontSize: 14, + color: + Theme.of(context) + .colorScheme + .secondary, + ), + strutStyle: StrutStyle( + height: 1, + leading: 0, + ), + ), + Icon( + MdiIcons + .unfoldMoreHorizontal, + size: MediaQuery + .textScalerOf( + context) + .scale(14), + color: Theme.of(context) + .colorScheme + .secondary, + ), + ], + ), + ), + ], ), ], ), diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index bcce2a5f..a8a32357 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -132,6 +132,7 @@ class _HeaderControlState extends State { ), Expanded( child: Material( + color: Colors.transparent, child: MediaQuery.removePadding( context: context, removeBottom: true, @@ -835,6 +836,7 @@ class _HeaderControlState extends State { ), Expanded( child: Material( + color: Colors.transparent, child: Scrollbar( child: MediaQuery.removePadding( context: context, @@ -920,6 +922,7 @@ class _HeaderControlState extends State { child: Center(child: Text('选择音质', style: titleStyle))), Expanded( child: Material( + color: Colors.transparent, child: MediaQuery.removePadding( context: context, removeBottom: true, @@ -1010,6 +1013,7 @@ class _HeaderControlState extends State { child: Center(child: Text('选择解码格式', style: titleStyle))), Expanded( child: Material( + color: Colors.transparent, child: MediaQuery.removePadding( context: context, removeBottom: true, @@ -1739,6 +1743,7 @@ class _HeaderControlState extends State { child: Center(child: Text('选择播放顺序', style: titleStyle))), Expanded( child: Material( + color: Colors.transparent, child: MediaQuery.removePadding( context: context, removeBottom: true, diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index b9601f39..57e1b65f 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -54,20 +54,14 @@ class Utils { GetDialogRoute( pageBuilder: (buildContext, animation, secondaryAnimation) { return MediaQuery.orientationOf(Get.context!) == Orientation.portrait - ? isFullScreen - ? Column( - children: [ - const Spacer(flex: 4), - Expanded(flex: 6, child: child), - if (padding != null) SizedBox(height: padding), - ], - ) - : Column( - children: [ - const Spacer(flex: 3), - Expanded(flex: 7, child: child), - ], - ) + ? Column( + children: [ + const Spacer(flex: 3), + Expanded(flex: 7, child: child), + if (isFullScreen && padding != null) + SizedBox(height: padding), + ], + ) : Row( children: [ const Spacer(),