Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlareActor not displaying in { environment: sdk: ">=2.1.0 <3.0.0" } #241

Open
uxrefiner opened this issue Mar 27, 2020 · 1 comment
Open

Comments

@uxrefiner
Copy link

uxrefiner commented Mar 27, 2020

I created a simple animation with Rive of a red square moving across the screen to test out importing it into a Flutter app. I used "flutter create" in the terminal to create a fresh flutter project to test this out, and I was unable to get the Rive animation to display using FlareActor until I changed the sdk version in the pubspec.yaml file.

Tested on:

  • physical iPhone SE running iOS 13.3.1
  • simulator iPhone 11 running iOS 13.3

Flutter pubspec.yaml:

environment:
sdk: ">=2.1.0 <3.0.0" //FlareActor not displaying

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0" //FlareActor displaying

I made sure to keep the code as simple as possible to eliminate any potential errors. Here is my main.dart file:

import 'package:flare_flutter/flare_actor.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return new FlareActor("assets/red_square.flr",
        alignment: Alignment.center,
        fit: BoxFit.contain,
        animation: "red_square");
  }
}

Here is the full yaml file of the project with FlareActor not displaying:

name: flare_actor_broken
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flare_flutter: 2.0.1
  
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:

  uses-material-design: true

  assets:
  - assets/

Here is the full .yaml of the project with the FlareActor displaying:

name: flare_actor_working
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flare_flutter: 2.0.1

  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:

  uses-material-design: true

  assets:
  - assets/
@justkawal
Copy link

Same Issue happening here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants