mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
chore: Improved performance for some widgets (#525)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
10bd34bb20
commit
07972ea5ee
16 changed files with 589 additions and 545 deletions
|
|
@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue