mirror of
https://github.com/flutter/flutter
synced 2024-09-13 05:11:45 +00:00
Tweak to fix context.mounted in dialog_demo (#147998)
Prepares for a fix to the `use_build_context_synchronously` lint (https://dart-review.googlesource.com/c/sdk/+/365541) that will complain about these unsafe usages. The lint rule cannot tell that the `mounted` field is shorthand for `context.mounted`.
This commit is contained in:
parent
c97f22ec12
commit
39d8492fb8
|
@ -179,7 +179,7 @@ class DialogDemoState extends State<DialogDemo> {
|
|||
initialTime: _selectedTime!,
|
||||
)
|
||||
.then((TimeOfDay? value) {
|
||||
if (!mounted) {
|
||||
if (!context.mounted) {
|
||||
return;
|
||||
}
|
||||
if (value != null && value != _selectedTime) {
|
||||
|
|
Loading…
Reference in a new issue