perf: optimize post tags scrolling performance and eliminate frame drops (v3.1.2)
Build and Release / Build Windows x64 (push) Has been cancelled

This commit is contained in:
2026-09-04 21:11:03 +03:00
parent d58b512020
commit 5a568a3df9
7 changed files with 121 additions and 136 deletions
@@ -314,49 +314,43 @@ class PostDetailsScreen extends ConsumerWidget {
),
],
const SizedBox(height: 16),
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).brightness == Brightness.dark
? Theme.of(context).colorScheme.surfaceContainerHigh.withValues(alpha: 0.55)
: Colors.white.withValues(alpha: 0.85),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withValues(alpha: 0.12)
: Colors.white.withValues(alpha: 0.8),
width: 1.1,
),
),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Container(
decoration: BoxDecoration(
color: Theme.of(context).brightness == Brightness.dark
? Theme.of(context).colorScheme.surfaceContainerHigh.withValues(alpha: 0.70)
: Theme.of(context).colorScheme.surfaceContainerLow,
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withValues(alpha: 0.12)
: Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.40),
width: 1.1,
),
),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Row(
children: [
Icon(
Icons.tag_rounded,
size: 20,
color: Theme.of(context).colorScheme.primary,
),
const SizedBox(width: 8),
Text(
'${strings.tags} (${post.cleanTags.length})',
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(fontWeight: FontWeight.bold),
),
],
Icon(
Icons.tag_rounded,
size: 20,
color: Theme.of(context).colorScheme.primary,
),
const SizedBox(width: 8),
Text(
'${strings.tags} (${post.cleanTags.length})',
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(fontWeight: FontWeight.bold),
),
const SizedBox(height: 12),
PostTagsPanel(post: post),
],
),
),
const SizedBox(height: 12),
PostTagsPanel(post: post),
],
),
),
const SizedBox(height: 16),
@@ -498,49 +492,44 @@ class PostDetailsScreen extends ConsumerWidget {
),
],
const SizedBox(height: 12),
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).brightness == Brightness.dark
? Theme.of(context).colorScheme.surfaceContainerHigh.withValues(alpha: 0.55)
: Colors.white.withValues(alpha: 0.85),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withValues(alpha: 0.12)
: Colors.white.withValues(alpha: 0.8),
width: 1.1,
),
),
child: ExpansionTile(
tilePadding:
const EdgeInsets.symmetric(horizontal: 14, vertical: 2),
childrenPadding: const EdgeInsets.fromLTRB(14, 0, 14, 14),
initiallyExpanded: false,
shape: const Border(),
collapsedShape: const Border(),
leading: Icon(
Icons.tag_rounded,
color: Theme.of(context).colorScheme.primary,
),
title: Text(
'${strings.tags} (${post.cleanTags.length})',
style: Theme.of(context).textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.bold,
),
),
children: [
Align(
alignment: Alignment.centerLeft,
child: PostTagsPanel(post: post),
),
],
),
Container(
decoration: BoxDecoration(
color: Theme.of(context).brightness == Brightness.dark
? Theme.of(context).colorScheme.surfaceContainerHigh.withValues(alpha: 0.70)
: Theme.of(context).colorScheme.surfaceContainerLow,
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Theme.of(context).brightness == Brightness.dark
? Colors.white.withValues(alpha: 0.12)
: Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.40),
width: 1.1,
),
),
clipBehavior: Clip.antiAlias,
child: ExpansionTile(
tilePadding:
const EdgeInsets.symmetric(horizontal: 14, vertical: 2),
childrenPadding: const EdgeInsets.fromLTRB(14, 0, 14, 14),
initiallyExpanded: false,
shape: const Border(),
collapsedShape: const Border(),
leading: Icon(
Icons.tag_rounded,
color: Theme.of(context).colorScheme.primary,
),
title: Text(
'${strings.tags} (${post.cleanTags.length})',
style: Theme.of(context).textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.bold,
),
),
children: [
Align(
alignment: Alignment.centerLeft,
child: PostTagsPanel(post: post),
),
],
),
),
const SizedBox(height: 12),
_CommentsSection(post: post),
@@ -298,7 +298,7 @@ class _TagGroupBlock extends StatelessWidget {
required this.onLongPress,
});
static const _collapsedLimit = 36;
static const _collapsedLimit = 28;
final String label;
final String group;