-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
The popular use_build_context_synchronously lint suggests to check for mounted before using the context after an asynchronous gap. However, mounted only exists on StatefullWidgets. At the same time, StatelessWidgets suffer under the same problem: The context can become invalid after an asynchronous gap and there is currently no way to check whether it is still valid since there is no mounted property. A work-around is to turn the StatelessWidget into a StatefulWidget.
We should expose some kind of a property on BuildContext directly to check whether the context is still valid to simplify usage of context after an asynchronous gaps in these use cases.
w1th0utnam3, a14n, VuillaumeGautier, RoarGronmo, tp and 3 more
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.