Skip to content

Commit

Permalink
2.0.21 made padding accept a more flexible EdgeInsets. Thanks @osmanybg
Browse files Browse the repository at this point in the history
  • Loading branch information
lcuis committed Jul 5, 2022
1 parent 26f19fb commit 6c05345
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.21

* Updated license date. Fixed a deprecation warning in pub.dev with isAlwaysShown.
* Fixed increasing or decreasing size between hint, enabled, disabled, selected states. Thanks @vaibhavjoshi247 https://github.com/lcuis/search_choices/issues/81

## 2.0.20

* Added dropDownDialogPadding parameter. Thanks @Macacoazul01 https://github.com/lcuis/search_choices/issues/77
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Search choices Widget with a single choice that opens a dialog or a menu to let
bool rightToLeft = false,
bool autofocus = true,
Function? selectedAggregateWidgetFn,
double padding = 10.0,
dynamic padding = 10.0,
Function? setOpenDialog,
Widget Function (Widget titleBar,Widget searchBar, Widget list, Widget closeButton, BuildContext dropDownContext,)? buildDropDownDialog,
EdgeInsets? dropDownDialogPadding,
Expand Down Expand Up @@ -185,7 +185,7 @@ Search choices Widget with a single choice that opens a dialog or a menu to let
* rightToLeft bool mirrors the widgets display for right to left languages defaulted to false.
* autofocus bool automatically focuses on the search field bringing up the keyboard defaulted to true.
* selectedAggregateWidgetFn Function with parameter: list of widgets presenting selected values, returning Widget to be displayed to present the selected items.
* padding double sets the padding around the DropdownButton, defaulted to 10.0.
* padding double or EdgeInsets sets the padding around the DropdownButton, defaulted to 10.0.
* setOpenDialog Function sets the function to call to set the function to call in order to open the dialog with the search terms string as a parameter, defaulted to null.
* buildDropDownDialog Function controls the layout of the dropdown dialog.
* dropDownDialogPadding EdgeInsets sets the padding between the screen and the dialog.
Expand Down Expand Up @@ -242,7 +242,7 @@ Search choices Widget with a multiple choice that opens a dialog or a menu to le
bool rightToLeft = false,
bool autofocus = true,
Function? selectedAggregateWidgetFn,
double padding = 10.0,
dynamic padding = 10.0,
Function? setOpenDialog,
Widget Function (Widget titleBar,Widget searchBar, Widget list, Widget closeButton, BuildContext dropDownContext,)? buildDropDownDialog,
EdgeInsets? dropDownDialogPadding,
Expand Down Expand Up @@ -308,7 +308,7 @@ Search choices Widget with a multiple choice that opens a dialog or a menu to le
* rightToLeft bool mirrors the widgets display for right to left languages defaulted to false.
* autofocus bool automatically focuses on the search field bringing up the keyboard defaulted to true.
* selectedAggregateWidgetFn Function with parameter: list of widgets presenting selected values, returning Widget to be displayed to present the selected items.
* padding double sets the padding around the DropdownButton, defaulted to 10.0.
* padding double or EdgeInsets sets the padding around the DropdownButton, defaulted to 10.0.
* setOpenDialog Function sets the function to call to set the function to call in order to open the dialog with the search terms string as a parameter, defaulted to null.
* buildDropDownDialog Function controls the layout of the dropdown dialog.
* dropDownDialogPadding EdgeInsets sets the padding between the screen and the dialog.
Expand Down
22 changes: 12 additions & 10 deletions lib/search_choices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ class SearchChoices<T> extends StatefulWidget {
/// present the selected items.
final Function? selectedAggregateWidgetFn;

/// [padding] [double] sets the padding around the DropdownButton, defaulted
/// to 10.0.
final double padding;
/// [padding] [double] or [EdgeInsets] sets the padding around the
/// DropdownButton, defaulted to 10.0.
final dynamic padding;

/// [setOpenDialog] [Function] sets the function to call to set the function
/// to call in order to open the dialog with the search terms string as a
Expand Down Expand Up @@ -484,8 +484,8 @@ class SearchChoices<T> extends StatefulWidget {
/// * [selectedAggregateWidgetFn] [Function] with parameter: __list of widgets
/// presenting selected values__ , returning [Widget] to be displayed to
/// present the selected items.
/// * [padding] [double] sets the padding around the DropdownButton, defaulted
/// to 10.0.
/// * [padding] [double] or [EdgeInsets] sets the padding around the
/// DropdownButton, defaulted to 10.0.
/// * [setOpenDialog] [Function] sets the function to call to set the function
/// to call in order to open the dialog with the search terms string as a
/// parameter, defaulted to null.
Expand Down Expand Up @@ -569,7 +569,7 @@ class SearchChoices<T> extends StatefulWidget {
bool rightToLeft = false,
bool autofocus = true,
Function? selectedAggregateWidgetFn,
double padding = 10.0,
dynamic padding = 10.0,
Function? setOpenDialog,
Widget Function(
Widget titleBar,
Expand Down Expand Up @@ -725,8 +725,8 @@ class SearchChoices<T> extends StatefulWidget {
/// * [selectedAggregateWidgetFn] [Function] with parameter: __list of widgets
/// presenting selected values__ , returning [Widget] to be displayed to
/// present the selected items.
/// * [padding] [double] sets the padding around the DropdownButton, defaulted
/// to 10.0.
/// * [padding] [double] or [EdgeInsets] sets the padding around the
/// DropdownButton, defaulted to 10.0.
/// * [setOpenDialog] [Function] sets the function to call to set the function
/// to call in order to open the dialog with the search terms string as a
/// parameter, defaulted to null.
Expand Down Expand Up @@ -811,7 +811,7 @@ class SearchChoices<T> extends StatefulWidget {
bool rightToLeft = false,
bool autofocus = true,
Function? selectedAggregateWidgetFn,
double padding = 10.0,
dynamic padding = 10.0,
Function? setOpenDialog,
Widget Function(
Widget titleBar,
Expand Down Expand Up @@ -1466,7 +1466,9 @@ class _SearchChoicesState<T> extends State<SearchChoices<T>> {
? Stack(
children: <Widget>[
Padding(
padding: EdgeInsets.all(widget.padding),
padding: widget.padding is EdgeInsets
? widget.padding
: EdgeInsets.all(widget.padding),
child: result,
),
widget.underline is NotGiven
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: search_choices
description: Highly versatile Widget to search through a single or multiple choices list in a dialog box or a menu. Supports pagination and future/API/webservice searches with sort and filter.
version: 2.0.20
version: 2.0.21
homepage: https://github.com/lcuis/search_choices
repository: https://github.com/lcuis/search_choices
issue_tracker: https://github.com/lcuis/search_choices/issues
Expand Down

3 comments on commit 6c05345

@omeraydindev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a breaking change, existing projects that pass an int argument to padding will fail at runtime with

Exception: type 'int' is not a subtype of type 'double'

The fix is simple but still. (Just append a .0 to your int argument.)

@lcuis
Copy link
Owner Author

@lcuis lcuis commented on 6c05345 Jul 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @MikeAndrson for bringing this to my attention!
I intend to fix this with version 2.1.1 .

@lcuis
Copy link
Owner Author

@lcuis lcuis commented on 6c05345 Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MikeAndrson ,

Version 2.1.1 is now published with the fix to the issue you mentioned.

Thanks again!

Please sign in to comment.