You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
showModalBottomSheet provides a return value of Future. However - the current implementation of SweetSheet does not provide a provision to return action data choices (Return values when buttons are tapped). It is therefore suggested to correctly amend the signature of show() to capture return data.
An example of how the SweetSheet.bottomDialog can be called and how we now process the Navigator return values is :
var continueRunning = await SweetSheetHelper.bottomDialog(
context, Text('This is your title'),
description: Text(
'This is your description'),
color: SweetSheetColor.WARNING,
icon: 'assets/lottie/warningWhiteCircle.zip',
useRootNavigator: true,
positive: SweetSheetAction(
icon: MdiIcons.runFast,
title: 'CONTINUE',
onPressed: () =>
Navigator.of(context, rootNavigator: true).pop(true),
),
negative: SweetSheetAction(
title: 'CANCEL',
onPressed: () =>
Navigator.of(context, rootNavigator: true).pop(false),
));
/// And here you will be able to get the RETURN values from the navigators (true/false/null etc)
if (continueRunning == null || !continueRunning) {
return; // User tapped cancel or discarded the MODAL sheet
}
The text was updated successfully, but these errors were encountered:
Hi
showModalBottomSheet provides a return value of Future. However - the current implementation of SweetSheet does not provide a provision to return action data choices (Return values when buttons are tapped). It is therefore suggested to correctly amend the signature of show() to capture return data.
And this can then be accessed as in a specific warning helper method that just wraps SweetSheetColor.WARNING & Associated Icon
An example of how the SweetSheet.bottomDialog can be called and how we now process the Navigator return values is :
The text was updated successfully, but these errors were encountered: