Skip to content

Commit

Permalink
Merge pull request #6 from JhonaCodes/padding_all_select_grouping
Browse files Browse the repository at this point in the history
Padding all select grouping
  • Loading branch information
JhonaCodes authored Jan 7, 2025
2 parents 1cee49d + 00cf63d commit 9859387
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.6.1
- UI enhancements, including padding and layout adjustments.

## 1.6.1
- New feature `itemColor`, Customize the colors for selected, hovered, and unselected items.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add the dependency to your `pubspec.yaml` file:

```yaml
dependencies:
multiselect_field: ^1.6.1
multiselect_field: ^1.6.2
```
Then, install the dependencies using:
Expand Down
35 changes: 21 additions & 14 deletions lib/core/multi_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,21 @@ class _MultiSelectFieldState<T> extends State<MultiSelectField<T>>
: null
: null,
leadingIcon: widget.selectAllOption && !isGroupingTitle
? (_isSelected(result))
? const Icon(
Icons.check_box,
color: Colors.green,
)
: Icon(Icons.check_box_outline_blank)
? Padding(
padding: EdgeInsets.only(left: 15),
child: _isSelected(result)
? const Icon(
Icons.check_box,
color: Colors.green,
)
: Icon(Icons.check_box_outline_blank),
)
: null,
style: widget.buttonStyle ??
ButtonStyle(
alignment: Alignment.centerLeft,
elevation:
const WidgetStatePropertyAll<double>(10),
const WidgetStatePropertyAll<double>(7.5),
overlayColor: const WidgetStatePropertyAll(
Colors.transparent),
backgroundColor:
Expand Down Expand Up @@ -529,13 +532,17 @@ class _MultiSelectFieldState<T> extends State<MultiSelectField<T>>
}
},
child: widget.itemMenuButton ??
Text(
result.value,
style: isGroupingTitle
? widget.titleMenuStyle ??
Theme.of(context).textTheme.titleMedium
: widget.itemMenuStyle ??
Theme.of(context).textTheme.labelMedium,
Padding(
padding: EdgeInsets.only(
left: isGroupingTitle ? 10 : 0),
child: Text(
result.value,
style: isGroupingTitle
? widget.titleMenuStyle ??
Theme.of(context).textTheme.titleMedium
: widget.itemMenuStyle ??
Theme.of(context).textTheme.labelMedium,
),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: multiselect_field
description: "A flexible dropdown field supporting single/multiple selection modes, styles, titles, etc"
version: 1.6.1
version: 1.6.2
homepage: https://github.com/JhonaCodes/multiselect_field.git

environment:
Expand Down

0 comments on commit 9859387

Please sign in to comment.