Flare-flutter: Error: The argument type 'Null Function(FlutterActor)' can't be assigned to the parameter type 'FutureOr<dynamic> Function(Future<FlutterActor>)'

Created on 24 Apr 2019  Â·  14Comments  Â·  Source: 2d-inc/Flare-Flutter

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)

Most helpful comment

Hi @cmoradiaz81 thank you for reaching out, i also saw your email i'm writing the answer here but if you still get the error keep me posted i'll try my best to resolve it.

  • HERE'S WHAT YOU NEED TO DO:
    replace your code with this and it will work, for explanation see my answer above

    onDaySelected: (date, events, _) {
    setState(() {
    _selectedEvents = events;
    });
    },

All 14 comments

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' ('file:///C:/Programs/Flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.4.0/lib/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 (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17763.437], locale bs-Latn-BA)
• Flutter version 1.2.1 at ...
• Framework revision 8661d8aecd (10 weeks ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at ...
• 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-1248-b01)
• All Android licenses accepted.

[√] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 32.0.1
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[√] IntelliJ IDEA Community Edition (version 2019.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3
• Flutter plugin version 34.0.4
• Dart plugin version 191.6183.88

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

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

• No issues found!

Changing Flutter channel to master fixes this problem and introduces the new one: https://github.com/2d-inc/Flare-Flutter/issues/75. After this everything works...

same error...

It worked on stable channel till yesterday. Now fails. Our release deadline under treat (

We are also on stable channel and it doesnt build. Same error :/

Any news??...

This is due to some breaking changes to the current Flutter master branch.
As @grandpa-guru said, changing flutter channel to master and the type of _indices works as a temporary fix.

We're working through some breaking changes between Flutter stable and master/dev. If you need a build for flutter stable right now, please point your pub to 1.3.13 as follows:

flare_flutter: 1.3.13

Note there's no ^ before the version number.

We have a new system in place for handling these breaking changes. Please update your pubspec to flare_flutter: ^1.5.0 and take a look at our updated README.

I was facing the same issue but with this
Error: The argument type 'Null Function(DateTime, List)' can't be assigned to the parameter type 'void Function(DateTime, List, List)'. - 'DateTime' is from 'dart:core'. - 'List' is from 'dart:core'. onDaySelected: (day, events) {

I checked my code and since the function 'Null Function(DateTime, List)' can't be assigned to the parameter type 'void Function(DateTime, List, List)'
I passed _ as the third argument and it worked perfectly!

Hi,

I have the same error message, can you please copy your code with the modification?

Thank you very much
This is mine

onDaySelected: (date, events) {
setState(() {
_selectedEvents = events;
});
},

Hi @cmoradiaz81 thank you for reaching out, i also saw your email i'm writing the answer here but if you still get the error keep me posted i'll try my best to resolve it.

  • HERE'S WHAT YOU NEED TO DO:
    replace your code with this and it will work, for explanation see my answer above

    onDaySelected: (date, events, _) {
    setState(() {
    _selectedEvents = events;
    });
    },

Hi @cmoradiaz81 thank you for reaching out, i also saw your email i'm writing the answer here but if you still get the error keep me posted i'll try my best to resolve it.

  • HERE'S WHAT YOU NEED TO DO:
    replace your code with this and it will work, for explanation see my answer above

    onDaySelected: (date, events, _) {
    setState(() {
    _selectedEvents = events;
    });
    },

Thank you very much for your quick response, it works perfectly !!!

Any help please let me know

regards

https://github.com/2d-inc/Flare-Flutter/issues/77#issuecomment-721806298

No issue bro, anytime 💯

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sroddy picture sroddy  Â·  4Comments

FredslundMagnus picture FredslundMagnus  Â·  6Comments

parlux picture parlux  Â·  4Comments

gabber235 picture gabber235  Â·  6Comments

EArminjon picture EArminjon  Â·  7Comments