Skip to content

Commit

Permalink
Commit from GitHub Actions (Forui Presubmit)
Browse files Browse the repository at this point in the history
  • Loading branch information
sommye-ctr committed Aug 15, 2024
1 parent be7ac55 commit 399ba33
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions forui/lib/src/widgets/button/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class FButton extends StatelessWidget {
@useResult
static _Data _of(BuildContext context) {
final theme = context.dependOnInheritedWidgetOfExactType<_InheritedData>();
return theme?.data ??
(style: context.theme.buttonStyles.primary, enabled: true);
return theme?.data ?? (style: context.theme.buttonStyles.primary, enabled: true);
}

/// The style. Defaults to [FButtonStyle.primary].
Expand Down Expand Up @@ -142,8 +141,7 @@ class FButton extends StatelessWidget {
onPress: onPress,
onLongPress: onLongPress,
child: DecoratedBox(
decoration:
enabled ? style.enabledBoxDecoration : style.disabledBoxDecoration,
decoration: enabled ? style.enabledBoxDecoration : style.disabledBoxDecoration,
child: _InheritedData(
data: (style: style, enabled: enabled),
child: child,
Expand All @@ -159,8 +157,7 @@ class FButton extends StatelessWidget {
..add(DiagnosticsProperty('style', style))
..add(DiagnosticsProperty('onPress', onPress))
..add(DiagnosticsProperty('onLongPress', onLongPress))
..add(FlagProperty('autofocus',
value: autofocus, defaultValue: false, ifTrue: 'autofocus'))
..add(FlagProperty('autofocus', value: autofocus, defaultValue: false, ifTrue: 'autofocus'))
..add(DiagnosticsProperty('focusNode', focusNode))
..add(DiagnosticsProperty('onFocusChange', onFocusChange))
..add(DiagnosticsProperty('builder', child));
Expand Down Expand Up @@ -253,8 +250,7 @@ class FButtonCustomStyle extends FButtonStyle with Diagnosticable {
}) =>
FButtonCustomStyle(
enabledBoxDecoration: enabledBoxDecoration ?? this.enabledBoxDecoration,
disabledBoxDecoration:
disabledBoxDecoration ?? this.disabledBoxDecoration,
disabledBoxDecoration: disabledBoxDecoration ?? this.disabledBoxDecoration,
content: content ?? this.content,
icon: icon ?? this.icon,
iconContent: iconContent ?? this.iconContent,
Expand All @@ -269,8 +265,7 @@ class FButtonCustomStyle extends FButtonStyle with Diagnosticable {
..add(DiagnosticsProperty('content', content))
..add(DiagnosticsProperty('icon', icon))
..add(
DiagnosticsProperty<FButtonIconContentStyle>(
'iconContent', iconContent),
DiagnosticsProperty<FButtonIconContentStyle>('iconContent', iconContent),
);
}

Expand Down Expand Up @@ -341,8 +336,7 @@ class FButtonIconStyle extends FButtonStyle with Diagnosticable {
}) =>
FButtonIconStyle(
enabledBoxDecoration: enabledBoxDecoration ?? this.enabledBoxDecoration,
disabledBoxDecoration:
disabledBoxDecoration ?? this.disabledBoxDecoration,
disabledBoxDecoration: disabledBoxDecoration ?? this.disabledBoxDecoration,
content: content ?? this.content,
icon: icon ?? this.icon,
);
Expand All @@ -368,11 +362,7 @@ class FButtonIconStyle extends FButtonStyle with Diagnosticable {
icon == other.icon;

@override
int get hashCode =>
enabledBoxDecoration.hashCode ^
disabledBoxDecoration.hashCode ^
content.hashCode ^
icon.hashCode;
int get hashCode => enabledBoxDecoration.hashCode ^ disabledBoxDecoration.hashCode ^ content.hashCode ^ icon.hashCode;
}

typedef _Data = ({FButtonCustomStyle style, bool enabled});
Expand Down

0 comments on commit 399ba33

Please sign in to comment.