mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: safearea
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1528,34 +1528,37 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
),
|
||||
|
||||
// 锁
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible:
|
||||
plPlayerController.videoType.value != 'live' && isFullScreen,
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FractionalTranslation(
|
||||
translation: const Offset(1, -0.4),
|
||||
child: Visibility(
|
||||
visible: plPlayerController.showControls.value &&
|
||||
(isFullScreen || plPlayerController.controlsLock.value),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x45000000),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: ComBtn(
|
||||
icon: Icon(
|
||||
plPlayerController.controlsLock.value
|
||||
? FontAwesomeIcons.lock
|
||||
: FontAwesomeIcons.lockOpen,
|
||||
semanticLabel:
|
||||
plPlayerController.controlsLock.value ? '解锁' : '锁定',
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
SafeArea(
|
||||
child: Obx(
|
||||
() => Visibility(
|
||||
visible:
|
||||
plPlayerController.videoType.value != 'live' && isFullScreen,
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FractionalTranslation(
|
||||
translation: const Offset(1, -0.4),
|
||||
child: Visibility(
|
||||
visible: plPlayerController.showControls.value &&
|
||||
(isFullScreen || plPlayerController.controlsLock.value),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x45000000),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: ComBtn(
|
||||
icon: Icon(
|
||||
plPlayerController.controlsLock.value
|
||||
? FontAwesomeIcons.lock
|
||||
: FontAwesomeIcons.lockOpen,
|
||||
semanticLabel: plPlayerController.controlsLock.value
|
||||
? '解锁'
|
||||
: '锁定',
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
onTap: () => plPlayerController.onLockControl(
|
||||
!plPlayerController.controlsLock.value),
|
||||
),
|
||||
onTap: () => plPlayerController.onLockControl(
|
||||
!plPlayerController.controlsLock.value),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1565,80 +1568,83 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
),
|
||||
|
||||
// 截图
|
||||
Obx(
|
||||
() => Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: FractionalTranslation(
|
||||
translation: const Offset(-1, -0.4),
|
||||
child: Visibility(
|
||||
visible: plPlayerController.showControls.value && isFullScreen,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x45000000),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: ComBtn(
|
||||
icon: const Icon(
|
||||
Icons.photo_camera,
|
||||
semanticLabel: '截图',
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
SafeArea(
|
||||
child: Obx(
|
||||
() => Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: FractionalTranslation(
|
||||
translation: const Offset(-1, -0.4),
|
||||
child: Visibility(
|
||||
visible:
|
||||
plPlayerController.showControls.value && isFullScreen,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x45000000),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
onTap: () {
|
||||
SmartDialog.showToast('截图中');
|
||||
plPlayerController.videoPlayerController
|
||||
?.screenshot(format: 'image/png')
|
||||
.then((value) {
|
||||
if (value != null && context.mounted) {
|
||||
SmartDialog.showToast('点击弹窗保存截图');
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
// title: const Text('点击保存'),
|
||||
titlePadding: EdgeInsets.zero,
|
||||
contentPadding: const EdgeInsets.all(8),
|
||||
insetPadding:
|
||||
EdgeInsets.only(left: context.width / 2),
|
||||
//移除圆角
|
||||
shape: const RoundedRectangleBorder(),
|
||||
content: GestureDetector(
|
||||
onTap: () async {
|
||||
String name = DateTime.now().toString();
|
||||
final SaveResult result =
|
||||
await SaverGallery.saveImage(
|
||||
value,
|
||||
fileName: name,
|
||||
androidRelativePath:
|
||||
"Pictures/Screenshots",
|
||||
skipIfExists: false,
|
||||
);
|
||||
child: ComBtn(
|
||||
icon: const Icon(
|
||||
Icons.photo_camera,
|
||||
semanticLabel: '截图',
|
||||
size: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
onTap: () {
|
||||
SmartDialog.showToast('截图中');
|
||||
plPlayerController.videoPlayerController
|
||||
?.screenshot(format: 'image/png')
|
||||
.then((value) {
|
||||
if (value != null && context.mounted) {
|
||||
SmartDialog.showToast('点击弹窗保存截图');
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
// title: const Text('点击保存'),
|
||||
titlePadding: EdgeInsets.zero,
|
||||
contentPadding: const EdgeInsets.all(8),
|
||||
insetPadding:
|
||||
EdgeInsets.only(left: context.width / 2),
|
||||
//移除圆角
|
||||
shape: const RoundedRectangleBorder(),
|
||||
content: GestureDetector(
|
||||
onTap: () async {
|
||||
String name = DateTime.now().toString();
|
||||
final SaveResult result =
|
||||
await SaverGallery.saveImage(
|
||||
value,
|
||||
fileName: name,
|
||||
androidRelativePath:
|
||||
"Pictures/Screenshots",
|
||||
skipIfExists: false,
|
||||
);
|
||||
|
||||
if (result.isSuccess) {
|
||||
Get.back();
|
||||
SmartDialog.showToast(
|
||||
'$name.png已保存到相册/截图');
|
||||
} else {
|
||||
await SmartDialog.showToast(
|
||||
'保存失败,${result.errorMessage}');
|
||||
}
|
||||
},
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: context.width / 3,
|
||||
maxHeight: context.height / 3,
|
||||
if (result.isSuccess) {
|
||||
Get.back();
|
||||
SmartDialog.showToast(
|
||||
'$name.png已保存到相册/截图');
|
||||
} else {
|
||||
await SmartDialog.showToast(
|
||||
'保存失败,${result.errorMessage}');
|
||||
}
|
||||
},
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: context.width / 3,
|
||||
maxHeight: context.height / 3,
|
||||
),
|
||||
child: Image.memory(value),
|
||||
),
|
||||
child: Image.memory(value),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast('截图失败');
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast('截图失败');
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user