audioQuery doesn't wait for checking storage permisson

Issue class _HomeState extends State<Home> { @override void initState() { super.initState(); checkPermission(); } final audioQuery = OnAudioQuery(); FutureBuilder<List<SongModel>>( future: audioQuery.querySongs( sortType: null, orderType: OrderType.ASC_OR_SMALLER, uriType: UriType.EXTERNAL, ignoreCase: true, ), Future<void> checkPermission() async { if (!kIsWeb) { bool permissionRequest = await

Continue reading

Flutter: PlatformException (PlatformException(, cannot find the file, null, null)) on FlutterAudioRecorder2

Issue class AudioRecorder { static DateTime now = DateTime.now(); static String timestamp = now.toString(); var recorder = FlutterAudioRecorder2("./file_path", audioFormat: AudioFormat.AAC); // or var recorder = FlutterAudioRecorder2("file_path.mp3"); startRecording() async { await recorder.initialized; await recorder.start(); // <- error here } stopRecording() async

Continue reading