@@ -170,7 +170,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
170170 if (! isOnPress) return ;
171171 isOnPress = false ;
172172 if (_timing < 2 ) {
173- showToast (context, '录制时间过短' );
173+ showToast ( '录制时间过短' );
174174 stopVideoRecording ();
175175 if (_timer != null ) {
176176 _timer.cancel ();
@@ -351,7 +351,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
351351 controller.addListener (() {
352352 if (mounted) setState (() {});
353353 if (controller.value.hasError) {
354- showToast (context, 'Camera error ${controller .value .errorDescription }' );
354+ showToast ( 'Camera error ${controller .value .errorDescription }' );
355355 }
356356 });
357357
@@ -374,42 +374,42 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
374374 videoController? .dispose ();
375375 videoController = null ;
376376 });
377- if (filePath != null ) showToast (context, '图片保存到$filePath ' );
377+ if (filePath != null ) showToast ( '图片保存到$filePath ' );
378378 }
379379 });
380380 }
381381
382382 void onVideoRecordButtonPressed () {
383383 startVideoRecording ().then ((String filePath) {
384384 if (mounted) setState (() {});
385- if (filePath != null ) showToast (context, '开始录制' );
385+ if (filePath != null ) showToast ( '开始录制' );
386386 });
387387 }
388388
389389 void onStopButtonPressed () {
390390 stopVideoRecording ().then ((_) {
391391 if (mounted) setState (() {});
392- showToast (context, '视频记录到$videoPath ' );
392+ showToast ( '视频记录到$videoPath ' );
393393 });
394394 }
395395
396396 void onPauseButtonPressed () {
397397 pauseVideoRecording ().then ((_) {
398398 if (mounted) setState (() {});
399- showToast (context, '录制视频暂停' );
399+ showToast ( '录制视频暂停' );
400400 });
401401 }
402402
403403 void onResumeButtonPressed () {
404404 resumeVideoRecording ().then ((_) {
405405 if (mounted) setState (() {});
406- showToast (context, '录制视频恢复' );
406+ showToast ( '录制视频恢复' );
407407 });
408408 }
409409
410410 Future <String > startVideoRecording () async {
411411 if (! controller.value.isInitialized) {
412- showToast (context, '异常: 首先选择一个相机' );
412+ showToast ( '异常: 首先选择一个相机' );
413413 return null ;
414414 }
415415
@@ -499,7 +499,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
499499
500500 Future <String > takePicture () async {
501501 if (! controller.value.isInitialized) {
502- showToast (context, '异常: 首先选择一个相机' );
502+ showToast ( '异常: 首先选择一个相机' );
503503 return null ;
504504 }
505505 final Directory extDir = await getApplicationDocumentsDirectory ();
@@ -523,7 +523,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
523523
524524 void _showCameraException (CameraException e) {
525525 logError (e.code, e.description);
526- showToast (context, 'Error: ${e .code }\n ${e .description }' );
526+ showToast ( 'Error: ${e .code }\n ${e .description }' );
527527 }
528528
529529 @override
0 commit comments