mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: video sheet
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -84,7 +84,11 @@ void imageSaveDialog({
|
||||
SmartDialog.dismiss();
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.download, size: 20),
|
||||
icon: Icon(
|
||||
Icons.download,
|
||||
size: 20,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/main.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/action_type.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/post_segment_model.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/segment_model.dart';
|
||||
@@ -1331,11 +1332,21 @@ class VideoDetailController extends GetxController
|
||||
}
|
||||
if (plPlayerController.isFullScreen.value) {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||
? Theme(
|
||||
data: MyApp.darkThemeData!,
|
||||
child: PostPanel(
|
||||
enableSlide: false,
|
||||
videoDetailController: this,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
)
|
||||
: PostPanel(
|
||||
enableSlide: false,
|
||||
videoDetailController: this,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
isFullScreen: () => plPlayerController.isFullScreen.value,
|
||||
);
|
||||
} else {
|
||||
@@ -1597,10 +1608,19 @@ class VideoDetailController extends GetxController
|
||||
void showNoteList(BuildContext context) async {
|
||||
if (plPlayerController.isFullScreen.value) {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||
? Theme(
|
||||
data: MyApp.darkThemeData!,
|
||||
child: NoteListPage(
|
||||
oid: oid.value,
|
||||
enableSlide: false,
|
||||
),
|
||||
)
|
||||
: NoteListPage(
|
||||
oid: oid.value,
|
||||
enableSlide: false,
|
||||
),
|
||||
isFullScreen: () => plPlayerController.isFullScreen.value,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -1813,7 +1813,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: listSheetContent(false),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
} else {
|
||||
@@ -1897,11 +1901,15 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
void showViewPoints() {
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: ViewPointsPage(
|
||||
enableSlide: false,
|
||||
videoDetailController: videoDetailController,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -2217,7 +2217,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
);
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: listSheetContent(false),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
} else {
|
||||
@@ -2301,11 +2305,15 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
void showViewPoints() {
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: ViewPointsPage(
|
||||
enableSlide: false,
|
||||
videoDetailController: videoDetailController,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -97,24 +97,21 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
/// 设置面板
|
||||
void showSettingSheet() {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
child: Builder(
|
||||
builder: (context) => Container(
|
||||
child: Theme(
|
||||
data: Theme.of(context),
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: 12 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: 0),
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
const SizedBox(height: 14),
|
||||
// ListTile(
|
||||
@@ -564,24 +561,25 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
void scheduleExit() async {
|
||||
const List<int> scheduleTimeChoices = [0, 15, 30, 45, 60];
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
child: StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
return Container(
|
||||
builder: (_, setState) {
|
||||
return Theme(
|
||||
data: Theme.of(context),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: 12 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 20),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 0, horizontal: 20),
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
const Center(child: Text('定时关闭', style: titleStyle)),
|
||||
@@ -590,7 +588,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
...[
|
||||
...scheduleTimeChoices,
|
||||
if (scheduleTimeChoices
|
||||
.contains(shutdownTimerService.scheduledExitInMinutes)
|
||||
.contains(
|
||||
shutdownTimerService.scheduledExitInMinutes)
|
||||
.not)
|
||||
shutdownTimerService.scheduledExitInMinutes,
|
||||
]..sort(),
|
||||
@@ -614,8 +613,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'\d+')),
|
||||
],
|
||||
decoration:
|
||||
const InputDecoration(suffixText: 'min'),
|
||||
decoration: const InputDecoration(
|
||||
suffixText: 'min'),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
@@ -631,10 +630,12 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
int choice = int.tryParse(duration) ?? 0;
|
||||
int choice =
|
||||
int.tryParse(duration) ?? 0;
|
||||
shutdownTimerService
|
||||
.scheduledExitInMinutes = choice;
|
||||
shutdownTimerService.startShutdownTimer();
|
||||
shutdownTimerService
|
||||
.startShutdownTimer();
|
||||
setState(() {});
|
||||
},
|
||||
child: Text('确定'),
|
||||
@@ -645,7 +646,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
);
|
||||
} else {
|
||||
Get.back();
|
||||
shutdownTimerService.scheduledExitInMinutes = choice;
|
||||
shutdownTimerService.scheduledExitInMinutes =
|
||||
choice;
|
||||
shutdownTimerService.startShutdownTimer();
|
||||
}
|
||||
},
|
||||
@@ -655,8 +657,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
: choice == 0
|
||||
? "禁用"
|
||||
: "$choice分钟后"),
|
||||
trailing:
|
||||
shutdownTimerService.scheduledExitInMinutes == choice
|
||||
trailing: shutdownTimerService.scheduledExitInMinutes ==
|
||||
choice
|
||||
? Icon(
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
@@ -682,8 +684,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
contentPadding: const EdgeInsets.only(),
|
||||
title: const Text("额外等待视频播放完毕", style: titleStyle),
|
||||
trailing: Transform.scale(
|
||||
alignment:
|
||||
Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
|
||||
alignment: Alignment
|
||||
.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
|
||||
@@ -696,7 +698,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
}),
|
||||
value: shutdownTimerService.waitForPlayingCompleted,
|
||||
onChanged: (value) => setState(() =>
|
||||
shutdownTimerService.waitForPlayingCompleted = value),
|
||||
shutdownTimerService.waitForPlayingCompleted =
|
||||
value),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -730,6 +733,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -761,20 +766,19 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
}
|
||||
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
child: Builder(
|
||||
builder: (context) => Container(
|
||||
child: Theme(
|
||||
data: Theme.of(context),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: 12 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
@@ -803,7 +807,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
color: Colors.transparent,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: 0),
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
for (int i = 0; i < totalQaSam; i++) ...[
|
||||
ListTile(
|
||||
@@ -856,6 +860,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -864,20 +869,19 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
final AudioQuality currentAudioQa = videoDetailCtr.currentAudioQa!;
|
||||
final List<AudioItem> audio = videoInfo.dash!.audio!;
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
child: Builder(
|
||||
builder: (context) => Container(
|
||||
child: Theme(
|
||||
data: Theme.of(context),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: 12 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
@@ -887,7 +891,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: 0),
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
for (final AudioItem i in audio) ...[
|
||||
ListTile(
|
||||
@@ -921,7 +925,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
trailing: currentAudioQa.code == i.id
|
||||
? Icon(
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
color:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
@@ -934,6 +939,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -954,20 +960,19 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
}
|
||||
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
child: Builder(
|
||||
builder: (context) => Container(
|
||||
child: Theme(
|
||||
data: Theme.of(context),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: 12 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
@@ -977,7 +982,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: 0),
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
for (var i in list) ...[
|
||||
ListTile(
|
||||
@@ -1002,7 +1007,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
trailing: i.startsWith(currentDecodeFormats.code)
|
||||
? Icon(
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
color:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
@@ -1015,6 +1021,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1062,27 +1069,27 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
final DanmakuController? danmakuController =
|
||||
widget.controller.danmakuController;
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
padding: isFullScreen ? 70 : null,
|
||||
child: StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter setState) {
|
||||
return Container(
|
||||
builder: (_, setState) {
|
||||
return Theme(
|
||||
data: Theme.of(context),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 12,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: 0),
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
height: 45,
|
||||
child: Center(child: Text('弹幕/字幕设置', style: titleStyle)),
|
||||
),
|
||||
@@ -1102,7 +1109,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
Get.toNamed('/danmakuBlock',
|
||||
arguments: widget.controller)
|
||||
},
|
||||
child: Text("屏蔽管理(${widget.controller.filterCount})")),
|
||||
child:
|
||||
Text("屏蔽管理(${widget.controller.filterCount})")),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
@@ -1116,10 +1124,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1142,10 +1151,12 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
padding: const EdgeInsets.only(top: 12, bottom: 18),
|
||||
child: Row(
|
||||
children: [
|
||||
for (final Map<String, dynamic> i in blockTypesList) ...[
|
||||
for (final Map<String, dynamic> i
|
||||
in blockTypesList) ...[
|
||||
ActionRowLineItem(
|
||||
onTap: () async {
|
||||
final bool isChoose = blockTypes.contains(i['value']);
|
||||
final bool isChoose =
|
||||
blockTypes.contains(i['value']);
|
||||
if (isChoose) {
|
||||
blockTypes.remove(i['value']);
|
||||
} else {
|
||||
@@ -1214,7 +1225,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
setState(() {});
|
||||
try {
|
||||
danmakuController?.updateOption(
|
||||
danmakuController.option.copyWith(massiveMode: value),
|
||||
danmakuController.option
|
||||
.copyWith(massiveMode: value),
|
||||
);
|
||||
} catch (_) {}
|
||||
},
|
||||
@@ -1231,10 +1243,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1269,10 +1282,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1308,10 +1322,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1327,7 +1342,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
setState(() {});
|
||||
try {
|
||||
danmakuController?.updateOption(
|
||||
danmakuController.option.copyWith(strokeWidth: val),
|
||||
danmakuController.option
|
||||
.copyWith(strokeWidth: val),
|
||||
);
|
||||
} catch (_) {}
|
||||
},
|
||||
@@ -1346,10 +1362,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0.5,
|
||||
@@ -1388,10 +1405,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0.5,
|
||||
@@ -1430,10 +1448,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 1,
|
||||
@@ -1471,10 +1490,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 1.0,
|
||||
@@ -1498,7 +1518,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Text('字幕字体大小 ${(subtitleFontScale * 100).toStringAsFixed(1)}%'),
|
||||
Text(
|
||||
'字幕字体大小 ${(subtitleFontScale * 100).toStringAsFixed(1)}%'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 0,
|
||||
@@ -1510,17 +1531,19 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0.5,
|
||||
max: 2.5,
|
||||
value: subtitleFontScale,
|
||||
divisions: 20,
|
||||
label: '${(subtitleFontScale * 100).toStringAsFixed(1)}%',
|
||||
label:
|
||||
'${(subtitleFontScale * 100).toStringAsFixed(1)}%',
|
||||
onChanged: (double val) {
|
||||
subtitleFontScale = val;
|
||||
widget.controller
|
||||
@@ -1545,17 +1568,19 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0.5,
|
||||
max: 2.5,
|
||||
value: subtitleFontScaleFS,
|
||||
divisions: 20,
|
||||
label: '${(subtitleFontScaleFS * 100).toStringAsFixed(1)}%',
|
||||
label:
|
||||
'${(subtitleFontScaleFS * 100).toStringAsFixed(1)}%',
|
||||
onChanged: (double val) {
|
||||
subtitleFontScaleFS = val;
|
||||
widget.controller
|
||||
@@ -1579,10 +1604,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1613,10 +1639,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1647,10 +1674,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
data: SliderThemeData(
|
||||
trackShape: MSliderTrackShape(),
|
||||
thumbColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor: Theme.of(context).colorScheme.primary,
|
||||
activeTrackColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
trackHeight: 10,
|
||||
thumbShape:
|
||||
const RoundSliderThumbShape(enabledThumbRadius: 6.0),
|
||||
thumbShape: const RoundSliderThumbShape(
|
||||
enabledThumbRadius: 6.0),
|
||||
),
|
||||
child: Slider(
|
||||
min: 0,
|
||||
@@ -1670,28 +1698,30 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 播放顺序
|
||||
void showSetRepeat() async {
|
||||
Utils.showFSSheet(
|
||||
context,
|
||||
isFullScreen: () => isFullScreen,
|
||||
child: Builder(
|
||||
builder: (context) => Container(
|
||||
child: Theme(
|
||||
data: Theme.of(context),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
bottom: 12 + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
margin: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
@@ -1701,7 +1731,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: 0),
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
for (final PlayRepeat i in PlayRepeat.values) ...[
|
||||
ListTile(
|
||||
@@ -1716,7 +1746,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
trailing: widget.controller.playRepeat == i
|
||||
? Icon(
|
||||
Icons.done,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
color:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: const SizedBox(),
|
||||
)
|
||||
@@ -1729,6 +1760,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -270,41 +270,52 @@ class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
static void showFSSheet({
|
||||
static void showFSSheet(
|
||||
BuildContext context, {
|
||||
required Widget child,
|
||||
required Function isFullScreen,
|
||||
double? padding,
|
||||
}) {
|
||||
Navigator.of(Get.context!).push(
|
||||
Navigator.of(context).push(
|
||||
GetDialogRoute(
|
||||
pageBuilder: (buildContext, animation, secondaryAnimation) {
|
||||
return MediaQuery.orientationOf(Get.context!) == Orientation.portrait
|
||||
? Column(
|
||||
? SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(flex: 3),
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: MediaQuery.removePadding(
|
||||
context: Get.context!,
|
||||
context: context,
|
||||
removeTop: true,
|
||||
removeBottom: true,
|
||||
removeLeft: true,
|
||||
removeRight: true,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
if (isFullScreen() && padding != null)
|
||||
SizedBox(height: padding),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Row(
|
||||
: SafeArea(
|
||||
child: Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
context: Get.context!,
|
||||
context: context,
|
||||
removeTop: true,
|
||||
removeBottom: true,
|
||||
removeLeft: true,
|
||||
removeRight: true,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
transitionDuration: const Duration(milliseconds: 350),
|
||||
|
||||
Reference in New Issue
Block a user