mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
opt: set repeat ui (#1854)
This commit is contained in:
committed by
GitHub
parent
a375d8525f
commit
348bc8b920
@@ -24,6 +24,7 @@ class PopupListTile<T> extends StatefulWidget {
|
|||||||
required this.value,
|
required this.value,
|
||||||
required this.itemBuilder,
|
required this.itemBuilder,
|
||||||
required this.onSelected,
|
required this.onSelected,
|
||||||
|
this.descFontSize = 13,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool? dense;
|
final bool? dense;
|
||||||
@@ -36,6 +37,7 @@ class PopupListTile<T> extends StatefulWidget {
|
|||||||
final ValueGetter<(T, String)> value;
|
final ValueGetter<(T, String)> value;
|
||||||
final PopupMenuItemBuilder<T> itemBuilder;
|
final PopupMenuItemBuilder<T> itemBuilder;
|
||||||
final PopupMenuItemSelected<T> onSelected;
|
final PopupMenuItemSelected<T> onSelected;
|
||||||
|
final double descFontSize;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PopupListTile<T>> createState() => _PopupListTileState<T>();
|
State<PopupListTile<T>> createState() => _PopupListTileState<T>();
|
||||||
@@ -88,7 +90,7 @@ class _PopupListTileState<T> extends State<PopupListTile<T>> {
|
|||||||
final desc = Text(
|
final desc = Text(
|
||||||
descStr,
|
descStr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: widget.descFontSize,
|
||||||
color: widget.enabled
|
color: widget.enabled
|
||||||
? theme.colorScheme.secondary
|
? theme.colorScheme.secondary
|
||||||
: theme.disabledColor,
|
: theme.disabledColor,
|
||||||
|
|||||||
@@ -466,14 +466,15 @@ class HeaderControlState extends State<HeaderControl>
|
|||||||
final value = plPlayerController.superResolutionType.value;
|
final value = plPlayerController.superResolutionType.value;
|
||||||
return (value, value.label);
|
return (value, value.label);
|
||||||
},
|
},
|
||||||
itemBuilder: (_) => enumItemBuilder<SuperResolutionType>(
|
itemBuilder: (_) => enumItemBuilder(
|
||||||
SuperResolutionType.values,
|
SuperResolutionType.values,
|
||||||
),
|
),
|
||||||
onSelected: (value, setState) {
|
onSelected: (value, setState) {
|
||||||
plPlayerController.setShader(value);
|
plPlayerController.setShader(value);
|
||||||
setState();
|
setState();
|
||||||
},
|
},
|
||||||
descPosType: .title,
|
descFontSize: 12,
|
||||||
|
descPosType: .subtitle,
|
||||||
),
|
),
|
||||||
if (!isFileSource)
|
if (!isFileSource)
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -618,18 +619,21 @@ class HeaderControlState extends State<HeaderControl>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
ListTile(
|
PopupListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
onTap: () {
|
|
||||||
Get.back();
|
|
||||||
showSetRepeat();
|
|
||||||
},
|
|
||||||
leading: const Icon(Icons.repeat, size: 20),
|
leading: const Icon(Icons.repeat, size: 20),
|
||||||
title: const Text('播放顺序', style: titleStyle),
|
title: const Text('播放顺序'),
|
||||||
subtitle: Text(
|
value: () {
|
||||||
plPlayerController.playRepeat.label,
|
final value = plPlayerController.playRepeat;
|
||||||
style: subTitleStyle,
|
return (value, value.label);
|
||||||
),
|
},
|
||||||
|
itemBuilder: (_) => enumItemBuilder(PlayRepeat.values),
|
||||||
|
onSelected: (value, setState) {
|
||||||
|
plPlayerController.setPlayRepeat(value);
|
||||||
|
setState();
|
||||||
|
},
|
||||||
|
descPosType: .subtitle,
|
||||||
|
descFontSize: 12,
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
@@ -1651,58 +1655,6 @@ class HeaderControlState extends State<HeaderControl>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 播放顺序
|
|
||||||
void showSetRepeat() {
|
|
||||||
showBottomSheet(
|
|
||||||
(context, setState) {
|
|
||||||
final theme = Theme.of(context);
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(12),
|
|
||||||
child: Material(
|
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
color: theme.colorScheme.surface,
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
|
||||||
child: CustomScrollView(
|
|
||||||
slivers: [
|
|
||||||
const SliverToBoxAdapter(
|
|
||||||
child: SizedBox(
|
|
||||||
height: 45,
|
|
||||||
child: Center(
|
|
||||||
child: Text('选择播放顺序', style: titleStyle),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SliverList.builder(
|
|
||||||
itemCount: PlayRepeat.values.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final i = PlayRepeat.values[index];
|
|
||||||
return ListTile(
|
|
||||||
dense: true,
|
|
||||||
onTap: () {
|
|
||||||
Get.back();
|
|
||||||
plPlayerController.setPlayRepeat(i);
|
|
||||||
},
|
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 20,
|
|
||||||
),
|
|
||||||
title: Text(i.label),
|
|
||||||
trailing: plPlayerController.playRepeat == i
|
|
||||||
? Icon(
|
|
||||||
Icons.done,
|
|
||||||
color: theme.colorScheme.primary,
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
late final isFileSource = videoDetailCtr.isFileSource;
|
late final isFileSource = videoDetailCtr.isFileSource;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user