Skip to content

Commit

Permalink
0.0.4: Updated Description + Formatted multiselect.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
TaimoorHassan committed Jun 28, 2021
1 parent 9374b44 commit 1e82df7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.4
* Updated package description
* formatted multiselect.dart

## 0.0.3
* Matching version number in pub with github

Expand Down
20 changes: 14 additions & 6 deletions lib/multiselect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ class _SelectRow extends StatelessWidget {
final bool selected;
final String text;

const _SelectRow({Key? key, required this.onChange, required this.selected, required this.text}) : super(key: key);
const _SelectRow(
{Key? key,
required this.onChange,
required this.selected,
required this.text})
: super(key: key);
@override
Widget build(BuildContext context) {
return Row(
Expand Down Expand Up @@ -52,8 +57,6 @@ class DropDownMultiSelect extends StatefulWidget {
/// Input decoration
final InputDecoration? decoration;



/// this text is shown when there is no selection
final String? whenEmpty;

Expand Down Expand Up @@ -82,15 +85,20 @@ class DropDownMultiSelect extends StatefulWidget {
class _DropDownMultiSelectState extends State<DropDownMultiSelect> {
@override
Widget build(BuildContext context) {
return Container( height: 100,
return Container(
height: 100,
child: Stack(
children: [
_theState.rebuilder(() => widget.childBuilder != null
? widget.childBuilder!(widget.selectedValues)
: Align(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
child: Text(widget.selectedValues.length > 0 ? widget.selectedValues.reduce((a, b) => a + ' , ' + b) : widget.whenEmpty ?? '')),
padding:
EdgeInsets.symmetric(vertical: 15, horizontal: 10),
child: Text(widget.selectedValues.length > 0
? widget.selectedValues
.reduce((a, b) => a + ' , ' + b)
: widget.whenEmpty ?? '')),
alignment: Alignment.centerLeft)),
Align(
alignment: Alignment.centerLeft,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: multiselect
description: A simple multiselect dropdown
version: 0.0.3
description: A simple multiselect dropdown. It provide a concise way to create a Multi Selct ComboBox/SelectBox
version: 0.0.4
homepage: https://github.com/TaimoorHassan/multiselect

environment:
Expand Down

0 comments on commit 1e82df7

Please sign in to comment.