diff --git a/CHANGELOG.md b/CHANGELOG.md index bcce2d4..9a03b25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.4.9+2] - 2021-03-25. +* `[Updated]` - Add tags container decoration. +* `[Updated]` - Add tags container padding. + ## [0.4.9+1] - 2020-11-11. * `[Fixed]` - Issue #66. diff --git a/README.md b/README.md index 30cd8ea..c19bd89 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,8 @@ Tags( |`textDirection`|*Text direction of the ItemTags*|TextDirection.ltr| |`itemBuilder`|*tag generator*|| |`textField`|*add textField*|TagsTextFiled()| +|`containerDecoration`|*add tags container decoration*|null| +|`containerPadding`|*add tags container padding*|null| ### ItemTags() parameters * `index` - *required* diff --git a/lib/src/tags.dart b/lib/src/tags.dart index 0542abb..5f1f72f 100644 --- a/lib/src/tags.dart +++ b/lib/src/tags.dart @@ -23,6 +23,8 @@ class Tags extends StatefulWidget { this.textDirection = TextDirection.ltr, this.itemBuilder, this.textField, + this.containerDecoration, + this.containerPadding, Key key}) : assert(itemCount >= 0), assert(alignment != null), @@ -78,6 +80,12 @@ class Tags extends StatefulWidget { /// custom TextField final TagsTextField textField; + /// Tags container decoration + final BoxDecoration containerDecoration; + + /// Tags container padding + final EdgeInsetsGeometry containerPadding; + @override TagsState createState() => TagsState(); } @@ -128,20 +136,23 @@ class TagsState extends State { ), ); else - child = CustomWrap( - key: _containerKey, - alignment: widget.alignment, - runAlignment: widget.runAlignment, - spacing: widget.spacing, - runSpacing: widget.runSpacing, - column: widget.columns, - symmetry: widget.symmetry, - textDirection: widget.textDirection, - direction: widget.direction, - verticalDirection: widget.verticalDirection, - crossAxisAlignment: WrapCrossAlignment.end, - children: _buildItems(), - ); + child = Container( + decoration: widget.containerDecoration, + padding: widget.containerPadding, + child: CustomWrap( + key: _containerKey, + alignment: widget.alignment, + runAlignment: widget.runAlignment, + spacing: widget.spacing, + runSpacing: widget.runSpacing, + column: widget.columns, + symmetry: widget.symmetry, + textDirection: widget.textDirection, + direction: widget.direction, + verticalDirection: widget.verticalDirection, + crossAxisAlignment: WrapCrossAlignment.end, + children: _buildItems(), + )); return DataListInherited( list: _list, diff --git a/pubspec.yaml b/pubspec.yaml index b33119f..a9271df 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_tags description: Creating selectable and input tags (TextField) has never been easier. -version: 0.4.9+1 +version: 0.4.9+2 author: Antonino Di Natale homepage: https://github.com/Dn-a/flutter_tags