fix upcomming diagnostics after updates on use_build_context_synchronously (#106057)

This commit is contained in:
Alexandre Ardhuin 2022-06-15 22:46:06 +02:00 committed by GitHub
parent e55aa0e85c
commit 504a2ca6b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -172,8 +172,9 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
Future<void> saveRecordedEvents(ByteData data, BuildContext context) async {
if (await channel.invokeMethod<bool>('getStoragePermission') ?? false) {
showMessage(
context, 'External storage permissions are required to save events');
if (mounted) {
showMessage(context, 'External storage permissions are required to save events');
}
return;
}
try {

View File

@ -154,8 +154,9 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
Future<void> saveRecordedEvents(ByteData data, BuildContext context) async {
if (await channel.invokeMethod<bool>('getStoragePermission') != true) {
showMessage(
context, 'External storage permissions are required to save events');
if (mounted) {
showMessage(context, 'External storage permissions are required to save events');
}
return;
}
try {