flutter_rust_bridge library

Classes

ByteBuffer
A sequence of bytes underlying a typed data object.
ByteData
A fixed-length, random-access sequence of bytes that also provides random and unaligned access to the fixed-width integers and floating point numbers represented by those bytes.
BytesBuilder
Builds a list of bytes, allowing bytes and lists of bytes to be added at the end.
Capability
An unforgeable object that comes back as equal when passed through other isolates.
DartApiDl
Endian
Describes endianness to be used when accessing or updating a sequence of bytes.
FfiException
An exception that is generated by Rust code.
Float32List
A fixed-length list of IEEE 754 single-precision binary floating-point numbers that is viewable as a TypedData.
Float32x4
Float32x4 immutable value type and operations.
Float32x4List
A fixed-length list of Float32x4 numbers that is viewable as a TypedData.
Float64List
A fixed-length list of IEEE 754 double-precision binary floating-point numbers that is viewable as a TypedData.
Float64x2
Float64x2 immutable value type and operations.
Float64x2List
A fixed-length list of Float64x2 numbers that is viewable as a TypedData.
FlutterRustBridgeBase<T extends FlutterRustBridgeWireBase>
Base class for generated bindings of Flutter Rust Bridge. Normally, users do not extend this class manually. Instead, users should directly use the generated class.
FlutterRustBridgeBaseTask
Base class for various kinds of tasks. Note: Normally you do not manually create instances of this task (or its brothers), but instead it is generated automatically by the codegen.
FlutterRustBridgeSyncTask<S, E extends Object>
A task to call FFI function, but it is synchronous.
FlutterRustBridgeTask<S, E extends Object>
A task to call FFI function.
FlutterRustBridgeTaskConstMeta
Metadata that does not change across different method calls. Thus it is made const to save memory and speed up
FlutterRustBridgeTimeoutException
Exception when timeout happens using FlutterRustBridgeTimeoutMixin
FlutterRustBridgeWasmWireBase<T extends WasmModule>
FlutterRustBridgeWireBase
This class, together with its subclasses, are only for internal usage. Usually it should not be used by normal users.
FrbOpaque
An opaque pointer to a native C or Rust type. Recipients of this type should call dispose at least once during runtime. If passed to a native function after being disposed, an exception will be thrown.
FrbOpaqueBase
An opaque pointer to a native C or Rust type. Recipients of this type should call dispose at least once during runtime. If passed to a native function after being disposed, an exception will be thrown.
Int16List
A fixed-length list of 16-bit signed integers that is viewable as a TypedData.
Int32List
A fixed-length list of 32-bit signed integers that is viewable as a TypedData.
Int32x4
Int32x4 and operations.
Int32x4List
A fixed-length list of Int32x4 numbers that is viewable as a TypedData.
Int64List
A strict version of $data.Int64List which always returns a BigInt.
Int8List
A fixed-length list of 8-bit signed integers.
Isolate
An isolated Dart execution context.
JS
Modules
Currently supported modes of module initialization.
RawReceivePort
A low-level asynchronous message receiver.
ReceivePort
Together with SendPort, the only means of communication between isolates.
SendPort
Sends messages to its ReceivePorts.
TransferableTypedData
An efficiently transferable sequence of byte values.
TypedData
A typed view of a sequence of bytes.
Uint16List
A fixed-length list of 16-bit unsigned integers that is viewable as a TypedData.
Uint32List
A fixed-length list of 32-bit unsigned integers that is viewable as a TypedData.
Uint64List
A strict version of $data.Uint64List which always returns a BigInt.
Uint8ClampedList
A fixed-length list of 8-bit unsigned integers.
Uint8List
A fixed-length list of 8-bit unsigned integers.
UnmodifiableByteBufferView
A read-only view of a ByteBuffer.
UnmodifiableByteDataView
A read-only view of a ByteData.
UnmodifiableFloat32ListView
View of a Float32List that disallows modification.
UnmodifiableFloat32x4ListView
View of a Float32x4List that disallows modification.
UnmodifiableFloat64ListView
View of a Float64List that disallows modification.
UnmodifiableFloat64x2ListView
View of a Float64x2List that disallows modification.
UnmodifiableInt16ListView
View of a Int16List that disallows modification.
UnmodifiableInt32ListView
View of a Int32List that disallows modification.
UnmodifiableInt32x4ListView
View of a Int32x4List that disallows modification.
UnmodifiableInt64ListView
View of a Int64List that disallows modification.
UnmodifiableInt8ListView
View of a Int8List that disallows modification.
UnmodifiableUint16ListView
View of a Uint16List that disallows modification.
UnmodifiableUint32ListView
View of a Uint32List that disallows modification.
UnmodifiableUint64ListView
View of a Uint64List that disallows modification.
UnmodifiableUint8ClampedListView
View of a Uint8ClampedList that disallows modification.
UnmodifiableUint8ListView
View of a Uint8List that disallows modification.
WasmModule
A JS function that returns a Promise to a WASM module. See this file for an example of how to obtain and initialize this type.

Mixins

FlutterRustBridgeSetupMixin<T extends FlutterRustBridgeWireBase>
Allow custom setup hooks before ffi can be executed. All other ffi calls will wait (async) until the setup ffi finishes.
FlutterRustBridgeTimeoutMixin<T extends FlutterRustBridgeWireBase>
Add a timeout to executeNormal

Constants

anonymous → const _Anonymous
kIsWeb → const bool
borrowed from flutter foundation kIsWeb, but allows for using it in a Dart context alike
syncReturnPointerLength → const int
Rust SyncReturn
uuidSizeInBytes → const int

Properties

crossOriginIsolated bool?
Whether the web platform has been isolated by COOP and COEP headers, and is capable of sharing buffers between workers.
no setter

Functions

api2wireConcatenateBytes(List<UuidValue> raw) Uint8List
broadcastPort(String portName) ReceivePort
castInt(Object? value) int
castNativeBigInt(int value) Object
Only used on the Web.
eval(String script) → dynamic
loadLibForDart(String path) DynamicLibrary
loadLibForFlutter(String path) DynamicLibrary
agnostic dynamic library loading on native platforms
mapNonNull<T, I>(List<I?> items, T mapper(I)) List<T?>
wire2apiDuration(int ts) Duration
wire2apiPanicError(dynamic raw) PanicException
wire2apiTimestamp({required int ts, required bool isUtc}) DateTime
wire2apiUuids(Uint8List raw) List<UuidValue>
wireSyncReturnIntoDart(WireSyncReturn syncReturn) List
Generates the dynamic Dart object from either an FFI struct or a JS value

Typedefs

DropFnType = void Function(PlatformPointer)
ExternalLibrary = DynamicLibrary
NativePortType = int
Abstraction over a Dart SendPort and a JS MessagePort.
OpaqueTypeFinalizer = NativeFinalizer
PlatformPointer = Pointer<Void>
ShareFnType = PlatformPointer Function(PlatformPointer)
WireSyncReturn = Pointer<Dart_CObject>

Exceptions / Errors

FrbAnyhowException
FrbBacktracedException
FrbException
IsolateSpawnException
Thrown when an isolate cannot be created.
MissingHeaderException
Thrown when the browser is not run in a cross-origin isolated environment.
PanicException
PlatformMismatchException
RemoteError
Description of an error from another isolate.
UnmodifiableTypedListException