folder_file_saver 0.4.0

folder_file_saver #

This Plugin provides:

  • Displays the file that you downloaded in Gallery And Media Player from Url
  • Copy existing file to new Folder extension
  • Create Folder of your Downloaded
    • jpg, png, jpeg = appname/Pictures
    • mp4 = appname/Videos
    • mp3 = appname/Musics
    • m4a = appname/Audios
    • any extension = appname/Documents
  • Download images and resize width and height
  • Check permission user
    • if permission denied require permission
    • if permission denied with don't ask again open settings app
  • Open Settings of device

Android #

You need to request those permissions in AndroidManifest.xml in order the plugin to work

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

IOS #

Currently this Plugin not avaible for IOS.

For demo #

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

0.4.0 (25 jan 2020) #

  • Update Android Gradle Version from 3.2.1 to 3.4.
  • Update kotlin version from 1.2.71 to 1.3.50
  • Fix Android The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher

0.3.0 #

  • Add Example to Copy File with local Path
  • Update CHANGELOG
  • Update README.md
  • Update Example

0.2.0+1 #

  • Update README.md

0.2.0 #

  • Update CHANGELOG
  • Fixes Open setting

0.0.2 #

  • Update CHANGELOG
  • Update README.md
  • Add Comment API

0.0.1+1 #

  • Update README.md
  • Update LICENSE
  • Update Example

0.0.1 #

  • Initial release

example/README.md

folder_file_saver_example #

Demonstrates how to use the folder_file_saver plugin.

Example #

void saveFileToFolderExt()async
{
// if you want check permission user
// use like that
// if return 0 permission is PERMISSION_GRANTED
// if return 1 permission is PERMISSION_IS_DENIED it will be open require permission
// if return 2 permission is PERMISSION_IS_DENIED with click don't ask again it will be open setting of app
await FolderFileSaver.getPermission().then((statusPermission) async {
      if (statusPermission == 0) {
        String result;
        final dir = await p.getTemporaryDirectory();
        // prepare the file and type that you want to download
        final filePath = dir.path + ('example_video.mp4');
        try {
          await dio.download(urlVideo, filePath);
          result = await FolderFileSaver.saveFileToFolderExt(filePath);
        } catch (e) {
          result = e;
        }
        print(result);
      }
    });
}

void _saveImage() async 
{
  String result;
  final dir = await p.getTemporaryDirectory();
  // prepare the file and type that you want to download
  final pathImage = dir.path + ('example_image.png');
        try {
          await dio.download(urlImage, pathImage);
          // if you want to get original of Image
          // don't give a value of width or height
          // cause default is return width = 0, height = 0
          // which will make it to get the original image
          // just write like this
          result = await FolderFileSaver.saveImage(
            pathImage: pathImage);
        } catch (e) {
          result = e;
        }
        print(result);
}

// if you don't need to check permission
// just do like this
void saveFileNotCheckPermission() async
{
  String result;
        final dir = await p.getTemporaryDirectory();
        // prepare the file and type extension that you want to download
        final filePath = dir.path + ('example_video.mp4');
        try {
          await dio.download(urlVideo, filePath);
          result = await FolderFileSaver.saveFileToFolderExt(filePath);
        } catch (e) {
          result = e;
        }
        print(result);
}

// Don't foreget check your permission
  void copyFileToNewFolder() async {
    setState(() {
      _isLoading = true;
    });
    // get your path from your device your device
    final fileToCopy = '/storage/emulated/0/DCIM/Camera/20200102_202226.jpg';
    try {
      await FolderFileSaver.saveFileToFolderExt(fileToCopy);
    } catch (e) {
      print(e);
    }
    setState(() {
      _isLoading = false;
    });
  }

// Open settings
RaisedButton(
  onPressed: () async => await FolderFileSaver.openSetting,
  child: Text('Open Setting App'),
),

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  folder_file_saver: ^0.4.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:folder_file_saver/folder_file_saver.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
62
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

We analyzed this package on Feb 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test