opt: save panel

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-07 18:20:45 +08:00
parent af289c533f
commit 4de180c23a
6 changed files with 132 additions and 79 deletions

View File

@@ -131,7 +131,7 @@ class _SavePanelState extends State<SavePanel> {
late final rootId = hasRoot ? _item.root : _item.id; late final rootId = hasRoot ? _item.root : _item.id;
late final anchor = hasRoot ? 'anchor=${_item.id}&' : ''; late final anchor = hasRoot ? 'anchor=${_item.id}&' : '';
late final enterUri = late final enterUri =
'bilibili://following/detail/${Get.parameters['id']}'; 'bilibili://following/detail/${Get.parameters['id'] ?? Get.arguments?['id']}';
uri = uri =
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri'; 'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri';
} catch (_) {} } catch (_) {}
@@ -360,78 +360,94 @@ class _SavePanelState extends State<SavePanel> {
], ],
), ),
), ),
Row( Stack(
clipBehavior: Clip.none,
children: [ children: [
Image.asset( if (uri.isNotEmpty)
'assets/images/logo/logo_2.png', Align(
width: 100, alignment: Alignment.centerRight,
color: Theme.of(context) child: Row(
.colorScheme
.onSurfaceVariant,
),
if (uri.isNotEmpty) ...[
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
if (uname?.isNotEmpty == true) ...[ Expanded(
Text( child: Column(
'@$uname', mainAxisSize: MainAxisSize.min,
maxLines: 1, crossAxisAlignment:
overflow: TextOverflow.ellipsis, CrossAxisAlignment.end,
style: TextStyle( children: [
color: Theme.of(context) if (uname?.isNotEmpty == true) ...[
.colorScheme Text(
.primary, '@$uname',
), maxLines: 1,
), overflow: TextOverflow.ellipsis,
const SizedBox(height: 4), style: TextStyle(
], color: Theme.of(context)
Text( .colorScheme
'识别二维码,$viewType$itemType', .primary,
style: TextStyle( ),
color: Theme.of(context) ),
.colorScheme const SizedBox(height: 4),
.onSurfaceVariant, ],
Text(
'识别二维码,$viewType$itemType',
textAlign: TextAlign.end,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
),
),
const SizedBox(height: 4),
Text(
DateTime.now()
.toString()
.split('.')
.first,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 13,
color: Theme.of(context)
.colorScheme
.outline,
),
),
],
), ),
), ),
const SizedBox(height: 4), Container(
Text( width: 100,
DateTime.now() height: 100,
.toString() padding: const EdgeInsets.all(12),
.split('.') child: Container(
.first, color: Get.isDarkMode
style: TextStyle( ? Colors.white
fontSize: 13, : Theme.of(context)
color: Theme.of(context) .colorScheme
.colorScheme .surface,
.outline, padding: const EdgeInsets.all(3),
child: PrettyQrView.data(
data: uri,
decoration:
const PrettyQrDecoration(
shape: PrettyQrRoundedSymbol(
borderRadius: BorderRadius.zero,
),
),
),
), ),
), ),
], ],
), ),
), ),
Container( Align(
alignment: Alignment.centerLeft,
child: Image.asset(
'assets/images/logo/logo_2.png',
width: 100, width: 100,
height: 100, color: Theme.of(context)
padding: const EdgeInsets.all(12), .colorScheme
child: Container( .onSurfaceVariant,
color: Get.isDarkMode
? Colors.white
: Theme.of(context).colorScheme.surface,
padding: const EdgeInsets.all(3),
child: PrettyQrView.data(
data: uri,
decoration: const PrettyQrDecoration(
shape: PrettyQrRoundedSymbol(
borderRadius: BorderRadius.zero,
),
),
),
),
), ),
], ),
], ],
), ),
], ],

View File

@@ -190,7 +190,13 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
), ),
); );
if (this.context.orientation == Orientation.portrait) { if (this.context.orientation == Orientation.portrait) {
Get.to(replyReplyPage); Get.to(
replyReplyPage,
routeName: 'dynamicDetail-Copy',
arguments: {
'item': _dynamicDetailController.item,
},
);
} else { } else {
ScaffoldState? scaffoldState = Scaffold.maybeOf(context); ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
if (scaffoldState != null) { if (scaffoldState != null) {
@@ -214,7 +220,13 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
), ),
); );
} else { } else {
Get.to(replyReplyPage); Get.to(
replyReplyPage,
routeName: 'dynamicDetail-Copy',
arguments: {
'item': _dynamicDetailController.item,
},
);
} }
} }
}); });

View File

@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'rich_node_panel.dart'; import 'rich_node_panel.dart';
Widget content(context, item, source, callback) { Widget content(isSave, context, item, source, callback) {
InlineSpan picsNodes() { InlineSpan picsNodes() {
return WidgetSpan( return WidgetSpan(
child: LayoutBuilder( child: LayoutBuilder(
@@ -55,7 +55,7 @@ Widget content(context, item, source, callback) {
child: Text.rich( child: Text.rich(
/// fix 默认20px高度 /// fix 默认20px高度
style: TextStyle( style: TextStyle(
fontSize: source == 'detail' ? 16 : 15, fontSize: source == 'detail' && isSave != true ? 16 : 15,
), ),
richNodes, richNodes,
maxLines: source == 'detail' ? null : 6, maxLines: source == 'detail' ? null : 6,

View File

@@ -137,8 +137,8 @@ class DynamicPanel extends StatelessWidget {
), ),
if (item!.modules!.moduleDynamic!.desc != null || if (item!.modules!.moduleDynamic!.desc != null ||
item!.modules!.moduleDynamic!.major != null) item!.modules!.moduleDynamic!.major != null)
content(context, item, source, callback), content(isSave, context, item, source, callback),
forWard(item, context, source, callback), forWard(isSave, item, context, source, callback),
const SizedBox(height: 2), const SizedBox(height: 2),
if (source == null) ActionPanel(item: item), if (source == null) ActionPanel(item: item),
if (source == 'detail' && isSave != true) const SizedBox(height: 12), if (source == 'detail' && isSave != true) const SizedBox(height: 12),

View File

@@ -68,7 +68,8 @@ Widget _blockedItem(BuildContext context, item, source) {
); );
} }
Widget forWard(item, BuildContext context, source, callback, {floor = 1}) { Widget forWard(isSave, item, BuildContext context, source, callback,
{floor = 1}) {
switch (item.type) { switch (item.type) {
// 图文 // 图文
case 'DYNAMIC_TYPE_DRAW': case 'DYNAMIC_TYPE_DRAW':
@@ -124,10 +125,16 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
Text.rich( Text.rich(
richNodes, richNodes,
// 被转发状态(floor=2) 隐藏 // 被转发状态(floor=2) 隐藏
maxLines: source == 'detail' && floor != 2 ? null : 4, maxLines: isSave == true
overflow: source == 'detail' && floor != 2
? null ? null
: TextOverflow.ellipsis, : source == 'detail' && floor != 2
? null
: 4,
overflow: isSave == true
? null
: source == 'detail' && floor != 2
? null
: TextOverflow.ellipsis,
), ),
if (hasPics) ...[ if (hasPics) ...[
Text.rich( Text.rich(
@@ -254,8 +261,8 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
color: Theme.of(context).dividerColor.withOpacity(0.08), color: Theme.of(context).dividerColor.withOpacity(0.08),
child: child: forWard(isSave, item.orig, context, source, callback,
forWard(item.orig, context, source, callback, floor: floor + 1), floor: floor + 1),
), ),
); );
// 直播 // 直播
@@ -300,10 +307,16 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
Text.rich( Text.rich(
richNodes, richNodes,
// 被转发状态(floor=2) 隐藏 // 被转发状态(floor=2) 隐藏
maxLines: source == 'detail' && floor != 2 ? null : 4, maxLines: isSave == true
overflow: source == 'detail' && floor != 2
? null ? null
: TextOverflow.ellipsis, : source == 'detail' && floor != 2
? null
: 4,
overflow: isSave == true
? null
: source == 'detail' && floor != 2
? null
: TextOverflow.ellipsis,
), ),
], ],
) )

View File

@@ -187,7 +187,13 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
), ),
); );
if (this.context.orientation == Orientation.portrait) { if (this.context.orientation == Orientation.portrait) {
Get.to(replyReplyPage); Get.to(
replyReplyPage,
routeName: 'htmlRender-Copy',
arguments: {
'id': _htmlRenderCtr.id,
},
);
} else { } else {
ScaffoldState? scaffoldState = Scaffold.maybeOf(context); ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
if (scaffoldState != null) { if (scaffoldState != null) {
@@ -211,7 +217,13 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
), ),
); );
} else { } else {
Get.to(replyReplyPage); Get.to(
replyReplyPage,
routeName: 'htmlRender-Copy',
arguments: {
'id': _htmlRenderCtr.id,
},
);
} }
} }
}); });