Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-21 22:14:38 +08:00
parent dae8df840a
commit 43843ca721
10 changed files with 204 additions and 217 deletions

View File

@@ -25,44 +25,47 @@ class AiConclusionPanel extends CommonSlidePage {
Key? key,
bool tap = true,
}) {
return CustomScrollView(
key: key,
shrinkWrap: !tap,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
if (res.summary?.isNotEmpty == true) ...[
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14),
child: SelectableText(
res.summary!,
style: const TextStyle(fontSize: 15, height: 1.5),
scrollPhysics: const NeverScrollableScrollPhysics(),
),
),
),
if (res.outline?.isNotEmpty == true)
final outline = res.outline;
final hasOutline = outline != null && outline.isNotEmpty;
return SelectionArea(
child: CustomScrollView(
key: key,
shrinkWrap: !tap,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
if (res.summary?.isNotEmpty == true) ...[
SliverToBoxAdapter(
child: Divider(
height: 20,
color: theme.dividerColor.withValues(alpha: 0.1),
thickness: 6,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14),
child: Text(
res.summary!,
style: const TextStyle(fontSize: 15, height: 1.5),
),
),
),
],
if (res.outline?.isNotEmpty == true)
SliverPadding(
padding: EdgeInsets.only(
left: 14,
right: 14,
bottom: !tap ? 0 : MediaQuery.viewPaddingOf(context).bottom + 100,
),
sliver: SliverList.builder(
itemCount: res.outline!.length,
itemBuilder: (context, index) {
final item = res.outline![index];
return SelectionArea(
child: Column(
if (hasOutline)
SliverToBoxAdapter(
child: Divider(
height: 20,
color: theme.dividerColor.withValues(alpha: 0.1),
thickness: 6,
),
),
],
if (hasOutline)
SliverPadding(
padding: EdgeInsets.only(
left: 14,
right: 14,
bottom: !tap
? 0
: MediaQuery.viewPaddingOf(context).bottom + 100,
),
sliver: SliverList.builder(
itemCount: outline.length,
itemBuilder: (context, index) {
final item = outline[index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (index != 0) const SizedBox(height: 10),
@@ -120,12 +123,12 @@ class AiConclusionPanel extends CommonSlidePage {
),
),
],
),
);
},
);
},
),
),
),
],
],
),
);
}
}