Skip to content

[0.14.0] Stateless Widget #504

@MichalNemec

Description

@MichalNemec

Description

Why fileLoader is not disposed by default or with bool property? Right now when we use rive file, we need to have stateful widget to dispose FileLoader.

Expected behavior

An option to use stateful widget, but also stateless widget for simple rives.

Device & Versions (please complete the following information)

  • Device: Android Emulator
  • OS: Android SDK API Level 31
  • Flutter Version:
Flutter 3.32.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5c1433509f (7 weeks ago) • 2025-06-11 13:12:24 -0700
Engine • revision 31c4875c7a (8 weeks ago) • 2025-06-05 08:39:10 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1

Additional context

RiveWidgetBuilder(
        fileLoader: FileLoader.fromAsset('file.riv', riveFactory: rive.Factory.rive),
        disposeLoader: true, // <-- Something like this
        dataBind: const AutoBind(),
        onLoaded: _handleRiveLoaded,
        builder: (context, state) => switch (state) {
          RiveLoading() => const CircularProgressIndicator(),
          RiveFailed() => Text('Failed to load: ${state.error}'),
          RiveLoaded() => RiveWidget(controller: state.controller, fit: Fit.cover),
        },
      ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions