I'm using flare but I get this error, error goes away when I use CircularProgressIndicator().
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unexpected character (at character 1)
E/flutter ( 7668): PK
Here's the code:
import 'package:flutter/material.dart';
import 'package:flare_flutter/flare_actor.dart';
class LoadingIndicator extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
// child: CircularProgressIndicator(),
child: FlareActor(
"assets/loading_1.flr2d",
alignment: Alignment.center,
fit: BoxFit.contain,
animation: "loading",
),
);
}
}
SOLUTION
When I've downloaded Flare graphics from Explore page of 2Dimensions, I was downloading .flr2d
files. Which was I guess a project fiel. In flare, you have to export rather than download. I've exported as binary and the output file has .flr
extension. Thanks @Noob for helping me to find the answer.
As Noob mentioned your file needs to be a .flr
If you are downloading from 2 dimension's page then you need to go to Export
at top right from Flare editor. Then select file format as JSON
not binary
. You should be then downloading the asset as a .flr
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With