Load and get full control of your Rive files in a Flutter project using this library.

Overview
⚠️ Please migrate to the new Rive Flutter runtime. This runtime is for the old Rive (formerly Flare) and will only receive updates for breaking issues with Flutter and egregious bugs. New features and updates are only planned for the new Rive.

Rive 1 (previously Flare)

Rive 1 (previously Flare) offers powerful realtime vector design and animation for app and game designers alike. The primary goal of Flare is to allow designers to work directly with assets that run in their final product, eliminating the need to redo that work in code.

Null Safety

Preview of null safety is now available on pub.dev with version 3.0.0. Include it in your pubspec via:

  dependencies:
    flare_flutter: ^3.0.0-nullsafety.0

Packages

There used to be two Dart packages provided in this repository. flare_dart is no longer maintained as a separate package, it has now been rolled into flare_flutter. Please use only flare_flutter going forward.

Examples

Take a look at the provided example applications.

Please note that only the simple, change_color, and teddy have been updated to null safety.

License

See the LICENSE file for license rights and limitations (MIT).

Comments
  • Infinite rendering object size and a way to know its actual native size

    Infinite rendering object size and a way to know its actual native size

    I've been playing and struggling with flare component for a while.

    I am not sure how the size in artboard works. I thought the size in artboard would matter since it has fit property along. But some how but it didn't seem it does. So I am a bit confused how fit property in the actor actually works. It seems like Flareactor is regarded as flexible widget without any dimension even though it knows the size of artboard.

    1. Is it true?

    For example, if I put the flareactor in Fittebox, then it gets infinite size unless the FlareActor was contained in a container with BOTH width and height defined. If I want to use flare's native size( i.e., artboard size) to go with less scaling process, then I have to build at least once to know its artboard size. 2) Is there a correct way to do that other than building once?

    opened by yjoo9317 17
  • Flare is not exporting correctly in Flutter

    Flare is not exporting correctly in Flutter

    Hello.

    firstly, this is the flare file https://www.2dimensions.com/a/uggy/files/flare/burgersplash-2/preview secondly, there is a circle there that for some reason does not show in the preview. and when I export it, and put it in flutter, only two of all objects are shown (the bottom bun, and the top closed bun).

    FYI, in the flutter app, it used to work a week ago. perhaps there was an update of some sort?

    this is the code that I have been using:

    ` import 'package:flare_flutter/flare_actor.dart';

    FlareActor("assets/BurgerSplash 2.flr", animation: "new_splash", color: Colors.white, fit: BoxFit.contain, alignment: Alignment.center),`

    opened by uggyk 16
  • Error: The argument type 'Null Function(FlutterActor)' can't be assigned to the parameter type 'FutureOr<dynamic> Function(Future<FlutterActor>)'

    Error: The argument type 'Null Function(FlutterActor)' can't be assigned to the parameter type 'FutureOr Function(Future)'

    Error launching application.

    Compiler message: file:///.../flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.4.0/lib/flare_cache_asset.dart:20:59: Error: The argument type 'Null Function(FlutterActor)' can't be assigned to the parameter type 'FutureOr Function(Future)'.

    • 'FlutterActor' is from 'package:flare_flutter/flare.dart'
    • 'FutureOr' is from 'dart:async'.
    • 'Future' is from 'dart:async'. Try changing the type of the parameter, or casting the argument to 'FutureOr Function(Future)'. compute(FlutterActor.loadFromByteData, data).then((FlutterActor actor) { ^

    Flutter 1.2.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision 8661d8aecd (10 weeks ago) • 2019-02-14 19:19:53 -0800 Engine • revision 3757390fa4 Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

    opened by and-david 14
  • Flare files randomly lose SVG elements

    Flare files randomly lose SVG elements

    We created Flare files from 2Dimensions Flare tool by first importing SVG files and then exporting as .flr file. Files are loaded using the FlareActor from Flare-Flutter package in our app.

    The issue that we are seeing is that although the files work as expected in first load, on subsequent loading of the same file they randomly lose some of the elements of the SVG file. No exceptions/warnings are thrown that we can use to debug this issue.

    working

    not-working

    Flare Flutter version: ^1.2.3 Flutter version: Flutter 1.2.1 • channel beta • https://github.com/flutter/flutter.git Framework • revision 8661d8aecd (3 weeks ago) • 2019-02-14 19:19:53 -0800 Engine • revision 3757390fa4 Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

    opened by psovit 14
  • 3.0.0 antialiasing no longer working

    3.0.0 antialiasing no longer working

    you can use this app as reproducible https://github.com/nt4f04uNd/flare_blink_bug

    (open in new window to clearly see there's no antialiasing)

    | 2.0.6 | 3.0.0 | | - | - | | 2 0 6 | 3 0 0 |

    flutter doctor -v
    [✓] Flutter (Channel master, 2.1.0-13.0.pre.386, on Microsoft Windows [Version 10.0.19041.867], locale ru-RU)
        • Flutter version 2.1.0-13.0.pre.386 at c:\dev\src\flutter
        • Framework revision 66af44c9fe (54 minutes ago), 2021-04-01 10:22:37 -0700
        • Engine revision 9651d11fe8
        • Dart version 2.13.0 (build 2.13.0-190.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at C:\Users\danya\AppData\Local\Android\sdk
        • Platform android-30, build-tools 30.0.2
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
        • Visual Studio Community 2019 version 16.7.30621.155
        • Windows 10 SDK version 10.0.19041.0
    
    [✓] Android Studio (version 4.0)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin version 50.0.1
        • Dart plugin version 193.7547
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    
    [✓] IntelliJ IDEA Community Edition (version 2020.3)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
    
    [✓] VS Code (version 1.55.0)
        • VS Code at C:\Users\danya\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.21.0
    
    [✓] Connected device (3 available)
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19041.867]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 89.0.4389.90
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 89.0.774.63
    
    • No issues found!
    
    opened by nt4f04uNd 13
  • FlareControls never initializes in unit test & FlareActor never displays

    FlareControls never initializes in unit test & FlareActor never displays

    import 'dart:async';
    
    import 'package:flare_flutter/flare_actor.dart';
    import 'package:flare_flutter/flare_controls.dart';
    import 'package:flutter/material.dart';
    import 'package:flutter_test/flutter_test.dart';
    
    class DemoControls extends FlareControls {
      Completer completer;
      DemoControls(this.completer);
    
      @override
      void initialize(artboard) {
        super.initialize(artboard);
        print('initialized');
        completer.complete();
      }
    }
    
    void main() {
      Completer completer;
      setUp(() {
        completer = Completer();
      });
    
      testWidgets('Flare initialize failure', (tester) async {
        await tester.pumpWidget(MaterialApp(
          debugShowCheckedModeBanner: false,
          home: Scaffold(
            backgroundColor: Colors.transparent,
            body: Container(
              width: 500,
              height: 500,
              child: FlareActor(
                'assets/something.flr',
                alignment: Alignment.center,
                fit: BoxFit.contain,
                controller: DemoControls(completer),
              ),
            ),
          ),
        ));
        print('created');
        for (int i = 0; i < 100; i++) {
          await tester.pump();
        }
        print('pumped');
        for (int i = 0; i < 100; i++) {
          await tester.pump(Duration(milliseconds: 100));
        }
        print('time-pumped');
    
        // With the following line uncommented the test blocks forever.
        // await completer.future;
    
        // This is blank, of course, because the actor is not initialized.
        await expectLater(find.byType(Scaffold).first,
            matchesGoldenFile('some_golden_file'));
        print('golden-checked');
    
        // I did have one example where you could await completer.future here
        // and it would work, but in this example it still blocks forever.
        print('done');
    
        // Even without blocking, the test fails like:
        // Test Flare initialize failure failed: ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
        // The following assertion was thrown running a test:
        // A Timer is still pending even after the widget tree was disposed.
      });
    }
    
    // The order of the output from the test is:
    // created
    // pumped
    // time-pumped
    // [some golden file comparison output]
    // golden-checked
    // done
    // initialized  *** this happens only when the test starts closing! ***
    // Pending timers: [details of the unresolved timers] [already mentioned in bug #123]
    
    opened by ravenblackx 13
  • Flare animations not visible in release/profile build mode

    Flare animations not visible in release/profile build mode

    Hi all,

    I'm having a problem where some Flare animations are invisible in release or profile mode.

    This one is visible This one is invisible

    I really don't know what to do in this situation. Maybe the squares loader animations is wrong in some way?


    I'm using flare_flutter: ^1.5.0.

    [√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.475], locale en-GB) • Flutter version 1.5.4-hotfix.2 at C:\Users\Anis\Programs\flutter • Framework revision 7a4c33425d (2 weeks ago), 2019-04-29 11:05:24 -0700 • Engine revision 52c7a1e849 • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

    [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at C:\Users\Anis\AppData\Local\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01) • All Android licenses accepted.

    [√] Android Studio (version 3.4) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 35.3.1 • Dart plugin version 183.6270 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

    [√] IntelliJ IDEA Community Edition (version 2019.1) • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.1 • Flutter plugin version 35.3.3 • Dart plugin version 191.7141.49

    [√] VS Code, 64-bit edition (version 1.33.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.0.0

    [√] Connected device (1 available) • ANE LX1 • 9WV4C19131006232 • android-arm64 • Android 8.0.0 (API 26)

    Anybody knows why this occurs?

    opened by anisalibegic 12
  • flare_flutter-1.5.0 Error

    flare_flutter-1.5.0 Error

    Compiler message:
    file:///Users/yourks/.pub-cache/hosted/pub.flutter-io.cn/flare_flutter-1.5.0/lib/flare.dart:1023:18: Error: The argument type 'Int32List' can't be assigned to the parameter type 'Uint16List'.

    • 'Int32List' is from 'dart:typed_data'.
    • 'Uint16List' is from 'dart:typed_data'.
      Try changing the type of the parameter, or casting the argument to 'Uint16List'. indices: _indices, textureCoordinates: _uvBuffer);
      ^
      Compiler terminated unexpectedly.
    opened by YourksChan 12
  • Latest Flutter master(Dart 2.3 ??) breaking flare

    Latest Flutter master(Dart 2.3 ??) breaking flare

    Hi

    I am getting the following error on latest flutter master branch, my hunch is that this is related the dart 2.3 update. Working fine on Stable channel

    Compiler message: file:///Users/rahul/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.3.13/lib/flare.dart:981:18: Error: The argument type 'Int32List' can't be assigned to the parameter type 'Uint16List'.

    • 'Int32List' is from 'dart:typed_data'.
    • 'Uint16List' is from 'dart:typed_data'. Try changing the type of the parameter, or casting the argument to 'Uint16List'. indices: _indices, textureCoordinates: _uvBuffer); ^ Compiler failed on /Users/rahul/Development/AndroidStudioProjects/scrim/lib/main.dart Finished with error: Gradle task assembleDevelopmentDebug failed with exit code 1

    Flutter version: Flutter 1.5.5-pre.19 • channel master • https://github.com/flutter/flutter.git Framework • revision ac7f875778 (2 hours ago) • 2019-04-22 21:41:18 -0400 Engine • revision 0523870e0b Tools • Dart 2.3.0 (build 2.3.0-dev.0.1 cf4444b803)

    opened by rahulmanthena 12
  • Exporting a Certain Part of an Animation & Curved Paths

    Exporting a Certain Part of an Animation & Curved Paths

    There should be an option to export a certain part of an animation, no matter where it starts or ends. Like exporting the part that starts from the 4th second to 6th second. This is needed because it allows making loop animation with complex curves to be much much easier, or rather possible. If you always start exporting from the 1st frame, making loops become much harder, sometimes even impossible if they have complex animation curves. Because you would need to repeat some layers certain seconds apart from each other.

    Also, any given object should be able to animatable on a curved path, like in After Effects. Drawing the path that a layer would follow is much easier than calculating X and Y values for that to happen.

    opened by yekta 12
  • RangeError

    RangeError

    E/flutter (22329): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Exception: RangeError (byteOffset): Invalid value: Not in range 0..129, inclusive: 130 E/flutter (22329): #0 _ByteDataView.getUint16 (dart:typed_data-patch/typed_data_patch.dart:4367:7) E/flutter (22329): #1 BinaryReader.readUint16Array (package:flare_dart/binary_reader.dart:66:22) E/flutter (22329): #2 ActorImage.read (package:flare_dart/actor_image.dart:147:32) E/flutter (22329): #3 ActorArtboard.readComponentsBlock (package:flare_dart/actor_artboard.dart:372:34) E/flutter (22329): #4 ActorArtboard.read (package:flare_dart/actor_artboard.dart:325:11) E/flutter (22329): #5 Actor.readArtboardsBlock (package:flare_dart/actor.dart:165:22) E/flutter (22329): #6 Actor.load (package:flare_dart/actor.dart:137:11) E/flutter (22329):
    E/flutter (22329): #7 FlutterActor.loadFromByteData (package:flare_flutter/flare.dart:746:17) E/flutter (22329):
    E/flutter (22329): #8 _IsolateConfiguration.apply (package:flutter/src/foundation/_isolates_io.dart:77:16) E/flutter (22329): #9 _spawn. (package:flutter/src/foundation/_isolates_io.dart:84:45) E/flutter (22329):
    E/flutter (22329): #10 Timeline.timeSync (dart:developer/timeline.dart:161:22) E/flutter (22329): #11 _spawn (package:flutter/src/foundation/_isolates_io.dart:82:18)

    maybe some bug appears when export a .flr file since 2019.11.13

    opened by stormagain 11
  • update

    update

    ../../../../../Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/flare_flutter-3.0.2/lib/flare_render_box.dart:167:26: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null. - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../../Documents/flutter/packages/flutter/lib/src/scheduler/binding.dart'). SchedulerBinding.instance?.cancelFrameCallbackWithId(_frameCallbackID);

    opened by dackArrogant 1
  • Fix Flutter 3 Warnings

    Fix Flutter 3 Warnings

    opened by tsinis 2
  • Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.

    Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.

    Hi,

    After upgrade flutter to 3.0.1 I have had these warnings.

    ../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flare_flutter-3.0.2/lib/flare_render_box.dart:167:26: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').
            SchedulerBinding.instance?.cancelFrameCallbackWithId(_frameCallbackID);
                             ^
    ../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flare_flutter-3.0.2/lib/flare_render_box.dart:170:28: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').
              SchedulerBinding.instance?.scheduleFrameCallback(_beginFrame) ?? -1;
                               ^
    ../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flare_flutter-3.0.2/lib/flare_render_box.dart:272:26: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').
            SchedulerBinding.instance?.cancelFrameCallbackWithId(_frameCallbackID);
    
    opened by robertoltrocha 4
  • fix #313  #312 onBlendModeChanged _paint LateInitializationError

    fix #313 #312 onBlendModeChanged _paint LateInitializationError

    [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Exception: LateInitializationError: Field '_paint@268459774' has not been initialized.
    #0      FlutterActorImage._paint (package:flare_flutter/flare.dart)
    #1      FlutterActorImage.onBlendModeChanged (package:flare_flutter/flare.dart:505:5)
    #2      FlutterActorDrawable.blendMode= (package:flare_flutter/flare.dart:226:5)
    #3      FlutterActorDrawable.blendModeId= (package:flare_flutter/flare.dart:234:5)
    #4      ActorDrawable.read (package:flare_flutter/base/actor_drawable.dart:77:17)
    #5      ActorImage.read (package:flare_flutter/base/actor_image.dart:305:19)
    #6      ActorArtboard.readComponentsBlock (package:flare_flutter/base/actor_artboard.dart:387:34)
    #7      ActorArtboard.read (package:flare_flutter/base/actor_artboard.dart:349:11)
    

    In onBlendModeChanged Function, _paint never initialized when ActorDrawable read -> set blendModeId ,but _paint sound late ui.Paint

      @override
      void onBlendModeChanged(ui.BlendMode mode) {
         _paint.blendMode = mode;
        onPaintUpdated(_paint);
      }
    
    image
    opened by CarGuo 1
a widget provided to the flutter scroll component drop-down refresh and pull up load.

flutter_pulltorefresh Intro a widget provided to the flutter scroll component drop-down refresh and pull up load.support android and ios. If you are C

Jpeng 2.5k Jan 5, 2023
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.

image_sequence_animator A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file. If you have a G

AliYigitBireroglu 135 Jan 5, 2023
A collection of Screens and attractive UIs built with Flutter ready to be used in your applications. No external libraries are used. Just download, add to your project and use.

Flutter Screens A collection of Login Screens, Buttons, Loaders and Widgets with attractive UIs, built with Flutter, ready to be used in your applicat

Samarth Agarwal 5k Dec 31, 2022
Flutter Spring -simple & power full animation kit

A simple & powerfull pre-built animation kit. ?? Installation dependencies: spring: ^2.0.2 ?? Spring Animations Slide Scale Animated Card Flip Fa

null 51 Sep 25, 2022
Wave-transition-app - A wave transition based mobile app with included images and other files

Flutter wave application A new Flutter project done with dart and it's a wave tr

Munem Sarker 2 May 18, 2022
Generate Flutter vector code from a subset of SVG files.

built_vector Generates Flutter vector code from minimalist SVG-like files. Usage > pub global activate built_vector > pub global run built_vector -i <

Aloïs Deniel 33 Dec 29, 2020
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.

Motion Tab Bar A beautiful animated widget for your Flutter apps Preview: | | Getting Started Add the plugin: dependencies: motion_tab_bar: ^0.1.5 B

Rezaul Islam 237 Nov 15, 2022
A collection of Animations that aims to improve the user experience for your next flutter project.

A collection of Animations that aims to improve the user experience for your next flutter project.

Ezaldeen Sahb 134 Dec 24, 2022
Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.

like_button Language: English | 中文简体 Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's h

FlutterCandies 357 Dec 27, 2022
A light weight library to easily manage a progress dialog with simple steps whenever you need to do it. You can easily show and hide it.

progress_dialog A light weight package to show progress dialog. As it is a stateful widget, you can change the text shown on the dialog dynamically. T

Mohammad Fayaz 202 Dec 11, 2022
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).

drawing_animation From static SVG assets See more examples in the showcasing app. Dynamically created from Path objects which are animated over time m

null 442 Dec 27, 2022
A Flutter library that makes animation easer. It allows for separation of animation setup from the User Interface.

animator This library is an animation library for Flutter that: makes animation as simple as the simplest widget in Flutter with the help of Animator

MELLATI Fatah 225 Dec 22, 2022
A Flutter library for loading skeletons

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Daniel 0 Jan 6, 2022
Flutter percent indicator library

Percent Indicator Circular and Linear percent indicators Features Circle percent indicator Linear percent indicator Toggle animation Custom duration o

Diego Velásquez López 596 Dec 30, 2022
A flutter package which display the library collapse according to the number of images associated with hero animation

?? Gallery Collapse A flutter package which display the library collapse accordi

null 6 Sep 12, 2022
A library for handling animation warmup generically

This solution is not very scalable for applications with many animations to warm up and is meant mostly as an example of an approach applications could take to warmup their animations until a more permanent solution is available.

Dan Reynolds 42 Nov 19, 2022
A small library for creating snapping lists.

snaplist A small cozy library that allows you to make snappable list views. Issues and Pull Requests are really appreciated! Snaplist supports differe

David Leibovych 415 Dec 21, 2022
A library for pretty shadows.

shine.js A library for pretty shadows. See the working demo at http://bigspaceship.github.io/shine.js/. Get Started Install using bower: bower install

Big Spaceship 2.2k Dec 23, 2022
A Flutter project for login and sign up

loginsignup A new Flutter project for login and sign up. Getting Started This project is a starting point for a Flutter application. A few resources t

Faysal Neowaz 8 Dec 27, 2022