File tree 3 files changed +7
-7
lines changed
flutter_gallery/lib/gallery 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
175
175
176
176
Future <void > saveRecordedEvents (ByteData data, BuildContext context) async {
177
177
if (await channel.invokeMethod <bool >('getStoragePermission' ) ?? false ) {
178
- if (mounted) {
178
+ if (context. mounted) {
179
179
showMessage (context, 'External storage permissions are required to save events' );
180
180
}
181
181
return ;
@@ -185,12 +185,12 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
185
185
// This test only runs on Android so we can assume path separator is '/'.
186
186
final File file = File ('${outDir ?.path }/$kEventsFileName ' );
187
187
await file.writeAsBytes (data.buffer.asUint8List (0 , data.lengthInBytes), flush: true );
188
- if (! mounted) {
188
+ if (! context. mounted) {
189
189
return ;
190
190
}
191
191
showMessage (context, 'Saved original events to ${file .path }' );
192
192
} catch (e) {
193
- if (! mounted) {
193
+ if (! context. mounted) {
194
194
return ;
195
195
}
196
196
showMessage (context, 'Failed saving $e ' );
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ class _TabbedComponentDemoScaffoldState extends State<TabbedComponentDemoScaffol
80
80
final Uri uri = Uri .parse (url);
81
81
if (await canLaunchUrl (uri)) {
82
82
await launchUrl (uri);
83
- } else if (mounted) {
83
+ } else if (context. mounted) {
84
84
showDialog <void >(
85
85
context: context,
86
86
builder: (BuildContext context) {
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
157
157
158
158
Future <void > saveRecordedEvents (ByteData data, BuildContext context) async {
159
159
if (await channel.invokeMethod <bool >('getStoragePermission' ) != true ) {
160
- if (mounted) {
160
+ if (context. mounted) {
161
161
showMessage (context, 'External storage permissions are required to save events' );
162
162
}
163
163
return ;
@@ -167,12 +167,12 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
167
167
// This test only runs on Android so we can assume path separator is '/'.
168
168
final File file = File ('${outDir .path }/$kEventsFileName ' );
169
169
await file.writeAsBytes (data.buffer.asUint8List (0 , data.lengthInBytes), flush: true );
170
- if (! mounted) {
170
+ if (! context. mounted) {
171
171
return ;
172
172
}
173
173
showMessage (context, 'Saved original events to ${file .path }' );
174
174
} catch (e) {
175
- if (! mounted) {
175
+ if (! context. mounted) {
176
176
return ;
177
177
}
178
178
showMessage (context, 'Failed saving $e ' );
You can’t perform that action at this time.
0 commit comments