bug弹动画扑

时间:2019-12-22 08:12:35

标签: flutter flare

我的Flare软件包存在错误。

我有一个包含3页的标签栏,

第一个标签,我叠加了3个耀斑动画。特殊性:对于每个initState,我都使用sharedpref加载资产名称以显示保存的动画。 第二和第三个标签没什么特别的

当我将选项卡1到2和2到1 x Time滑动时,有时我仅对于此堆栈耀斑动画崩溃,而对于其他动画则没有崩溃。

我在tab1的初始位置加载了先前保存的资产名称:

asset_name_animation = prefs.getString('item' ) ?? "fond_vide";  

我显示已加载的资产名称:

new Container (
  width:400,
  height: 400,
  child: new FlareActor("assets/$asset_name_animation.flr", 
    alignment:Alignment.bottomCenter, 
    fit:BoxFit.contain,  
    animation: "Untitled"
  )
),

这是错误日志:

E/flutter ( 9171): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Unable to load asset: assets/null.flr
E/flutter ( 9171): #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
E/flutter ( 9171): <asynchronous suspension>
E/flutter ( 9171): #1      FlareCacheAsset.load (package:flare_flutter/flare_cache_asset.dart:31:20)
E/flutter ( 9171): #2      Cache.getAsset (package:flare_flutter/cache.dart:56:15)
E/flutter ( 9171): <asynchronous suspension>
E/flutter ( 9171): #3      cachedActor (package:flare_flutter/flare_cache.dart:35:16)
E/flutter ( 9171): <asynchronous suspension>
E/flutter ( 9171): #4      FlareRenderBox.loadFlare (package:flare_flutter/flare_render_box.dart:322:35)
E/flutter ( 9171): <asynchronous suspension>
E/flutter ( 9171): #5      FlareActorRenderObject.coldLoad (package:flare_flutter/flare_actor.dart:321:20)
E/flutter ( 9171): <asynchronous suspension>
E/flutter ( 9171): #6      FlareRenderBox.load (package:flare_flutter/flare_render_box.dart:272:7)
E/flutter ( 9171): #7      FlareRenderBox.attach (package:flare_flutter/flare_render_box.dart:115:7)
E/flutter ( 9171): #8      AbstractNode.adoptChild (package:flutter/src/foundation/node.dart:132:13)
E/flutter ( 9171): #9      RenderObject.adoptChild (package:flutter/src/rendering/object.dart:1153:11)
E/flutter ( 9171): #10     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin.child= (package:flutter/src/rendering/object.dart:2772:7)
E/flutter ( 9171): #11     SingleChildRenderObjectElement.insertChildRenderObject (package:flutter/src/widgets/framework.dart:5107:18)
E/flutter ( 9171): #12     RenderObjectElement.attachRenderObject (package:flutter/src/widgets/framework.dart:4951:35)
E/flutter ( 9171): #13     RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4717:5)
E/flutter ( 9171): #14     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #15     Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
E/flutter ( 9171): #16     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5092:14)
E/flutter ( 9171): #17     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #18     Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
E/flutter ( 9171): #19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3935:16)
E/flutter ( 9171): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)
E/flutter ( 9171): #21     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3907:5)
E/flutter ( 9171): #22     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
E/flutter ( 9171): #23     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #24     Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
E/flutter ( 9171): #25     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5092:14)
E/flutter ( 9171): #26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #27     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5198:32)
E/flutter ( 9171): #28     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #29     Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
E/flutter ( 9171): #30     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3935:16)
E/flutter ( 9171): #31     Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)
E/flutter ( 9171): #32     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3907:5)
E/flutter ( 9171): #33     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
E/flutter ( 9171): #34     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #35     Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
E/flutter ( 9171): #36     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5092:14)
E/flutter ( 9171): #37     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
E/flutter ( 9171): #38     Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
E/flutter ( 9171): #39     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3935:16)
E/flutter ( 9171): #40     Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)
E/flutter ( 9171): #41     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3907:5)
E/flutter ( 9171): #42     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
E/flutter ( 9171): #43     ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4279:11)
E/flutter ( 9171): #44     Element.inflateWidget (pac

我有另一个重复发生的崩溃并有相同的动画问题:每次启动路线时,总是=>后退=>幻灯片选项卡2 =>幻灯片选项卡1,我遇到此错误和动画崩溃。

E/flutter ( 9171): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
E/flutter ( 9171): At this point the state of the widget's element tree is no longer stable.
E/flutter ( 9171): To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.
E/flutter ( 9171): #0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure> (package:flutter/src/widgets/framework.dart:3389:9)
E/flutter ( 9171): #1      Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:3403:6)
E/flutter ( 9171): #2      Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3418:12)
E/flutter ( 9171): #3      TickerMode.of (package:flutter/src/widgets/ticker_provider.dart:52:39)
E/flutter ( 9171): #4      _analyse2State&State&WidgetsBindingObserver&TickerProviderStateMixin.didChangeDependencies (package:flutter/src/widgets/ticker_provider.dart:197:36)
E/flutter ( 9171): #5      analyse2State.didChangeDependencies (package:ouiquit_app/tableau_de_bord.dart:5533:11)
E/flutter ( 9171): #6      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
E/flutter ( 9171): #7      _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter ( 9171): #8      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 9171): #9      _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
E/flutter ( 9171): #10     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
E/flutter ( 9171): #11     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
E/flutter ( 9171): #12     Future._complete (dart:async/future_impl.dart:473:7)
E/flutter ( 9171): #13     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
E/flutter ( 9171): #14     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async-patch/async_patch.dart:33:20)
E/flutter ( 9171): #15     _rootRun (dart:async/zone.dart:1120:38)
E/flutter ( 9171): #16     _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter ( 9171): #17     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter ( 9171): #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter ( 9171): #19     _rootRun (dart:async/zone.dart:1124:13)
E/flutter ( 9171): #20     _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter ( 9171): #21     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter ( 9171): #22     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter ( 9171): #23     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 9171): #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
E/flutter ( 9171): 

1 个答案:

答案 0 :(得分:0)

即使我遇到此错误,但几秒钟后动画仍然生效 而且完全没有滞后 尝试做flutter clean