bartonhammond / voiceClient

Dart, Flutter, Firestore
MIT License
0 stars 0 forks source link

Prevent navigation while audio is playing or stop the audio first #18

Open bartonhammond opened 4 years ago

bartonhammond commented 4 years ago

To reproduce - click into story and start the audio. While the audio is playing, hit the back button.

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: Bad state: Cannot add new events after calling close
#0      _BroadcastStreamController.add  (dart:async/broadcast_stream_controller.dart:251:24)
#1      AudioPlayer._doHandlePlatformCall 
package:audioplayers/audioplayers.dart:575
#2      AudioPlayer.platformCallHandler 
package:audioplayers/audioplayers.dart:538
#3      MethodChannel._handleAsMethodCall 
package:flutter/…/services/platform_channel.dart:409
#4      MethodChannel.setMethodCallHandler.<anonymous closure> 
package:flutter/…/services/platform_channel.dart:377
#5      _DefaultBinaryMessenger.handlePlatformMessage 
package:flutter/…/services/binding.dart:199
#6      _invoke3.<anonymous closure>  (dart:ui/hooks.dart:290:15)
#7      _rootRun  (dart:async/zone.dart:1184:13)
#8      _CustomZone.run  (dart:async/zone.dart:1077:19)
#9      _CustomZone.runGuarded  (dart:async/zone.dart:979:7)
#10     _invoke3  (dart:ui/hooks.dart:289:10)