opt: post segment panel

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-16 09:22:32 +08:00
parent 25d27e42ed
commit 8c408e59f6
3 changed files with 198 additions and 168 deletions

View File

@@ -1407,6 +1407,7 @@ class VideoDetailController extends GetxController
(index) => Stack(
children: [
Container(
width: double.infinity,
margin: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 5,
@@ -1420,43 +1421,57 @@ 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(
Row(
mainAxisSize: MainAxisSize.min,
children: segmentWidget(
isFirst: true,
index: index,
),
),
if (list![index].category !=
SegmentType
.poi_highlight) ...[
const SizedBox(width: 16),
...segmentWidget(
SegmentType.poi_highlight)
Row(
mainAxisSize:
MainAxisSize.min,
children: segmentWidget(
isFirst: false,
index: index,
),
],
),
],
),
const SizedBox(height: 8),
],
Wrap(
runSpacing: 8,
spacing: 16,
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text('分类: '),
PopupMenuButton(
initialValue:
list![index].category,
onSelected: (item) async {
list![index].category = item;
list![index].category =
item;
List<ActionType>
constraintList =
_segmentType2ActionType(
item);
if (constraintList
.contains(
list![index].actionType)
.contains(list![index]
.actionType)
.not) {
list![index].actionType =
constraintList.first;
@@ -1495,14 +1510,18 @@ class VideoDetailController extends GetxController
))
.toList(),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisSize:
MainAxisSize.min,
children: [
Text(
list![index].category.title,
list![index]
.category
.title,
style: TextStyle(
height: 1,
fontSize: 14,
color: Theme.of(context)
color:
Theme.of(context)
.colorScheme
.secondary,
),
@@ -1514,8 +1533,8 @@ class VideoDetailController extends GetxController
Icon(
MdiIcons
.unfoldMoreHorizontal,
size:
MediaQuery.textScalerOf(
size: MediaQuery
.textScalerOf(
context)
.scale(14),
color: Theme.of(context)
@@ -1525,14 +1544,20 @@ class VideoDetailController extends GetxController
],
),
),
const SizedBox(width: 16),
],
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text('行为类别: '),
PopupMenuButton(
initialValue:
list![index].actionType,
onSelected: (item) async {
list![index].actionType = item;
if (item == ActionType.full) {
list![index].actionType =
item;
if (item ==
ActionType.full) {
updateSegment(
isFirst: true,
index: index,
@@ -1544,20 +1569,23 @@ class VideoDetailController extends GetxController
itemBuilder: (context) =>
ActionType.values
.map(
(item) => PopupMenuItem<
(item) =>
PopupMenuItem<
ActionType>(
enabled: _segmentType2ActionType(
list![index]
.category)
.contains(item),
.contains(
item),
value: item,
child:
Text(item.title),
child: Text(
item.title),
),
)
.toList(),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisSize:
MainAxisSize.min,
children: [
Text(
list![index]
@@ -1566,7 +1594,8 @@ class VideoDetailController extends GetxController
style: TextStyle(
height: 1,
fontSize: 14,
color: Theme.of(context)
color:
Theme.of(context)
.colorScheme
.secondary,
),
@@ -1578,8 +1607,8 @@ class VideoDetailController extends GetxController
Icon(
MdiIcons
.unfoldMoreHorizontal,
size:
MediaQuery.textScalerOf(
size: MediaQuery
.textScalerOf(
context)
.scale(14),
color: Theme.of(context)
@@ -1593,6 +1622,8 @@ class VideoDetailController extends GetxController
),
],
),
],
),
),
Positioned(
top: 10,

View File

@@ -132,6 +132,7 @@ class _HeaderControlState extends State<HeaderControl> {
),
Expanded(
child: Material(
color: Colors.transparent,
child: MediaQuery.removePadding(
context: context,
removeBottom: true,
@@ -835,6 +836,7 @@ class _HeaderControlState extends State<HeaderControl> {
),
Expanded(
child: Material(
color: Colors.transparent,
child: Scrollbar(
child: MediaQuery.removePadding(
context: context,
@@ -920,6 +922,7 @@ class _HeaderControlState extends State<HeaderControl> {
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<HeaderControl> {
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<HeaderControl> {
child: Center(child: Text('选择播放顺序', style: titleStyle))),
Expanded(
child: Material(
color: Colors.transparent,
child: MediaQuery.removePadding(
context: context,
removeBottom: true,

View File

@@ -54,18 +54,12 @@ 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),
if (isFullScreen && padding != null)
SizedBox(height: padding),
],
)
: Row(