Skip to content

Initializing a FlareActor from different sources #16

@sroddy

Description

@sroddy

Right now a FlareActor can be initialized only with a path of a file from the rootBundle.
I think it would be really useful to support a few other loading modes (e.g. network, string, bytes, ...)
I saw that the FlutterActor is the thing that actually is being loaded async. one possibile approach is to have a constructor with the following signature

FlareActor.asyncBytes(Future<Uint8List> Function() loadBytes, {void Function() onCancel});

The onCancel function would be useful in order to abort a potentially long running loading operation (for example from the network) if the render object has been disposed in the meantime.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions