rhymelph / r_scan

📷🖨Flutter二维码&条形码扫描插件,支持相机、文件、链接、Uint8List类型扫描
https://juejin.im/post/5dd8efb1e51d452314438515
BSD 3-Clause "New" or "Revised" License
119 stars 79 forks source link

Unhandled Exception: type 'Future<List<Map<dynamic, dynamic>>?>' is not a subtype of type 'Future<List<Map<dynamic, dynamic>>>' in type cast #57

Open git-boya opened 3 years ago

git-boya commented 3 years ago

调用availableRScanCameras()时报错

E/flutter (23097): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Future<List<Map<dynamic, dynamic>>?>' is not a subtype of type 'Future<List<Map<dynamic, dynamic>>>' in type cast
E/flutter (23097): #0      availableRScanCameras (package:r_scan/src/r_scan_camera.dart:17:9)
E/flutter (23097): #1      _MyAppState.initState (package:flutter_cloud/main.dart:137:5)
E/flutter (23097): #2      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4805:57)
E/flutter (23097): #3      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4638:5)
E/flutter (23097): #4      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3673:14)
E/flutter (23097): #5      Element.updateChild (package:flutter/src/widgets/framework.dart:3425:18)
E/flutter (23097): #6      RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1198:16)
E/flutter (23097): #7      RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1167:5)
E/flutter (23097): #8      RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1112:18)
E/flutter (23097): #9      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2573:19)
E/flutter (23097): #10     RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1111:13)
E/flutter (23097): #11     WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:944:7)
E/flutter (23097): #12     WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:924:7)
E/flutter (23097): #13     _rootRun (dart:async/zone.dart:1420:47)
E/flutter (23097): #14     _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter (23097): #15     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
E/flutter (23097): #16     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
E/flutter (23097): #17     _rootRun (dart:async/zone.dart:1428:13)
E/flutter (23097): #18     _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter (23097): #19     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1260:23)
E/flutter (23097): #20     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter (23097): #21     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
E/flutter (23097): #22     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
E/flutter (23097): #23     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
E/flutter (23097): 
wszdhxh commented 3 years ago

我也有这个问题, 请问怎么解决呢?

git-boya commented 3 years ago

我也有这个问题, 请问怎么解决呢?

我换别的插件了flutter_scankit 也很多坑

antoniopetricc commented 3 years ago

how can i solve?

devs4522 commented 3 years ago

Has anyone solve this issue ?

gogogoboom commented 2 years ago

This error should be caused by file identification failure, check the file path and whether the file exists

Herryjoeson commented 2 years ago

https://github.com/Herryjoeson/r_scan.git i fix this problem in my project,every things is ok