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

Unable to render JSON flr with FlareActor #271

Open
MarcoF09 opened this issue Aug 7, 2020 · 0 comments
Open

Unable to render JSON flr with FlareActor #271

MarcoF09 opened this issue Aug 7, 2020 · 0 comments

Comments

@MarcoF09
Copy link

MarcoF09 commented Aug 7, 2020

Hi everyone!
I'm facing a problem when I try to render frl files exported as JSON. I tested with the same file exported as binary and it works well but with JSON not and I did not find anywhere that this is a restriction.

Expected Behavior

image

Current Behavior

image

Steps to Reproduce

  1. Export the following file as binary and JSON: https://rive.app/a/JuanCarlos/files/flare/filip
  2. Create a flutter project and add the flare_flutter dependency and the assets:
    image
  3. Put the following code in the main.dart:
import 'package:flutter/material.dart';
import 'package:flare_flutter/flare_actor.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,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: FlareDemo(),
    );
  }
}

class FlareDemo extends StatefulWidget {
  @override
  _FlareDemoState createState() => _FlareDemoState();
}

class _FlareDemoState extends State<FlareDemo> {
  bool isOpen = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: InkWell(
        onTap: () {
          setState(() {
            isOpen = !isOpen;
            print('on tap pressed');
          });
        },
        child: Center(
          child: FlareActor('assets/FilipBinary.flr', animation: isOpen ? 'phone_sway' : ''),
        ),
      ),
    );
  }
}
  1. Execute in any device.

Context (Environment)

I'm working in macOS Catalina 10.15.6 and executing in and Iphone 11 simulator and Samsung Galaxy A10.

Possible Solution

I didn't find any workaround yet, I was trying with the different properties of the flare actor without success.
If anyone knows a workaround or which work should be done in the library to make it work it will helpful.
Thanks!

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

1 participant