diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md index 7dcbda9fbca..1c6589fd637 100644 --- a/pkg/analyzer/tool/diagnostics/diagnostics.md +++ b/pkg/analyzer/tool/diagnostics/diagnostics.md @@ -29271,7 +29271,7 @@ The analyzer produces this diagnostic when a `BuildContext` is referenced by a `StatefulWidget` after an asynchronous gap without first checking the `mounted` property. -Storing a `BuildContext` for later use can lead to difficult to diagnose +Storing a `BuildContext` for later use can lead to difficult-to-diagnose crashes. Asynchronous gaps implicitly store a `BuildContext`, making them easy to overlook for diagnosis. diff --git a/pkg/linter/messages.yaml b/pkg/linter/messages.yaml index 7e7b5b8d58f..f398131c91f 100644 --- a/pkg/linter/messages.yaml +++ b/pkg/linter/messages.yaml @@ -13161,7 +13161,7 @@ LintCode: by a `StatefulWidget` after an asynchronous gap without first checking the `mounted` property. - Storing a `BuildContext` for later use can lead to difficult to diagnose + Storing a `BuildContext` for later use can lead to difficult-to-diagnose crashes. Asynchronous gaps implicitly store a `BuildContext`, making them easy to overlook for diagnosis. @@ -13213,7 +13213,7 @@ LintCode: deprecatedDetails: |- **DON'T** use `BuildContext` across asynchronous gaps. - Storing `BuildContext` for later usage can easily lead to difficult to diagnose + Storing `BuildContext` for later usage can easily lead to difficult-to-diagnose crashes. Asynchronous gaps are implicitly storing `BuildContext` and are some of the easiest to overlook when writing code.