Add some more new lints (#91659)

This commit is contained in:
Ian Hickson
2021-10-12 11:33:04 -07:00
committed by GitHub
parent bb5cbdc635
commit 66dd2add7e
5 changed files with 20 additions and 2 deletions

View File

@@ -181,8 +181,14 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
// This test only runs on Android so we can assume path separator is '/'.
final File file = File('${outDir?.path}/$kEventsFileName');
await file.writeAsBytes(data.buffer.asUint8List(0, data.lengthInBytes), flush: true);
if (!mounted) {
return;
}
showMessage(context, 'Saved original events to ${file.path}');
} catch (e) {
if (!mounted) {
return;
}
showMessage(context, 'Failed saving ${e.toString()}');
}
}

View File

@@ -163,8 +163,14 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
// This test only runs on Android so we can assume path separator is '/'.
final File file = File('${outDir.path}/$kEventsFileName');
await file.writeAsBytes(data.buffer.asUint8List(0, data.lengthInBytes), flush: true);
if (!mounted) {
return;
}
showMessage(context, 'Saved original events to ${file.path}');
} catch (e) {
if (!mounted) {
return;
}
showMessage(context, 'Failed saving ${e.toString()}');
}
}