Skip to content

Commit 6195f64

Browse files
committed
publish v.0.1.1
1 parent 0d2a6e6 commit 6195f64

6 files changed

Lines changed: 27 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
* Custom switch padding
99
* Choice to display 'on' or 'off' value inside the switch
1010
* Custom active or inactive value color
11+
12+
## [0.1.1] - June 28, 2020
13+
14+
* Custom switch active and inactive text

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An easy to implement custom switch created for Flutter. You can have a customized the height and width, border radius, colors, toggle size and choice to display an 'On' and 'Off' text.
44

5-
[![GitHub followers](https://img.shields.io/github/followers/boringdeveloper.svg?style=social&label=Follow)](https://github.com/boringdeveloper) <a href="https://www.linkedin.com/in/nichole-john-talban-romero/"><img src="https://image.flaticon.com/icons/svg/174/174857.svg" width="20"></a> <a href="https://www.facebook.com/nickrgamer04/"><img src="https://image.flaticon.com/icons/svg/174/174848.svg" width="20"></a>
5+
[![GitHub followers](https://img.shields.io/github/followers/boringdeveloper.svg?style=social&label=Follow)](https://github.com/boringdeveloper) <a href="https://www.linkedin.com/in/nichole-john-talban-romero/"><img src="https://image.flaticon.com/icons/svg/174/174857.svg" width="20"></a>
66

77
## Demo
88

@@ -15,7 +15,7 @@ Add this to your package's `pubspec.yaml` file:
1515

1616
```yaml
1717
dependencies:
18-
flutter_switch: ^0.1.0
18+
flutter_switch: ^0.1.1
1919
```
2020
2121
You can install packages from the command line with Flutter:
@@ -57,7 +57,7 @@ class _MyHomePageState extends State<MyHomePage> {
5757
showOnOff: true,
5858
onToggle: (val) {
5959
setState(() {
60-
status5 = val;
60+
status = val;
6161
});
6262
},
6363
),

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class _MyHomePageState extends State<MyHomePage> {
173173
children: <Widget>[
174174
FlutterSwitch(
175175
activeText: "All Good",
176-
offText: "Under Quarantine",
176+
inactiveText: "Under Quarantine",
177177
value: status6,
178178
valueFontSize: 10.0,
179179
width: 110,

lib/flutter_switch.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class FlutterSwitch extends StatefulWidget {
1111
inactiveTextColor,
1212
toggleColor;
1313
final double width, height, toggleSize, valueFontSize, borderRadius, padding;
14-
final String activeText, offText;
14+
final String activeText, inactiveText;
1515

1616
const FlutterSwitch(
1717
{Key key,
@@ -30,7 +30,7 @@ class FlutterSwitch extends StatefulWidget {
3030
this.padding = 4.0,
3131
this.showOnOff = false,
3232
this.activeText,
33-
this.offText})
33+
this.inactiveText})
3434
: super(key: key);
3535

3636
@override
@@ -110,7 +110,7 @@ class _FlutterSwitchState extends State<FlutterSwitch>
110110
child: Container(
111111
padding: EdgeInsets.symmetric(horizontal: 4.0),
112112
alignment: Alignment.centerRight,
113-
child: _offText,
113+
child: _inactiveText,
114114
),
115115
)
116116
: Container(),
@@ -137,10 +137,10 @@ class _FlutterSwitchState extends State<FlutterSwitch>
137137
return Text("");
138138
}
139139

140-
Widget get _offText {
140+
Widget get _inactiveText {
141141
if (widget.showOnOff) {
142142
return Text(
143-
(widget?.offText != null) ? widget.offText : "Off",
143+
(widget?.inactiveText != null) ? widget.inactiveText : "Off",
144144
style: TextStyle(
145145
color: widget.inactiveTextColor,
146146
fontWeight: FontWeight.w900,

pubspec.lock

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,42 @@ packages:
77
name: archive
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.0.11"
10+
version: "2.0.13"
1111
args:
1212
dependency: transitive
1313
description:
1414
name: args
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "1.5.2"
17+
version: "1.6.0"
1818
async:
1919
dependency: transitive
2020
description:
2121
name: async
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "2.4.0"
24+
version: "2.4.1"
2525
boolean_selector:
2626
dependency: transitive
2727
description:
2828
name: boolean_selector
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.0.5"
31+
version: "2.0.0"
3232
charcode:
3333
dependency: transitive
3434
description:
3535
name: charcode
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "1.1.2"
38+
version: "1.1.3"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.14.11"
45+
version: "1.14.12"
4646
convert:
4747
dependency: transitive
4848
description:
@@ -56,7 +56,7 @@ packages:
5656
name: crypto
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "2.1.3"
59+
version: "2.1.4"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -73,7 +73,7 @@ packages:
7373
name: image
7474
url: "https://pub.dartlang.org"
7575
source: hosted
76-
version: "2.1.4"
76+
version: "2.1.12"
7777
matcher:
7878
dependency: transitive
7979
description:
@@ -95,13 +95,6 @@ packages:
9595
url: "https://pub.dartlang.org"
9696
source: hosted
9797
version: "1.6.4"
98-
pedantic:
99-
dependency: transitive
100-
description:
101-
name: pedantic
102-
url: "https://pub.dartlang.org"
103-
source: hosted
104-
version: "1.8.0+1"
10598
petitparser:
10699
dependency: transitive
107100
description:
@@ -115,7 +108,7 @@ packages:
115108
name: quiver
116109
url: "https://pub.dartlang.org"
117110
source: hosted
118-
version: "2.0.5"
111+
version: "2.1.3"
119112
sky_engine:
120113
dependency: transitive
121114
description: flutter
@@ -127,7 +120,7 @@ packages:
127120
name: source_span
128121
url: "https://pub.dartlang.org"
129122
source: hosted
130-
version: "1.5.5"
123+
version: "1.7.0"
131124
stack_trace:
132125
dependency: transitive
133126
description:
@@ -162,7 +155,7 @@ packages:
162155
name: test_api
163156
url: "https://pub.dartlang.org"
164157
source: hosted
165-
version: "0.2.11"
158+
version: "0.2.15"
166159
typed_data:
167160
dependency: transitive
168161
description:
@@ -183,6 +176,6 @@ packages:
183176
name: xml
184177
url: "https://pub.dartlang.org"
185178
source: hosted
186-
version: "3.5.0"
179+
version: "3.6.1"
187180
sdks:
188-
dart: ">=2.4.0 <3.0.0"
181+
dart: ">=2.6.0 <3.0.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_switch
22
description: An easy to implement custom switch that can have a customized the height and width, border radius, colors, toggle size and choice to display an 'On' and 'Off' text.
3-
version: 0.1.0
3+
version: 0.1.1
44
homepage: https://github.com/boringdeveloper/FlutterSwitch
55

66
environment:

0 commit comments

Comments
 (0)