mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
fix: 分p或分集时字幕选择范围溢出;优先保持选择序号
This commit is contained in:
@@ -374,18 +374,21 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
: SizedBox(
|
||||
width: 42,
|
||||
height: 30,
|
||||
child: PopupMenuButton<Map<String, String>>(
|
||||
onSelected: (Map<String, String> value) {
|
||||
child: PopupMenuButton<int>(
|
||||
onSelected: (int value) {
|
||||
_.setSubtitle(value);
|
||||
},
|
||||
initialValue: _.vttSubtitles[_.vttSubtitlesIndex.value],
|
||||
initialValue:
|
||||
_.vttSubtitles.length < _.vttSubtitlesIndex.value
|
||||
? 0
|
||||
: _.vttSubtitlesIndex.value,
|
||||
color: Colors.black.withOpacity(0.8),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return _.vttSubtitles.map((Map<String, String> subtitle) {
|
||||
return PopupMenuItem<Map<String, String>>(
|
||||
value: subtitle,
|
||||
return _.vttSubtitles.asMap().entries.map((entry) {
|
||||
return PopupMenuItem<int>(
|
||||
value: entry.key,
|
||||
child: Text(
|
||||
"${subtitle['title']}",
|
||||
"${entry.value['title']}",
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user