Skip to content

Commit

Permalink
Added param 'separateSelectedItems' which can be used with LIST type …
Browse files Browse the repository at this point in the history
…only. Allow to adjust the width of the dialog with 'dialogWidth'. Re-named the height param to dialogHeight.
  • Loading branch information
CHB61 committed Mar 14, 2022
1 parent 5bed087 commit d3dd5b7
Show file tree
Hide file tree
Showing 14 changed files with 316 additions and 205 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
All notable changes to this project will be documented in this file.


## [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.
- Allow to adjust the width of the dialog.

### Added
- param 'separateSelectedItems' which can be used with LIST type only.

## [4.0.0] - 2021-03-20
### Changed
- Added null safety. Thanks to @ihancock for taking the initiative to apply this.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020, Christiaan H. Botha
Copyright (c) 2020, Chris Botha

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
Expand Down
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,16 @@ Multi Select Flutter is a package for creating multi-select widgets in a variety

## Features
- Supports FormField features like validator.
- Neutral default design that can be altered to your heart's content.
- Choose between Dialog, BottomSheet, or ChoiceChip style widgets.
- Neutral default design.
- Dialog, BottomSheet, or ChoiceChip style widgets.
- Make your multi select `searchable` for larger lists.

## Install
Add this to your pubspec.yaml file:
```yaml
dependencies:
multi_select_flutter: ^4.0.0
```
## Usage

### MultiSelectDialogField / MultiSelectBottomSheetField
<img src="https://i.imgur.com/JoTYWce.png" /><img src="https://i.imgur.com/Co8fhrD.png" />

These widgets provide an InkWell button which open the dialog or bottom sheet and are equipped with FormField features. You can customize it to your liking using the provided parameters.
These widgets provide an InkWell button which open the dialog or bottom sheet and are equipped with FormField features. You can customize it using the provided parameters.

To store the selected values, you can use the `onConfirm` parameter. You could also use `onSelectionChanged` for this.

Expand Down Expand Up @@ -182,7 +175,6 @@ void _startAnimation(ScrollController controller) {
## Constructors

### MultiSelectDialog
<img src="https://i.imgur.com/oIxOHLS.png" height="120" /><img src="https://i.imgur.com/4aPWPw2.png" height="120" /><img src="https://i.imgur.com/VDUHCMy.png" height="120" />

| Parameter | Type | Description |
|---|---|---
Expand All @@ -205,11 +197,11 @@ void _startAnimation(ScrollController controller) {
| `searchHint` | String | Set the placeholder text of the search field. |
| `searchTextStyle` | TextStyle | Style the search text. |
| `selectedColor` | Color | Set the color of the checkbox or chip items that are selected. |
| `separateSelectedItems` | bool | Moves the selected items to the top of the list. |
| `title` | Widget | The title that is displayed at the top of the dialog. |
| `unselectedColor` | Color | Set the color of the chip body or checkbox border while not selected. |

### MultiSelectDialogField
<img src="https://i.imgur.com/Zivo3FS.png" height="150" /><img src="https://i.imgur.com/XKBq6eG.png" height="150" /><img src="https://i.imgur.com/fBzleJj.png" height="150" />

MultiSelectDialogField has all the parameters of MultiSelectDialog plus these extra parameters:

Expand All @@ -226,7 +218,6 @@ MultiSelectDialogField has all the parameters of MultiSelectDialog plus these ex
| `validator` | FormFieldValidator\<List> | Validation. See [Flutter's documentation](https://flutter.dev/docs/cookbook/forms/validation). |

### MultiSelectBottomSheet
<img src="https://i.imgur.com/pfGYQTk.png" height="120" /><img src="https://i.imgur.com/s70LWyB.png" height="120" /><img src="https://i.imgur.com/iiqTTIH.png" height="120" />

| Parameter | Type |Description |
|---|---|---
Expand All @@ -250,11 +241,11 @@ MultiSelectDialogField has all the parameters of MultiSelectDialog plus these ex
| `searchIcon` | Icon | The icon button that shows the search field. |
| `searchTextStyle` | TextStyle | Style the search text. |
| `selectedColor` | Color | Set the color of the checkbox or chip items that are selected. |
| `separateSelectedItems` | bool | Moves the selected items to the top of the list. |
| `title` | Widget | The title that is displayed at the top of the BottomSheet. |
| `unselectedColor` | Color | Set the color of the chip body or checkbox border while not selected. |

### MultiSelectBottomSheetField
<img src="https://i.imgur.com/i17CAgc.png" height="160" /><img src="https://i.imgur.com/XFivjfC.png" height="160" /><img src="https://i.imgur.com/lXUBkWs.png" height="160" />

MultiSelectBottomSheetField has all the parameters of MultiSelectBottomSheet plus these extra parameters:

Expand All @@ -273,7 +264,6 @@ MultiSelectBottomSheetField has all the parameters of MultiSelectBottomSheet plu
| `validator` | FormFieldValidator\<List> | Validation. See [Flutter's documentation](https://flutter.dev/docs/cookbook/forms/validation). |

### MultiSelectChipField
<img src="https://i.imgur.com/BmoqrH4.png" height="160" /><img src="https://i.imgur.com/2uGWQkc.png" height="160" /><img src="https://i.imgur.com/0I7wcVz.png" height="160" />

| Parameter | Type | Description |
|---|---|---
Expand Down Expand Up @@ -308,7 +298,6 @@ MultiSelectBottomSheetField has all the parameters of MultiSelectBottomSheet plu
| `validator` | FormFieldValidator\<List> | Validation. See [Flutter's documentation](https://flutter.dev/docs/cookbook/forms/validation). |

### MultiSelectChipDisplay
<img src="https://i.imgur.com/HIi3alZ.png" height="165" />

| Parameter | Type | Description |
|---|---|---
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="example"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
25 changes: 16 additions & 9 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
Expand All @@ -21,14 +21,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -73,14 +73,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
multi_select_flutter:
dependency: "direct main"
description:
Expand All @@ -106,7 +113,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -141,7 +148,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.4.8"
typed_data:
dependency: transitive
description:
Expand All @@ -155,6 +162,6 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
Loading

0 comments on commit d3dd5b7

Please sign in to comment.