由于我在主函数中覆盖了ErrorWidget.builder,因此不断收到此错误。我只看到我导航到特定窗口小部件的异常(最初不是。我在页面上停留了几分钟,这开始逐渐在控制台中自动打印并保持打印。一旦此错误出现在控制台上,我每次都会看到此错误点击某物package:flutter/src/widgets/navigator.dart': Failed assertion: line 1748 pos 12: '!_debugLocked': is not true.
)。我面临的问题是,由于原因我不知道在哪里查找..今天突然出现了,我也没有调试的线索。
E/flutter (25849): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'round' was called on null.
E/flutter (25849): Receiver: null
E/flutter (25849): Tried calling: round()
E/flutter (25849): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter (25849): #1 PageController.nextPage (package:flutter/src/widgets/page_view.dart:227:31)
E/flutter (25849): #2 _CarouselSliderState.getTimer.<anonymous closure> (package:carousel_slider/carousel_slider.dart:172:14)
E/flutter (25849): #3 _rootRunUnary (dart:async/zone.dart:1192:38)
E/flutter (25849): #4 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (25849): #5 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (25849): #6 _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1024:26)
E/flutter (25849): #7 _rootRunUnary (dart:async/zone.dart:1196:13)
E/flutter (25849): #8 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (25849): #9 _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1008:26)
E/flutter (25849): #10 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (25849): #11 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (25849): #12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter (25849):
答案 0 :(得分:0)
如果您使用 carousel_pro。它来自插件src。 尝试更新
if ((_controller.page!=null) && (_controller.page.round() == widget.images.length - 1)) {
我已经创建了对源的拉取请求。希望能更新。
干杯