2d-inc / HistoryOfEverything

Flutter Launch Timeline Demo
https://medium.com/2dimensions/the-history-of-everything-981d989e1b45
MIT License
6.49k stars 984 forks source link

Crash on some article #80

Open dbof10 opened 4 years ago

dbof10 commented 4 years ago

On some article, it crashes I'm using environment below

flare_flutter: ^2.0.4 nima: ^1.0.5

The getter 'dirtMask' was called on null.
I/flutter ( 3789): Receiver: null
I/flutter ( 3789): Tried calling: dirtMask

The relevant error-causing widget was:
I/flutter ( 3789):   Container file://**/lib/article/article_widget.dart:165:40
I/flutter ( 3789): 
I/flutter ( 3789): When the exception was thrown, this was the stack:
I/flutter ( 3789): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
I/flutter ( 3789): #1      ActorArtboard.advance (package:flare_dart/actor_artboard.dart:322:29)
I/flutter ( 3789): #2      VignetteRenderObject.updateActor (package:timeline/article/timeline_entry_widget.dart:111:21)
I/flutter ( 3789): #3      VignetteRenderObject.timelineEntry= (package:timeline/article/timeline_entry_widget.dart:140:5)
I/flutter ( 3789): #4      TimelineEntryWidget.createRenderObject (package:timeline/article/timeline_entry_widget.dart:40:9)
I/flutter ( 3789): #5      RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5366:28)

ActorArtboard

 ActorComponent component = _dependencyOrder[i];
          _dirtDepth = i;
          int d = component.dirtMask;
Ajayvirmoti commented 1 year ago

It may help.

The error says you're trying to use something called "dirtMask," but it's empty (null). To fix it:

  1. Check the code where you use "dirtMask" (in "article_widget.dart").
  2. Make sure it's created correctly and handle null safely (use ?.).
  3. Follow how data flows in your app to find where it becomes null.
  4. Use debugging tools to track the issue down.