Skip to content

LateInitializationError: Field '_paint@xxxxxx' has not been initialized  #313

@CarGuo

Description

@CarGuo
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Exception: LateInitializationError: Field '_paint@268459774' has not been initialized.
#0      FlutterActorImage._paint (package:flare_flutter/flare.dart)
#1      FlutterActorImage.onBlendModeChanged (package:flare_flutter/flare.dart:505:5)
#2      FlutterActorDrawable.blendMode= (package:flare_flutter/flare.dart:226:5)
#3      FlutterActorDrawable.blendModeId= (package:flare_flutter/flare.dart:234:5)
#4      ActorDrawable.read (package:flare_flutter/base/actor_drawable.dart:77:17)
#5      ActorImage.read (package:flare_flutter/base/actor_image.dart:305:19)
#6      ActorArtboard.readComponentsBlock (package:flare_flutter/base/actor_artboard.dart:387:34)
#7      ActorArtboard.read (package:flare_flutter/base/actor_artboard.dart:349:11)

In onBlendModeChanged Function, _paint never initialized when ActorDrawable read -> set blendModeId ,but _paint sound late ui.Paint

  @override
  void onBlendModeChanged(ui.BlendMode mode) {
     _paint.blendMode = mode;
    onPaintUpdated(_paint);
  }

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions