Skip to content

The order of the animation is not respected #459

@Henriquek47

Description

@Henriquek47

I'm trying to run my Rive (.riv) project in Flutter, but the exit animation is inconsistent with the one created in Rive
https://rive.app/community/files/17975-33729-dish/

In Flutter:

document_5084644436923649443.mp4

code: import 'package:flutter/material.dart';
import 'package:rive/rive.dart' hide LinearGradient;

class DishScreen extends StatefulWidget {
const DishScreen({super.key});

@OverRide
State createState() => _DishScreenState();
}

class _DishScreenState extends State {
Artboard? _riveArtboard;

Future _loadRiveFile() async {
final riveFile = await RiveFile.asset('assets/untitled.riv');

final artboard = riveFile.mainArtboard.instance();
var controller = StateMachineController.fromArtboard(artboard, 'dish');
if (controller != null) {
  artboard.addController(controller);
  setState(() {
    _riveArtboard = artboard;
  });
}

}

@OverRide
void initState() {
Future.microtask(
() async => await _loadRiveFile(),
);
super.initState();
}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: _riveArtboard != null
? Rive(artboard: _riveArtboard!)
: SizedBox(
height: 100,
),
);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions