Skip to content

Commit

Permalink
fix upcomming diagnostics after updates on use_build_context_synchron…
Browse files Browse the repository at this point in the history
…ously (#106057)
  • Loading branch information
a14n authored Jun 15, 2022
1 parent e55aa0e commit 504a2ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 504a2ca

Please sign in to comment.