flutter 폴더에서 File List 가져오기. 안드로이드.
* 안드로이드에서 파일 목록을 가져오는 방법. - 안드로이드의 파일 관련 권한과 Storage Access Framework (SAF) 때문에 기본 API가 동작하지 않습니다. 그래서 아래 라이브러리를 사용 했습니다. - 안드로이드 13(sdk 33)에서는 Uri 형태로 폴더를 넘기고 파일을 받아야 접근이 됩니다. Uri 예) content://com.android.externalstorage.documents/tree/primary https://pub.dev/packages/shared_storage // 폴더 선택 방법. final Uri ? dirUri = await openDocumentTree (); // 파일 리스트 함수 사용. var audioList = await getFileList ( dirUri , ".(mp3|wav)" ); Future < List < DocumentFile >> getFileList ( String audioPath , String regex ) async { const List < DocumentFileColumn > columns = < DocumentFileColumn >[ DocumentFileColumn . displayName , DocumentFileColumn . id , DocumentFileColumn . mimeType , ]; final List < DocumentFile > files = []; final Uri audioPathUri = Uri . parse ( audioPath ); final Stream < DocumentFile > onFileLoaded = listFiles ( audioPathUri , columns : columns ); final regExp =