@@ -31,6 +31,8 @@ class FlutterSwitch extends StatefulWidget {
3131 this .inactiveText,
3232 this .activeTextFontWeight,
3333 this .inactiveTextFontWeight,
34+ this .switchBorder,
35+ this .toggleBorder,
3436 }) : super (key: key);
3537
3638 /// Determines if the switch is on or off.
@@ -159,6 +161,26 @@ class FlutterSwitch extends StatefulWidget {
159161 /// Defaults to the value of 4.0.
160162 final double padding;
161163
164+ /// Determines the border of the switch.
165+ ///
166+ /// An example usage would be...
167+ /// ```dart
168+ /// switchBorder: Border.all(color: Color.fromRGBO(2, 107, 206, 1), width: 6.0,)
169+ /// ```
170+ ///
171+ /// This is an optional property
172+ final BoxBorder switchBorder;
173+
174+ /// Determines the border of the toggle.
175+ ///
176+ /// An example usage would be...
177+ /// ```dart
178+ /// toggleBorder: Border.all(color: Color.fromRGBO(2, 107, 206, 1), width: 4.0,)
179+ /// ```
180+ ///
181+ /// This is an optional property
182+ final BoxBorder toggleBorder;
183+
162184 @override
163185 _FlutterSwitchState createState () => _FlutterSwitchState ();
164186}
@@ -225,6 +247,7 @@ class _FlutterSwitchState extends State<FlutterSwitch>
225247 color: _toggleAnimation.value == Alignment .centerLeft
226248 ? widget.inactiveColor
227249 : widget.activeColor,
250+ border: widget.switchBorder ?? null ,
228251 ),
229252 child: Row (
230253 mainAxisAlignment: MainAxisAlignment .spaceBetween,
@@ -245,6 +268,7 @@ class _FlutterSwitchState extends State<FlutterSwitch>
245268 decoration: BoxDecoration (
246269 shape: BoxShape .circle,
247270 color: widget.toggleColor,
271+ border: widget.toggleBorder ?? null ,
248272 ),
249273 ),
250274 ),
0 commit comments