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

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

View File

@@ -137,8 +137,8 @@ class DynamicPanel extends StatelessWidget {
),
if (item!.modules!.moduleDynamic!.desc != null ||
item!.modules!.moduleDynamic!.major != null)
content(context, item, source, callback),
forWard(item, context, source, callback),
content(isSave, context, item, source, callback),
forWard(isSave, item, context, source, callback),
const SizedBox(height: 2),
if (source == null) ActionPanel(item: item),
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) {
// 图文
case 'DYNAMIC_TYPE_DRAW':
@@ -124,10 +125,16 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
Text.rich(
richNodes,
// 被转发状态(floor=2) 隐藏
maxLines: source == 'detail' && floor != 2 ? null : 4,
overflow: source == 'detail' && floor != 2
maxLines: isSave == true
? null
: TextOverflow.ellipsis,
: source == 'detail' && floor != 2
? null
: 4,
overflow: isSave == true
? null
: source == 'detail' && floor != 2
? null
: TextOverflow.ellipsis,
),
if (hasPics) ...[
Text.rich(
@@ -254,8 +261,8 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
color: Theme.of(context).dividerColor.withOpacity(0.08),
child:
forWard(item.orig, context, source, callback, floor: floor + 1),
child: forWard(isSave, item.orig, context, source, callback,
floor: floor + 1),
),
);
// 直播
@@ -300,10 +307,16 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
Text.rich(
richNodes,
// 被转发状态(floor=2) 隐藏
maxLines: source == 'detail' && floor != 2 ? null : 4,
overflow: source == 'detail' && floor != 2
maxLines: isSave == true
? null
: TextOverflow.ellipsis,
: source == 'detail' && floor != 2
? null
: 4,
overflow: isSave == true
? null
: source == 'detail' && floor != 2
? null
: TextOverflow.ellipsis,
),
],
)