diff --git a/lib/src/Toggles/Switcher/switcher.toggle.dart b/lib/src/Toggles/Switcher/switcher.toggle.dart index f1e89fd..be38fc3 100644 --- a/lib/src/Toggles/Switcher/switcher.toggle.dart +++ b/lib/src/Toggles/Switcher/switcher.toggle.dart @@ -86,7 +86,7 @@ class AstromicSwitcherToggleState extends State { } //SECTION - Action Callbacks - _onTap(bool newValue) async { + Future _onTap(bool newValue) async { if (widget.onStateChanged != null) { _currentState = await widget.onStateChanged!(_currentState); } else { @@ -137,7 +137,7 @@ class AstromicSwitcherToggleState extends State { inactiveIcon: _style.innerInactiveWidget, // padding: _style.togglePadding, - onToggle: !_config.isEnabled ? (bool v) {} : (bool s) => _onTap(s), + onToggle: !_config.isEnabled ? (bool v) {} : (bool s) async => await _onTap(s), ), //S1 -- Label Spacing if (_config.withLabel) SizedBox(width: _style.labelSpacing),