bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
2.01k stars 845 forks source link

Dart 2 support? #20

Closed theKAKAN closed 6 years ago

theKAKAN commented 6 years ago

I'm getting errors with Flutter beta 2, which uses Dart 2. I tried running it with flutter run --no-preview-dart-2 and it worked. Here's the error, with beta 2 and Dart 2. type 'Future<dynamic>' is not a subtype of type 'Future<int>' Location:

  Future<int> play(String url, {bool isLocal: false, double volume: 1.0}) =>
      _channel.invokeMethod('play', {"playerId": playerId, "url": url, "isLocal": isLocal, 'volume': volume});

in audioplayer.dart
Running flame_example Well, here's a screenshot from VS Code: upload

The line in which the error is found is Flame.audio.loop('music.ogg');

theKAKAN commented 6 years ago

Tried 0.5.1, no errors but sound was not being played. In 0.5.2, everything works fine. Thank you :)