I'm using a playerWidget based on flutter_audio_recorder. Though it works as required I get an annoying error message error upon compiles and hot restarts because the path is null at first. The path is null because no audio files have yet loaded. But once the PageView.builder which I'm using completes, the audio is then loaded so the error message has no effect on the actual operation. However the error message is becoming annoying. So I'd like to provide a default audio file from my server so the error will stop.
The error message says
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following NoSuchMethodError was thrown building SpeakRecorder(dirty, dependencies: [_InheritedProviderScope<SocialProvider>], state: SpeakRecorderState#5e63d):
The getter 'path' was called on null.
Receiver: null
Tried calling: path
And the Widget which calls the error is;
child: PlayerWidget(url: _current.path),
I tried the following;
String defaultaudio = _current.path ?? 'http://example.com/ping.m4a';
But it doesn't resolve the path is null error. Can anybody see what I'm doing wrong?