Skip to content

Commit

Permalink
fix: moved variables from outside the build method to inside the buil…
Browse files Browse the repository at this point in the history
…d method
  • Loading branch information
DE7924 committed Oct 4, 2024
1 parent 063946a commit bd418a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/src/components/comms_button/comms_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,8 @@ class ZetaCommsButton extends StatefulWidget {
}

class _ZetaCommsButtonState extends State<ZetaCommsButton> {
bool isToggled = false;
late ZetaCommsButtonType type;
late Color iconColor = _iconColor(context, type);
late Color backgroundColor = _backgroundColor(context, type);
late Color borderColor = _borderColor(context, type);
bool isToggled = false;

@override
void initState() {
Expand All @@ -279,6 +276,9 @@ class _ZetaCommsButtonState extends State<ZetaCommsButton> {

@override
Widget build(BuildContext context) {
Color iconColor = _iconColor(context, type);
Color backgroundColor = _backgroundColor(context, type);
Color borderColor = _borderColor(context, type);
final iconSize = _iconSize(context);
final labelSize = _labelSize(context);

Expand Down Expand Up @@ -423,9 +423,9 @@ class _ZetaCommsButtonState extends State<ZetaCommsButton> {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty<bool>('isToggled', isToggled))
..add(ColorProperty('iconColor', iconColor))
..add(ColorProperty('backgroundColor', backgroundColor))
..add(ColorProperty('borderColor', borderColor))
// ..add(ColorProperty('iconColor', iconColor))
// ..add(ColorProperty('backgroundColor', backgroundColor))
// ..add(ColorProperty('borderColor', borderColor))
..add(EnumProperty<ZetaCommsButtonType>('type', type));
}
}

0 comments on commit bd418a5

Please sign in to comment.