Search packages, repositories and app categories

GitHub repositoryCleveroad/cr_file_saver

cr_file_saver

Cleveroad/cr_file_saver open-source repository details.

cr_file_saver project cover
Stars
3
Forks
11
Last push (UTC)
Feb 21, 2024
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

cr_file_saver

Header image

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:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
iOS:

Add permissions in ios folder, go to ios/Runner/info.plist and add next keys:

<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>

In your dart file add the following import:

import 'package:cr_file_saver/cr_file_saver.dart';

Usage

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
Cleveroad GitHub avatar
GitHub author

Cleveroad ↗

Professional web and mobile development company. Full-cycle IT development!

LanguagesKotlinDartJavaObjective-CSwiftRubyShell

Packages published by this repository

Dependencies used

Dependency list 5 items

  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.1.2
  • flutter_testDevelopment{"sdk":"flutter"}
  • flutter_lintsDevelopment^2.0.1
  • pigeonDevelopment^3.2.6

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗