Skip to content

Commit

Permalink
Merge pull request #41 from Frezyx/dev
Browse files Browse the repository at this point in the history
Release version 3.1.0
  • Loading branch information
Frezyx authored Aug 4, 2021
2 parents 0955525 + db02cd5 commit 894552a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.1.0
- **FEAT**: Add runSpacing field !
When [groupingType] is [GroupingType.wrap] this field sets Wrap [runSpacing]
- **BREAKING**: Now spacing field is not sets GroupButton items vertical spacing

## 3.0.1
- **FIX**: Remove initial selected button from original widget
initialization
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Follow these steps to use this package

```yaml
dependencies:
group_button: ^3.0.1 #latest version
group_button: ^3.1.0 #latest version
```
### Add import package
Expand Down Expand Up @@ -105,6 +105,7 @@ You can check more examples of using this package [here](https://github.com/Frez
| isRadio | bool variable for switching between modes [ChackBox] and [Radio]<br>if the [isRadio] = true, only one button can be selected<br>if the [isRadio] = false, you can select several at once |
| direction | The direction of arrangement of the buttons in [GroupButton] |
| spacing | The spacing between buttons inside [GroupButton] |
| runSpacing | When [groupingType] is [GroupingType.wrap] this field sets Wrap [runSpacing] |
| selectedTextStyle | [TextStyle] of text of selected button(s) |
| unselectedTextStyle | [TextStyle] of text of unselected buttons |
| selectedColor | background [Color] of selected button(s) |
Expand Down
2 changes: 1 addition & 1 deletion example/lib/examples/extended_example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class _ExampleState extends State<_Example> {
mainGroupAlignment: MainGroupAlignment.start,
groupingType: GroupingType.row,
buttons: const [
"group_button: 3.0.1",
"group_button: 3.1.0",
],
selectedTextStyle: const TextStyle(
color: Colors.white,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/examples/styles_example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class StylesExample extends StatelessWidget {
home: Scaffold(
appBar: AppBar(
title: const Text(
'group_button: 3.0.1',
'group_button: 3.1.0',
style: TextStyle(
color: Colors.black,
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.0.1
version: 3.1.0

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down
6 changes: 6 additions & 0 deletions lib/group_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GroupButton extends StatelessWidget {
this.groupingType = GroupingType.wrap,
this.direction,
this.spacing = 0,
this.runSpacing = 0,
this.selectedTextStyle = _kDefaultSelectedTextStyle,
this.unselectedTextStyle = _kDefaultUnselectedTextStyle,
this.selectedColor,
Expand Down Expand Up @@ -67,6 +68,10 @@ class GroupButton extends StatelessWidget {
/// The spacing between buttons inside [GroupButton]
final double spacing;

/// When [groupingType] is [GroupingType.wrap]
/// this field sets Wrap [runSpacing]
final double runSpacing;

/// [TextStyle] of text of selected button(s)
final TextStyle? selectedTextStyle;

Expand Down Expand Up @@ -123,6 +128,7 @@ class GroupButton extends StatelessWidget {
isRadio: isRadio,
direction: direction,
spacing: spacing,
runSpacing: runSpacing,
selectedTextStyle: selectedTextStyle,
unselectedTextStyle: unselectedTextStyle,
selectedColor: selectedColor,
Expand Down
4 changes: 3 additions & 1 deletion lib/src/group_button_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class GroupButtonBody extends StatefulWidget {
this.isRadio = false,
this.direction,
this.spacing = 0.0,
this.runSpacing = 0.0,
this.selectedTextStyle,
this.unselectedTextStyle,
this.selectedColor,
Expand All @@ -36,6 +37,7 @@ class GroupButtonBody extends StatefulWidget {
final bool isRadio;
final Axis? direction;
final double spacing;
final double runSpacing;
final TextStyle? selectedTextStyle;
final TextStyle? unselectedTextStyle;
final Color? selectedColor;
Expand Down Expand Up @@ -100,7 +102,7 @@ class _GroupButtonBodyState extends State<GroupButtonBody> {
return Wrap(
direction: widget.direction ?? Axis.horizontal,
spacing: widget.spacing,
runSpacing: widget.spacing,
runSpacing: widget.runSpacing,
crossAxisAlignment: widget.crossGroupAlignment.toWrap(),
runAlignment: widget.groupRunAlignment.toWrap(),
alignment: widget.mainGroupAlignment.toWrap(),
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: group_button
description: Flutter custom widget to make a group buttons. Included Radio and CheckBox buttons.
version: 3.0.1
version: 3.1.0
homepage: https://github.com/Frezyx/group_button

environment:
Expand Down

0 comments on commit 894552a

Please sign in to comment.