chore: Improved performance for some widgets (#525)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-10-10 15:54:17 +02:00 committed by GitHub
parent 10bd34bb20
commit 07972ea5ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 589 additions and 545 deletions

View file

@ -8,6 +8,7 @@ class PosterPlaceholder extends StatelessWidget {
@override
Widget build(BuildContext context) {
final color = Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.75);
return Stack(
alignment: Alignment.center,
children: [
@ -15,7 +16,10 @@ class PosterPlaceholder extends StatelessWidget {
alignment: Alignment.topRight,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Opacity(opacity: 0.5, child: Icon(item.type.icon)),
child: Icon(
item.type.icon,
color: color.withValues(alpha: 0.5),
),
),
),
Padding(
@ -34,15 +38,14 @@ class PosterPlaceholder extends StatelessWidget {
softWrap: true,
),
if (item.label(context) != null) ...[
Opacity(
opacity: 0.75,
child: Text(
item.label(context)!,
maxLines: 2,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall,
softWrap: true,
),
Text(
item.label(context)!,
maxLines: 2,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: color.withValues(alpha: 0.75),
),
softWrap: true,
),
],
],