ext_storage 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new63

ext_storage #

ext_storage is minimal flutter plugin that provides external storage path and external public storage path.

Features #

NOTE This plugin is only supported Android.

ExtStorage package calls Android native code, Environment.getExternalStorageDirectory() and Environment.getExternalStoragePublicDirectory().

ExtStorageAndorid Native
ExtStorage.getExternalStorageDirectory()Environment.getExternalStorageDirectory()
ExtStorage.getExternalStoragePublicDirectory()Environment.getExternalStoragePublicDirectory()

ExtStorage.getExternalStoragePublicDirectory() needs Public Directory Type argument same as native getExternalStoragePublicDirectory().

ExtStorageAndroid Native
ExtStorage.DIRECTORY_MUSICEnvironment.DIRECTORY_MUSIC
ExtStorage.DIRECTORY_PODCASTSEnvironment.DIRECTORY_PODCASTS
ExtStorage.DIRECTORY_RINGTONESEnvironment.DIRECTORY_RINGTONES
ExtStorage.DIRECTORY_ALARMSEnvironment.DIRECTORY_ALARMS
ExtStorage.DIRECTORY_NOTIFICATIONSEnvironment.DIRECTORY_NOTIFICATIONS
ExtStorage.DIRECTORY_PICTURESEnvironment.DIRECTORY_PICTURES
ExtStorage.DIRECTORY_MOVIESEnvironment.DIRECTORY_MOVIES
ExtStorage.DIRECTORY_DOWNLOADSEnvironment.DIRECTORY_DOWNLOADS
ExtStorage.DIRECTORY_DCIMEnvironment.DIRECTORY_DCIM
ExtStorage.DIRECTORY_DOCUMENTSEnvironment.DIRECTORY_DOCUMENTS

Installation #

Add ext_storage as a dipendency in your project pubspeck.yaml.

dependencies:
  ext_storage:

and run the flutter pub get to install.

Usage #

First, you write import ext_storage package.

import 'package:ext_storage/ext_storage.dart';

And you can call two functions.

void _example1() async {
  var path = await ExtStorage.getExternalStorageDirectory();
  print(path);  // /storage/emulated/0
}

void _example2() async {
  var path = await ExtStorage.getExternalStoragePublicDirectory(ExtStorage.DIRECTORY_PICTURES);
  print(path);  // /storage/emulated/0/Pictures
}

Author #

yasukotelin

LICENCE #

MIT LICENCE

1.0.0 #

  • First publish version.

example/README.md

ext_storage_example #

Demonstrates how to use the ext_storage plugin.

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:
  ext_storage: ^1.0.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:ext_storage/ext_storage.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
29
Health:
Code health derived from static analysis. [more]
94
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

15 out of 15 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/ext_storage.dart. (-4.89 points)

Analysis of lib/ext_storage.dart reported 10 hints, including:

line 9 col 23: Name non-constant identifiers using lowerCamelCase.

line 11 col 23: Name non-constant identifiers using lowerCamelCase.

line 13 col 23: Name non-constant identifiers using lowerCamelCase.

line 15 col 23: Name non-constant identifiers using lowerCamelCase.

line 17 col 23: Name non-constant identifiers using lowerCamelCase.

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.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_driver
flutter_test