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

NoSuchMethodError: The getter 'inMicroseconds' was called on null. #103

Closed
Risen-Solutions opened this issue Jan 31, 2019 · 3 comments
Closed

Comments

@Risen-Solutions
Copy link

Risen-Solutions commented Jan 31, 2019

This is probably a stupidly simple QUESTION but I am pulling my hair out trying to work out what is going on. I'm trying to follow the remote url example, calling the playerWidget.dart file (exactly the same as the example) passing a url as the only parameter. I can see, via debug, that the url is passing correctly; however I am getting the error noted below.

When I followed it through to the audioplayers.dart file I can see that the example has different code to the 0.8.0 in lines 107-108... however I am too much a newbie to be able to fix that problem! :-(

Example (107-108)
{bool isLocal: false, double volume: 1.0, Duration position}) async {
final double positionInSeconds = position == null ? null : position.inSeconds.toDouble();

0.8.0 (107-108)
{bool isLocal: false, double volume: 1.0, Duration position: Duration.zero}) async {
double positionInSeconds = position.inMicroseconds / Duration.microsecondsPerSecond;

Any thoughts on how to correct this error? As noted, I am sure that it is a simple issue...

Phoenix

E/flutter ( 6077): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter ( 6077): NoSuchMethodError: The getter 'inMicroseconds' was called on null.
E/flutter ( 6077): Receiver: null
E/flutter ( 6077): Tried calling: inMicroseconds
E/flutter ( 6077): #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
E/flutter ( 6077): #1 AudioPlayer.play (package:audioplayers/audioplayers.dart:108:41)
E/flutter ( 6077):
E/flutter ( 6077): #2 _PlayerWidgetState._play (package:brave_puppy/ui/playerWidget.dart:154:39)
E/flutter ( 6077):
E/flutter ( 6077): #3 _PlayerWidgetState.build. (package:brave_puppy/ui/playerWidget.dart:60:54)
E/flutter ( 6077): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
E/flutter ( 6077): #5 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:562:30)
E/flutter ( 6077): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter ( 6077): #7 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
E/flutter ( 6077): #8 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
E/flutter ( 6077): #9 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter ( 6077): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:184:20)
E/flutter ( 6077): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:158:22)
E/flutter ( 6077): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:138:7)
E/flutter ( 6077): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
E/flutter ( 6077): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
E/flutter ( 6077): #15 _invoke1 (dart:ui/hooks.dart:168:13)
E/flutter ( 6077): #16 _dispatchPointerDataPacket (dart:ui/hooks.dart:122:5)

@erickzanardo
Copy link
Member

Thanks for reporting this, this is supposed to be already fixed on master, we just need to run some tests and release the new version.

Sorry for the problems, I will let you know when the version is released, we may do this on the middle of this week.

@Risen-Solutions
Copy link
Author

Awesome. Thanks for following this up. @erickzanardo

@erickzanardo
Copy link
Member

@Risen-Solutions we released yesterday a 0.8.1 with the correction for the problem on this issue. If you have any other problem, please let us know.

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

2 participants