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

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

Closed
and-david opened this issue Apr 24, 2019 · 14 comments

Comments

@and-david
Copy link

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)

@anisalibegic
Copy link

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!

@anisalibegic
Copy link

Changing Flutter channel to master fixes this problem and introduces the new one: #75. After this everything works...

@Tennboard
Copy link

same error...

@BurykinNikolay
Copy link

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

@dukaric1991
Copy link

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

@ZatacaSystems
Copy link

Any news??...

@umberto-sonnino
Copy link
Contributor

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.

@luigi-rosso
Copy link
Contributor

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.

@luigi-rosso
Copy link
Contributor

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.

@hamzadevc
Copy link

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!

@cmoradiaz81
Copy link

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;
});
},

@hamzadevc
Copy link

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;
});
},

@cmoradiaz81
Copy link

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

@hamzadevc
Copy link

#77 (comment)

No issue bro, anytime 💯

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

10 participants