mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 横屏全屏时也显示返回主页按钮
This commit is contained in:
@@ -1168,7 +1168,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
final _ = widget.controller!;
|
final _ = widget.controller!;
|
||||||
// final bool isLandscape =
|
// final bool isLandscape =
|
||||||
// MediaQuery.of(context).orientation == Orientation.landscape;
|
// MediaQuery.of(context).orientation == Orientation.landscape;
|
||||||
|
bool equivalentFullScreen = !isFullScreen &&
|
||||||
|
!horizontalScreen &&
|
||||||
|
MediaQuery.of(context).orientation == Orientation.landscape;
|
||||||
return LayoutBuilder(builder: (context, boxConstraints) {
|
return LayoutBuilder(builder: (context, boxConstraints) {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
@@ -1203,12 +1205,29 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
|
if (!isFullScreen ||
|
||||||
|
MediaQuery.of(context).orientation != Orientation.portrait)
|
||||||
|
SizedBox(
|
||||||
|
width: 42,
|
||||||
|
height: 34,
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: '返回主页',
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesomeIcons.house,
|
||||||
|
size: 15,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
// 销毁播放器实例
|
||||||
|
// await widget.controller!.dispose(type: 'all');
|
||||||
|
if (mounted) {
|
||||||
|
Navigator.popUntil(
|
||||||
|
context, (Route<dynamic> route) => route.isFirst);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
if ((videoIntroController.videoDetail.value.title != null) &&
|
if ((videoIntroController.videoDetail.value.title != null) &&
|
||||||
(isFullScreen ||
|
(isFullScreen || equivalentFullScreen))
|
||||||
(!isFullScreen &&
|
|
||||||
MediaQuery.of(context).orientation ==
|
|
||||||
Orientation.landscape &&
|
|
||||||
!horizontalScreen))) ...[
|
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -1248,35 +1267,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
] else ...[
|
|
||||||
SizedBox(
|
|
||||||
width: 42,
|
|
||||||
height: 34,
|
|
||||||
child: IconButton(
|
|
||||||
tooltip: '返回主页',
|
|
||||||
icon: const Icon(
|
|
||||||
FontAwesomeIcons.house,
|
|
||||||
size: 15,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
// 销毁播放器实例
|
|
||||||
// await widget.controller!.dispose(type: 'all');
|
|
||||||
if (mounted) {
|
|
||||||
Navigator.popUntil(
|
|
||||||
context, (Route<dynamic> route) => route.isFirst);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if ((isFullScreen &&
|
if (MediaQuery.of(context).orientation == Orientation.landscape &&
|
||||||
MediaQuery.of(context).orientation ==
|
(isFullScreen || !horizontalScreen)) ...[
|
||||||
Orientation.landscape) ||
|
|
||||||
(!isFullScreen &&
|
|
||||||
MediaQuery.of(context).orientation ==
|
|
||||||
Orientation.landscape &&
|
|
||||||
!horizontalScreen)) ...[
|
|
||||||
// const Spacer(),
|
// const Spacer(),
|
||||||
// show current datetime
|
// show current datetime
|
||||||
Obx(
|
Obx(
|
||||||
|
|||||||
Reference in New Issue
Block a user