Skip to content

Commit

Permalink
fix: constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Oct 7, 2024
1 parent 0ed06d3 commit 6ee266b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/src/widgets/yaru_split_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enum _YaruSplitButtonVariant { elevated, filled, outlined }
class YaruSplitButton extends StatelessWidget {
const YaruSplitButton({
super.key,
required this.items,
this.items,
this.onPressed,
this.child,
this.onOptionsPressed,
Expand All @@ -29,7 +29,7 @@ class YaruSplitButton extends StatelessWidget {

const YaruSplitButton.outlined({
super.key,
required this.items,
this.items,
this.onPressed,
this.child,
this.onOptionsPressed,
Expand Down Expand Up @@ -95,6 +95,8 @@ class YaruSplitButton extends StatelessWidget {
)
: null);

final dropdownIcon = icon ?? const Icon(YaruIcons.pan_down);

return Row(
mainAxisSize: MainAxisSize.min,
children: [
Expand Down Expand Up @@ -125,7 +127,7 @@ class YaruSplitButton extends StatelessWidget {
shape: dropdownShape,
),
onPressed: onDropdownPressed,
child: icon ?? const Icon(YaruIcons.pan_down),
child: dropdownIcon,
),
_YaruSplitButtonVariant.filled => FilledButton(
style: FilledButton.styleFrom(
Expand All @@ -136,7 +138,7 @@ class YaruSplitButton extends StatelessWidget {
shape: dropdownShape,
),
onPressed: onDropdownPressed,
child: icon ?? const Icon(YaruIcons.pan_down),
child: dropdownIcon,
),
_YaruSplitButtonVariant.outlined => OutlinedButton(
style: OutlinedButton.styleFrom(
Expand All @@ -147,7 +149,7 @@ class YaruSplitButton extends StatelessWidget {
shape: dropdownShape,
),
onPressed: onDropdownPressed,
child: icon ?? const Icon(YaruIcons.pan_down),
child: dropdownIcon,
),
},
],
Expand Down

0 comments on commit 6ee266b

Please sign in to comment.