Skip to content

Commit

Permalink
Make dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
Frezyx committed Sep 19, 2024
1 parent ba5055c commit e0aa35b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/src/group_button_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ class _GroupButtonBodyState<T> extends State<GroupButtonBody<T>> {
);
} else {
button = GroupButtonItem(
text: widget.buttonIndexedTextBuilder?.call(_isSelected(i), i, context) ??
widget.buttonTextBuilder?.call(_isSelected(i), widget.buttons[i], context) ??
text: widget.buttonIndexedTextBuilder
?.call(_isSelected(i), i, context) ??
widget.buttonTextBuilder
?.call(_isSelected(i), widget.buttons[i], context) ??
widget.buttons[i].toString(),
onPressed: _controller.disabledIndexes.contains(i)
? () => _controller.onDisablePressed?.call(i)
Expand Down Expand Up @@ -203,7 +205,9 @@ class _GroupButtonBodyState<T> extends State<GroupButtonBody<T>> {

/// Padding adding
/// when groupingType is row or column
if (widget.spacing > 0.0 && widget.buttonIndexedBuilder == null && widget.buttonBuilder == null) {
if (widget.spacing > 0.0 &&
widget.buttonIndexedBuilder == null &&
widget.buttonBuilder == null) {
if (widget.groupingType == GroupingType.row) {
button = Padding(
padding: EdgeInsets.symmetric(horizontal: widget.spacing),
Expand Down Expand Up @@ -232,14 +236,18 @@ class _GroupButtonBodyState<T> extends State<GroupButtonBody<T>> {
} else {
final maxSelected = widget.maxSelected;
final selectedIndexesCount = _controller.selectedIndexes.length;
if (maxSelected != null && selectedIndexesCount >= maxSelected && !_controller.selectedIndexes.contains(i)) {
if (maxSelected != null &&
selectedIndexesCount >= maxSelected &&
!_controller.selectedIndexes.contains(i)) {
return;
}
_controller.toggleIndexes([i]);
}
}

bool _isSelected(int i) {
return widget.isRadio ? _controller.selectedIndex == i : _controller.selectedIndexes.contains(i);
return widget.isRadio
? _controller.selectedIndex == i
: _controller.selectedIndexes.contains(i);
}
}

0 comments on commit e0aa35b

Please sign in to comment.