File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
flutter_gallery/lib/gallery Expand file tree Collapse file tree 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> {
175175
176176 Future <void > saveRecordedEvents (ByteData data, BuildContext context) async {
177177 if (await channel.invokeMethod <bool >('getStoragePermission' ) ?? false ) {
178- if (mounted) {
178+ if (context. mounted) {
179179 showMessage (context, 'External storage permissions are required to save events' );
180180 }
181181 return ;
@@ -185,12 +185,12 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
185185 // This test only runs on Android so we can assume path separator is '/'.
186186 final File file = File ('${outDir ?.path }/$kEventsFileName ' );
187187 await file.writeAsBytes (data.buffer.asUint8List (0 , data.lengthInBytes), flush: true );
188- if (! mounted) {
188+ if (! context. mounted) {
189189 return ;
190190 }
191191 showMessage (context, 'Saved original events to ${file .path }' );
192192 } catch (e) {
193- if (! mounted) {
193+ if (! context. mounted) {
194194 return ;
195195 }
196196 showMessage (context, 'Failed saving $e ' );
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ class _TabbedComponentDemoScaffoldState extends State<TabbedComponentDemoScaffol
8080 final Uri uri = Uri .parse (url);
8181 if (await canLaunchUrl (uri)) {
8282 await launchUrl (uri);
83- } else if (mounted) {
83+ } else if (context. mounted) {
8484 showDialog <void >(
8585 context: context,
8686 builder: (BuildContext context) {
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
157157
158158 Future <void > saveRecordedEvents (ByteData data, BuildContext context) async {
159159 if (await channel.invokeMethod <bool >('getStoragePermission' ) != true ) {
160- if (mounted) {
160+ if (context. mounted) {
161161 showMessage (context, 'External storage permissions are required to save events' );
162162 }
163163 return ;
@@ -167,12 +167,12 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
167167 // This test only runs on Android so we can assume path separator is '/'.
168168 final File file = File ('${outDir .path }/$kEventsFileName ' );
169169 await file.writeAsBytes (data.buffer.asUint8List (0 , data.lengthInBytes), flush: true );
170- if (! mounted) {
170+ if (! context. mounted) {
171171 return ;
172172 }
173173 showMessage (context, 'Saved original events to ${file .path }' );
174174 } catch (e) {
175- if (! mounted) {
175+ if (! context. mounted) {
176176 return ;
177177 }
178178 showMessage (context, 'Failed saving $e ' );
You can’t perform that action at this time.
0 commit comments