Flutter Web在调用main之前崩溃- Dart 3

zbwhf8kr  于 2023-05-19  发布在  Flutter
关注(0)|答案(1)|浏览(168)

升级到dart 3后,我在尝试运行时总是得到这个模糊的错误。有什么办法摆脱这一切吗?
我尝试在主文件的开头打印,但它不显示该行。我的index.html很简单

errors.dart:288 Uncaught (in promise) Error: Unexpected null value.
    at Object.throw_ [as throw] (errors.dart:288:49)
    at Object.nullCheck (operations.dart:606:63)
    at binding$5.WidgetsFlutterBinding.new.createViewConfiguration (binding.dart:303:61)
    at binding$5.WidgetsFlutterBinding.new.initRenderView (binding.dart:215:44)
    at binding$5.WidgetsFlutterBinding.new.initInstances (binding.dart:41:5)
    at binding$5.WidgetsFlutterBinding.new.initInstances (binding.dart:263:11)
    at binding.BindingBase.new (binding.dart:151:5)
    at BindingBase_GestureBinding$36$.new (binding.dart:1189:37)
    at BindingBase_SchedulerBinding$36$.new (binding.dart:1189:37)
    at BindingBase_ServicesBinding$36$.new (binding.dart:1189:37)
    at BindingBase_PaintingBinding$36$.new (binding.dart:1189:37)
    at BindingBase_SemanticsBinding$36$.new (binding.dart:1189:37)
    at BindingBase_RendererBinding$36$.new (binding.dart:1189:37)
    at BindingBase_WidgetsBinding$36.new (binding.dart:1189:37)
    at new binding$5.WidgetsFlutterBinding.new (binding.dart:1309:3)
    at WidgetsFlutterBinding.ensureInitialized (binding.dart:1306:7)
    at FlutterImageCompressWeb.registerWith (flutter_image_compress_web.dart:14:27)
    at Object.registerPlugins (web_plugin_registrant.dart:53:27)
    at web_entrypoint.dart:27:24
    at Object._checkAndCall (operations.dart:367:37)
    at Object.dcall (operations.dart:372:39)
    at initialization.dart:73:24
    at Generator.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at _engine.AppBootstrap.new.<anonymous> (initialization.dart:71:16)
    at Object._checkAndCall (operations.dart:367:37)
    at Object.callMethod (operations.dart:431:10)
    at Object.dsend (operations.dart:435:5)
    at _engine.AppBootstrap.new.autoStart (app_bootstrap.dart:31:18)
    at autoStart.next (<anonymous>)
    at async_patch.dart:45:50
    at _RootZone.runUnary (zone.dart:1661:54)
    at _FutureListener.thenAwait.handleValue (future_impl.dart:147:18)
    at handleValueCallback (future_impl.dart:784:44)
    at _Future._propagateToListeners (future_impl.dart:813:13)
    at [_completeWithValue] (future_impl.dart:584:5)
    at future.dart:531:22
    at _RootZone.runUnary (zone.dart:1661:54)
    at _FutureListener.then.handleValue (future_impl.dart:147:18)
    at handleValueCallback (future_impl.dart:784:44)
    at _Future._propagateToListeners (future_impl.dart:813:13)
    at [_completeWithValue] (future_impl.dart:584:5)
    at future.dart:531:22
    at _RootZone.runUnary (zone.dart:1661:54)
    at _FutureListener.then.handleValue (future_impl.dart:147:18)
    at handleValueCallback (future_impl.dart:784:44)
    at _Future._propagateToListeners (future_impl.dart:813:13)
    at [_completeWithValue] (future_impl.dart:584:5)
    at async._AsyncCallbackEntry.new.callback (future_impl.dart:657:7)
    at Object._microtaskLoop (schedule_microtask.dart:40:11)
    at _startMicrotaskLoop (schedule_microtask.dart:49:5)
    at async_patch.dart:177:15
ctehm74n

ctehm74n1#

您需要使用最新版本的flutter_image_compress库,即2.0.3。此版本应与Flutter 3.10.0兼容。

相关问题