File class abstract
A loaded Rive file containing artboards, animations, and view models.
Use the static methods File.asset, File.url, File.path, or File.decode to load a Rive file.
Constructors
- File()
Properties
-
enums
→ List<
DataEnum> -
Returns a list of DataEnums contained in the file.
no setter
-
globalViewModelNames
→ List<
String> -
The names of the file's global view models, in file order.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- riveFactory → Factory
-
The factory this file's resources were made with. Under deferred
rendering (the default) that is the render context's own recording
session, which every file it decodes and every artboard instanced from
them shares, so Artboard.riveFactory reports the same one. Web is the
exception: its render contexts are per canvas, so a file there owns a
session of its own.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- viewModelCount → int
-
The number of view models in the Rive file
no setter
Methods
-
artboard(
String name, {bool frameOrigin = true}) → Artboard? -
Returns the artboard with the given
name, ornullif not found. -
artboardAt(
int index, {bool frameOrigin = true}) → Artboard? -
Returns the artboard at the given
index, ornullif out of bounds. -
artboardToBind(
String name, {ViewModelInstance? viewModelInstance}) → BindableArtboard? - Returns a bindable artboard reference for use with data binding.
-
defaultArtboard(
{bool frameOrigin = true}) → Artboard? -
Returns the default artboard from this file, or
nullif none exists. -
defaultArtboardViewModel(
Artboard artboard) → ViewModel? -
Returns the default view model for the given
artboard. -
dispose(
) → void - Releases all resources associated with this file.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
viewModelByIndex(
int index) → ViewModel? -
Returns the view model at
index, ornullif out of bounds. -
viewModelByName(
String name) → ViewModel? -
Returns the view model with the given
name, ornullif not found.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
asset(
String bundleKey, {required Factory riveFactory, AssetBundle? bundle, AssetLoaderCallback? assetLoader}) → Future< File?> - Loads a Rive file from a Flutter asset bundle.
-
decode(
Uint8List bytes, {required Factory riveFactory, AssetLoaderCallback? assetLoader, LuauState? vm}) → Future< File?> -
Decodes a Rive file from raw
bytes. -
path(
String path, {required Factory riveFactory, AssetLoaderCallback? assetLoader}) → Future< File?> -
Loads a Rive file from a local file system
path. -
url(
String url, {required Factory riveFactory, Map< String, String> ? headers, AssetLoaderCallback? assetLoader}) → Future<File?> -
Loads a Rive file from a network
url.