[FEAT] Dismiss handler for toggle
This commit is contained in:
@@ -86,7 +86,7 @@ class AstromicSwitcherToggleState extends State<AstromicSwitcherToggle> {
|
||||
}
|
||||
|
||||
//SECTION - Action Callbacks
|
||||
_onTap(bool newValue) async {
|
||||
Future<void> _onTap(bool newValue) async {
|
||||
if (widget.onStateChanged != null) {
|
||||
_currentState = await widget.onStateChanged!(_currentState);
|
||||
} else {
|
||||
@@ -137,7 +137,7 @@ class AstromicSwitcherToggleState extends State<AstromicSwitcherToggle> {
|
||||
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),
|
||||
|
||||
Reference in New Issue
Block a user