I am using package audio_service
Issue - when I use the audio service package and try to run the app it returns an error where firebase is initialized.
If I do not use the audio service package, the app is working fine, meaning no error message related to firebase.
Firebase Initialization Code:
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
if (Firebase.apps.isEmpty) {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
).then((value) {
logger.i('Firebase Initialized:${value.options}');
});
}
runApp(const MyApp());
}
If possible please guide me regarding this issue.
main()
should get called once and firebase must initialize once.