opt save panel

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-14 20:02:09 +08:00
parent d73588f1fd
commit 470e519a2b

View File

@@ -336,55 +336,53 @@ class _SavePanelState extends State<SavePanel> {
final padding = MediaQuery.viewPaddingOf(context);
final maxWidth = context.mediaQueryShortestSide;
late final coverSize = MediaQuery.textScalerOf(context).scale(65);
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
return Stack(
clipBehavior: .none,
alignment: .center,
children: [
SingleChildScrollView(
padding: EdgeInsets.only(
hitTestBehavior: .deferToChild,
padding: .only(
top: 12 + padding.top,
bottom: 80 + padding.bottom,
),
child: Listener(
child: Container(
width: maxWidth,
padding: const EdgeInsets.symmetric(horizontal: 12),
padding: const .symmetric(horizontal: 12),
child: RepaintBoundary(
key: boundaryKey,
child: Container(
clipBehavior: Clip.hardEdge,
clipBehavior: .hardEdge,
decoration: BoxDecoration(
color: theme.colorScheme.surface,
borderRadius: const .all(.circular(12)),
),
child: AnimatedSize(
curve: Curves.easeInOut,
alignment: Alignment.topCenter,
alignment: .topCenter,
duration: const Duration(milliseconds: 255),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: .min,
crossAxisAlignment: .start,
children: [
if (_item case final ReplyInfo reply)
IgnorePointer(
switch (_item) {
ReplyInfo reply => IgnorePointer(
child: ReplyItemGrpc(
replyItem: reply,
replyLevel: 0,
needDivider: false,
upMid: widget.upMid,
),
)
else if (_item case final DynamicItemModel dyn)
IgnorePointer(
),
DynamicItemModel dyn => IgnorePointer(
child: DynamicPanel(
item: dyn,
isDetail: true,
isSave: true,
),
),
_ => throw UnsupportedError(_item.toString()),
},
if (cover?.isNotEmpty == true &&
title?.isNotEmpty == true)
Container(
@@ -397,29 +395,29 @@ class _SavePanelState extends State<SavePanel> {
borderRadius: const .all(.circular(8)),
),
child: Row(
spacing: 10,
children: [
NetworkImgLayer(
src: cover!,
height: coverSize,
width: coverType == .def16_9
? coverSize *
StyleString.aspectRatio16x9
? coverSize * StyleString.aspectRatio16x9
: coverSize,
quality: 100,
borderRadius: const .all(.circular(6)),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: .start,
children: [
Text(
Expanded(
child: Text(
'$title\n',
maxLines: 2,
overflow: .ellipsis,
),
if (pubdate != null) ...[
const Spacer(),
),
if (pubdate != null)
Text(
DateFormatUtils.format(
pubdate,
@@ -430,7 +428,6 @@ class _SavePanelState extends State<SavePanel> {
),
),
],
],
),
),
],
@@ -438,18 +435,17 @@ class _SavePanelState extends State<SavePanel> {
),
showBottom
? Stack(
clipBehavior: Clip.none,
clipBehavior: .none,
children: [
if (uri.isNotEmpty)
Align(
alignment: Alignment.centerRight,
alignment: .centerRight,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisSize: .min,
crossAxisAlignment: .end,
spacing: 4,
children: [
if (uname?.isNotEmpty == true)
@@ -465,7 +461,7 @@ class _SavePanelState extends State<SavePanel> {
),
Text(
'识别二维码,$viewType$itemType',
textAlign: TextAlign.end,
textAlign: .end,
style: TextStyle(
color: theme
.colorScheme
@@ -475,12 +471,11 @@ class _SavePanelState extends State<SavePanel> {
Text(
DateFormatUtils.longFormatDs
.format(.now()),
textAlign: TextAlign.end,
textAlign: .end,
style: TextStyle(
fontSize: 13,
color: theme
.colorScheme
.outline,
color:
theme.colorScheme.outline,
),
),
],
@@ -510,13 +505,12 @@ class _SavePanelState extends State<SavePanel> {
),
),
Align(
alignment: Alignment.centerLeft,
alignment: .centerLeft,
child: Image.asset(
'assets/images/logo/logo_2.png',
width: 100,
cacheWidth: 100.cacheSize(context),
color:
theme.colorScheme.onSurfaceVariant,
color: theme.colorScheme.onSurfaceVariant,
),
),
],
@@ -529,7 +523,6 @@ class _SavePanelState extends State<SavePanel> {
),
),
),
),
Positioned(
left: 0,
right: 0,
@@ -537,8 +530,8 @@ class _SavePanelState extends State<SavePanel> {
child: DecoratedBox(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
begin: .topCenter,
end: .bottomCenter,
colors: [
Colors.transparent,
Colors.black54,
@@ -553,7 +546,7 @@ class _SavePanelState extends State<SavePanel> {
),
child: Row(
spacing: 40,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: .center,
children: [
iconButton(
size: 42,
@@ -595,7 +588,6 @@ class _SavePanelState extends State<SavePanel> {
),
),
],
),
);
}
}