-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
When a dialog is dismissed, it must be possible to run a callback.
Consider this code:
Future<T> showDialog <T>({
@required BuildContext context,
bool barrierDismissible: true,
WidgetBuilder builder
})There are 3 ways to close a dialog:
1) Pressing some button on the dialog that closes it.
2) Tapping the barrier.
3) Pressing the Android back button.
Currently only the first one allows us to fire a callback. That's very bad.
Please, create a onBarrierDismissed callback field, like this:
Future<T> showDialog <T>({
@required BuildContext context,
bool barrierDismissible: true,
VoidCallback: onBarrierDismissed,
WidgetBuilder builder
})Then pass it down to modal_barrier.dart, where instead of this:
onTapDown: (TapDownDetails details) {
if (dismissible) Navigator.maybePop(context);
},It should do this:
onTapDown: (TapDownDetails details) {
if (dismissible) {
Navigator.maybePop(context);
if (onBarrierDismissed != null) onBarrierDismissed();
}
},yamauchieduardo, PieterAelse, lColinDl, frederike-ramin, michinchin and 37 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.