Skip to content

Commit

Permalink
version 2.2.3 changes:
Browse files Browse the repository at this point in the history
  * Fixed center text issue
  • Loading branch information
PramodJoshi committed Mar 22, 2024
1 parent a158112 commit 0bcbcfc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.3
* Fixed center text issue

## 2.2.2
* Fixed overflow [issue](https://github.com/PramodJoshi/toggle_switch/issues/79)
* Code cleanups
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In the `pubspec.yaml` of your flutter project, add the following dependency:
```yaml
dependencies:
...
toggle_switch: ^2.2.2
toggle_switch: ^2.2.3
```
Import it:
Expand Down
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In the `pubspec.yaml` of your flutter project, add the following dependency:
```yaml
dependencies:
...
toggle_switch: ^2.2.2
toggle_switch: ^2.2.3
```
Import it:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.2.2"
version: "2.2.3"
vector_math:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: example
description: An example application using toggle switch widget.
version: 2.2.2
version: 2.2.3
publish_to: none

environment:
Expand Down
15 changes: 9 additions & 6 deletions lib/toggle_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ class _ToggleSwitchState extends State<ToggleSwitch>
: null);
}

/// Get icon
Widget icon = _icon(
index: index ~/ 2,
height: height,
width: width,
fgColor: fgColor);

/// Returns switch item
return Flexible(
child: GestureDetector(
Expand Down Expand Up @@ -357,15 +364,11 @@ class _ToggleSwitchState extends State<ToggleSwitch>
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_icon(
index: index ~/ 2,
height: height,
width: width,
fgColor: fgColor),
icon,
Flexible(
child: Container(
padding: EdgeInsets.only(
left: (_icon is SizedBox) ? 0.0 : 5.0),
left: (icon is SizedBox) ? 0.0 : 5.0),
child: Text(
widget.labels?[index ~/ 2] ?? '',
textAlign: (widget.centerText)
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: toggle_switch
description: Toggle Switch - A simple toggle switch widget. It can be fully customized with desired icons, width, colors, text, corner radius etc. It also maintains selection state.
version: 2.2.2
version: 2.2.3
homepage: https://github.com/PramodJoshi/toggle_switch

environment:
Expand Down

0 comments on commit 0bcbcfc

Please sign in to comment.