-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: API breakBackwards-incompatible API changesBackwards-incompatible API changesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitycustomer: fast (g3)frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight
Milestone
Description
Consider the following code:
Future<Null> fadeOutAndUpdateState() async {
await fadeAnimationController.reverse();
if (!mounted)
return;
await sizeAnimationController.reverse();
if (!mounted)
return;
setState(() {
dismissed = true;
});
}...it would be nice if the "if (!mounted)" calls weren't needed, but right now they are.
One option would be to make controllers complete with an error when they are aborted (or maybe only when disposed?). That would abort the above function. Unfortunately then you'd have to have a function to wrap the call site of the above function to handle (and ignore) the resulting error in the future...
Metadata
Metadata
Assignees
Labels
c: API breakBackwards-incompatible API changesBackwards-incompatible API changesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitycustomer: fast (g3)frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight