cr_file_saver는 파일을 안드로이드 및 iOS 기기로 저장할 수 있게 해주는 플러터 패키지로, 필요 시 자동으로 권한 요청을 처리합니다. 플랫폼별 세부 사항을 추상화함으로써 이미지, 문서 또는 데이터 내보내기와 같은 파일 작업을 사용자의 장치에 쉽게 저장할 수 있도록 간소화합니다. 이 패키지는 플러터 앱과 원활하게 통합되며 두 플랫폼 모두에서 일관된 API를 지원합니다. 오프라인 파일 저장 또는 내보내기 기능이 필요한 애플리케이션에 적합합니다.
사용 사례
내보낸 문서 저장
앱에서 생성한 이미지 저장
로컬 스토리지로 데이터 내보내기
파일 다운로드 처리
사용자 생성 콘텐츠 관리
주요 기능
자동 권한 처리
크로스 플랫폼 지원 (Android 및 iOS)
파일 저장을 위한 간단한 API
다양한 파일 형식을 지원합니다
내장된 오류 관리
적합한 대상
파일 내보내기를 요구하는 앱
미디어 집약형 애플리케이션
오프라인 데이터 저장
문서 관리 도구
사용자 콘텐츠 저장
고려 사항
Android 런타임 권한 필요
파일 저장에만 제한됨(읽기 불가)
플랫폼별 동작은 다를 수 있습니다
내장 파일 브라우징 없음
네이티브 OS 파일 시스템 접근에 의존
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
cr_file_saver
Cleveroad introduces file saver for Flutter
Features:
Request WriteExternalStoragePermission for Android if needed.
Save file to downloads directory on Android or Document folder on IOS.
Save file through standard file saving dialog.
Future features:
Saving file to a specific directory.
Setup
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:...cr_file_saver:^0.0.2
Android:
If you are using android 9 and below add this permission to project manifest:
CRFileSaver has several static methods to work with:
requestWriteExternalStoragePermission to check for permission and ask it if needed.
saveFile simply saving file with provided file path and desired file name.
saveFileWithDialog save file through standard file saving dialog. Note that this method will throw NoResolvedActivityException if Android device has 30 api or higher