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.

Available extensions

Constructors

File()

Properties

enums List<DataEnum>
Returns a list of DataEnums contained in the file.
no setter
hashCode int
The hash code for this object.
no setterinherited
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, or null if not found.
artboardAt(int index, {bool frameOrigin = true}) Artboard?
Returns the artboard at the given index, or null if out of bounds.
artboardToBind(String name, {ViewModelInstance? viewModelInstance}) BindableArtboard?
Returns a bindable artboard reference for use with data binding.
createDefaultViewModelInstance(Artboard artboard) ViewModelInstance?

Available on File, provided by the RiveFileExtension extension

Creates a default view model instance for the given artboard.
defaultArtboard({bool frameOrigin = true}) Artboard?
Returns the default artboard from this file, or null if 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, or null if out of bounds.
viewModelByName(String name) ViewModel?
Returns the view model with the given name, or null if 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.