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

@ -28,18 +28,19 @@ class _ClickableTextState extends ConsumerState<ClickableText> {
bool hovering = false;
Widget _textWidget(bool showDecoration) {
return Opacity(
opacity: widget.opacity,
child: Text(
widget.text,
maxLines: widget.maxLines,
overflow: widget.overflow,
style: widget.style?.copyWith(
color: showDecoration ? Theme.of(context).colorScheme.primary : null,
decoration: showDecoration ? TextDecoration.underline : TextDecoration.none,
decorationColor: showDecoration ? Theme.of(context).colorScheme.primary : null,
decorationThickness: 3,
),
final color =
(showDecoration ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onSurface).withValues(
alpha: widget.opacity,
);
return Text(
widget.text,
maxLines: widget.maxLines,
overflow: widget.overflow,
style: widget.style?.copyWith(
color: color,
decoration: showDecoration ? TextDecoration.underline : TextDecoration.none,
decorationColor: color,
decorationThickness: 3,
),
);
}