opt: safearea

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-24 11:35:19 +08:00
parent 039e1696dd
commit 8c7001c801
8 changed files with 211 additions and 169 deletions

View File

@@ -170,14 +170,18 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
titleSpacing: automaticallyImplyLeading ? null : 12,
automaticallyImplyLeading: automaticallyImplyLeading,
),
body: VideoReplyReplyPanel(
id: id,
oid: oid,
rpid: rpid,
source: 'dynamic',
replyType: ReplyType.values[replyType],
firstFloor: replyItem,
onDispose: onDispose,
body: SafeArea(
top: false,
bottom: false,
child: VideoReplyReplyPanel(
id: id,
oid: oid,
rpid: rpid,
source: 'dynamic',
replyType: ReplyType.values[replyType],
firstFloor: replyItem,
onDispose: onDispose,
),
),
);
if (this.context.orientation == Orientation.portrait) {

View File

@@ -92,7 +92,11 @@ class _HotPageState extends CommonPageState<HotPage, HotController>
Get.to(
Scaffold(
appBar: AppBar(title: const Text('排行榜')),
body: RankPage(),
body: SafeArea(
top: false,
bottom: false,
child: RankPage(),
),
),
);
}

View File

@@ -168,14 +168,18 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
titleSpacing: automaticallyImplyLeading ? null : 12,
automaticallyImplyLeading: automaticallyImplyLeading,
),
body: VideoReplyReplyPanel(
id: id,
oid: oid,
rpid: rpid,
source: 'dynamic',
replyType: ReplyType.values[type],
firstFloor: replyItem,
onDispose: onDispose,
body: SafeArea(
top: false,
bottom: false,
child: VideoReplyReplyPanel(
id: id,
oid: oid,
rpid: rpid,
source: 'dynamic',
replyType: ReplyType.values[type],
firstFloor: replyItem,
onDispose: onDispose,
),
),
);
if (this.context.orientation == Orientation.portrait) {

View File

@@ -277,12 +277,14 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
() => Text('${controller.liveCount.value}人正在直播'),
),
),
body: CustomScrollView(
slivers: [
Obx(
() => _buildFollowListBody(controller.followListState.value),
),
],
body: SafeArea(
top: false,
bottom: false,
child: CustomScrollView(
slivers: [
Obx(() => _buildFollowListBody(controller.followListState.value)),
],
),
),
);

View File

@@ -70,15 +70,19 @@ class _SeasonSeriesPageState extends State<SeasonSeriesPage>
appBar: AppBar(
title: Text(item['meta']['name']),
),
body: MemberVideo(
type: isSeason
? ContributeType.season
: ContributeType.series,
heroTag: widget.heroTag,
mid: widget.mid,
seasonId: isSeason ? id : null,
seriesId: isSeason ? null : id,
title: item['meta']['name'],
body: SafeArea(
top: false,
bottom: false,
child: MemberVideo(
type: isSeason
? ContributeType.season
: ContributeType.series,
heroTag: widget.heroTag,
mid: widget.mid,
seasonId: isSeason ? id : null,
seriesId: isSeason ? null : id,
title: item['meta']['name'],
),
),
),
);

View File

@@ -54,11 +54,13 @@ class _SysMsgPageState extends State<SysMsgPage> {
Widget _buildBody(LoadingState<List<SystemNotifyList>?> loadingState) {
return switch (loadingState) {
Loading() => SliverList.builder(
itemCount: 12,
itemBuilder: (context, index) {
return const MsgFeedSysMsgSkeleton();
},
Loading() => SliverSafeArea(
sliver: SliverList.builder(
itemCount: 12,
itemBuilder: (context, index) {
return const MsgFeedSysMsgSkeleton();
},
),
),
Success() => loadingState.response?.isNotEmpty == true
? SliverList.separated(

View File

@@ -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('截图失败');
}
});
},
),
),
),
),

View File

@@ -133,16 +133,20 @@ class PiliScheme {
),
],
),
body: VideoReplyReplyPanel(
oid: int.parse(oid),
rpid: rpid,
source: 'routePush',
replyType: ReplyType.video,
firstFloor: null,
id: queryParameters['comment_secondary_id'] != null
? int.tryParse(
queryParameters['comment_secondary_id']!)
: null,
body: SafeArea(
top: false,
bottom: false,
child: VideoReplyReplyPanel(
oid: int.parse(oid),
rpid: rpid,
source: 'routePush',
replyType: ReplyType.video,
firstFloor: null,
id: queryParameters['comment_secondary_id'] != null
? int.tryParse(
queryParameters['comment_secondary_id']!)
: null,
),
),
),
);
@@ -285,13 +289,17 @@ class PiliScheme {
),
],
),
body: VideoReplyReplyPanel(
oid: oid,
rpid: rootId,
id: rpId,
source: 'routePush',
replyType: ReplyType.values[type],
firstFloor: null,
body: SafeArea(
top: false,
bottom: false,
child: VideoReplyReplyPanel(
oid: oid,
rpid: rootId,
id: rpId,
source: 'routePush',
replyType: ReplyType.values[type],
firstFloor: null,
),
),
),
);
@@ -331,12 +339,16 @@ class PiliScheme {
),
],
),
body: VideoReplyReplyPanel(
oid: oid,
rpid: rpId,
source: 'routePush',
replyType: ReplyType.values[type],
firstFloor: null,
body: SafeArea(
top: false,
bottom: false,
child: VideoReplyReplyPanel(
oid: oid,
rpid: rpId,
source: 'routePush',
replyType: ReplyType.values[type],
firstFloor: null,
),
),
),
);
@@ -393,18 +405,22 @@ class PiliScheme {
),
],
),
body: VideoReplyReplyPanel(
oid: oid ?? int.parse(dynId),
rpid: rpid,
source: 'routePush',
replyType: businessId != null
? ReplyType.values[businessId]
: ReplyType.dynamics,
firstFloor: null,
id: queryParameters['comment_secondary_id'] != null
? int.tryParse(
queryParameters['comment_secondary_id']!)
: null,
body: SafeArea(
top: false,
bottom: false,
child: VideoReplyReplyPanel(
oid: oid ?? int.parse(dynId),
rpid: rpid,
source: 'routePush',
replyType: businessId != null
? ReplyType.values[businessId]
: ReplyType.dynamics,
firstFloor: null,
id: queryParameters['comment_secondary_id'] != null
? int.tryParse(
queryParameters['comment_secondary_id']!)
: null,
),
),
),
);