Skip to content

Commit

Permalink
Fix merge commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CHB61 committed Mar 14, 2022
1 parent be5b92a commit 1fd6879
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
All notable changes to this project will be documented in this file.


## [4.1.2] - 2022-03-14
### Changed
- Merged [PR #87](https://github.com/CHB61/multi_select_flutter/pull/87). Thanks @benyaminbeyzaie

## [4.1.1] - 2022-03-14
### Changed
- Created a bug in 4.0.0 by removing the 'collection' dependency. It's only used to call firstWhereOrNull in _buildInheritedChipDisplay in both MultiSelectDialogField and MultiSelectBottomSheetField. This function is meant to automatically build the chips, but it may be changed or removed in the future as I don't think it is really necessary, and has caused some issues. For now, the package still depends on collection.

## [4.1.0] - 2022-03-14
### Changed
- BREAKING: re-named the 'width' and 'height' fields to dialogWidth and dialogHeight.
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class _MyHomePageState extends State<MyHomePage> {
onConfirm: (val) {
_selectedAnimals5 = val;
},
width: MediaQuery.of(context).size.width * 0.7,
dialogWidth: MediaQuery.of(context).size.width * 0.7,
items: _items,
initialValue:
_selectedAnimals5, // setting the value of this in initState() to pre-select values.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.1.8"
version: "4.1.2"
path:
dependency: transitive
description:
Expand Down
34 changes: 19 additions & 15 deletions lib/chip_field/multi_select_chip_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class MultiSelectChipField<V> extends FormField<List<V>> {
showHeader: showHeader,
chipWidth: chipWidth,
);
return _MultiSelectChipFieldView<V?>.withState(view as _MultiSelectChipFieldView<V?>, state);
return _MultiSelectChipFieldView<V?>.withState(
view as _MultiSelectChipFieldView<V?>, state);
});
}

Expand Down Expand Up @@ -378,8 +379,7 @@ class __MultiSelectChipFieldViewState<V>
MediaQuery.of(context).size.height * 0.08,
child: widget.scrollBar != null
? Scrollbar(
isAlwaysShown:
widget.scrollBar!.isAlwaysShown,
isAlwaysShown: widget.scrollBar!.isAlwaysShown,
controller: _scrollController,
child: ListView.builder(
controller: _scrollController,
Expand All @@ -388,8 +388,10 @@ class __MultiSelectChipFieldViewState<V>
itemBuilder: (ctx, index) {
return widget.itemBuilder != null
? widget.itemBuilder!(
_items[index] as MultiSelectItem<V>, widget.state!)
: _buildItem(_items[index] as MultiSelectItem<V?>);
_items[index] as MultiSelectItem<V>,
widget.state!)
: _buildItem(
_items[index] as MultiSelectItem<V?>);
},
),
)
Expand All @@ -400,8 +402,10 @@ class __MultiSelectChipFieldViewState<V>
itemBuilder: (ctx, index) {
return widget.itemBuilder != null
? widget.itemBuilder!(
_items[index] as MultiSelectItem<V>, widget.state!)
: _buildItem(_items[index] as MultiSelectItem<V?>);
_items[index] as MultiSelectItem<V>,
widget.state!)
: _buildItem(
_items[index] as MultiSelectItem<V?>);
},
),
)
Expand All @@ -411,14 +415,14 @@ class __MultiSelectChipFieldViewState<V>
padding: EdgeInsets.symmetric(horizontal: 10),
child: Wrap(
children: widget.itemBuilder != null
? _items
.map((item) =>
widget.itemBuilder!(item as MultiSelectItem<V>, widget.state!))
.toList()
: _items
.map((item) => _buildItem(item as MultiSelectItem<V?>))
.toList()
,
? _items
.map((item) => widget.itemBuilder!(
item as MultiSelectItem<V>, widget.state!))
.toList()
: _items
.map((item) =>
_buildItem(item as MultiSelectItem<V?>))
.toList(),
),
),
],
Expand Down
1 change: 0 additions & 1 deletion lib/dialog/mult_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class MultiSelectDialog<T> extends StatefulWidget with MultiSelectActions<T> {
this.selectedItemsTextStyle,
this.separateSelectedItems = false,
this.checkColor,
this.width,
});

@override
Expand Down
3 changes: 0 additions & 3 deletions lib/dialog/multi_select_dialog_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class MultiSelectDialogField<V> extends FormField<List<V>> {
/// Sets a fixed width on the dialog.
final double? dialogWidth;

/// Give the dialog a fixed width
final double? width;

/// Set the placeholder text of the search field.
final String? searchHint;

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: multi_select_flutter
description: A flexible multi select package for Flutter. Make multi select widgets the way you want.
version: 4.1.1
version: 4.1.2
repository: https://github.com/CHB61/flutter-multi-select
issue_tracker: https://github.com/CHB61/flutter-multi-select
documentation: https://github.com/CHB61/flutter-multi-select
Expand Down

0 comments on commit 1fd6879

Please sign in to comment.