Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key flare actor #243

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions flare_flutter/lib/flare_actor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class FlareActor extends LeafRenderObjectWidget {

const FlareActor(
this.filename, {
Key key,
this.boundsNode,
this.animation,
this.fit = BoxFit.contain,
Expand All @@ -86,10 +87,12 @@ class FlareActor extends LeafRenderObjectWidget {
this.shouldClip = true,
this.sizeFromArtboard = false,
this.artboard,
}) : flareProvider = null;
}) : flareProvider = null,
super(key: key);

FlareActor.rootBundle(
String name, {
Key key,
this.boundsNode,
this.animation,
this.fit = BoxFit.contain,
Expand All @@ -103,10 +106,12 @@ class FlareActor extends LeafRenderObjectWidget {
this.sizeFromArtboard = false,
this.artboard,
}) : filename = null,
flareProvider = AssetFlare(bundle: rootBundle, name: name);
flareProvider = AssetFlare(bundle: rootBundle, name: name),
super(key: key);

const FlareActor.asset(
this.flareProvider, {
Key key,
this.boundsNode,
this.animation,
this.fit = BoxFit.contain,
Expand All @@ -119,7 +124,8 @@ class FlareActor extends LeafRenderObjectWidget {
this.shouldClip = true,
this.sizeFromArtboard = false,
this.artboard,
}) : filename = null;
}) : filename = null,
super(key: key);

@override
RenderObject createRenderObject(BuildContext context) {
Expand Down