Coder Social home page Coder Social logo

violet-dev / ext_storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from basitis/ext_storage

0.0 0.0 0.0 204 KB

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

License: MIT License

Kotlin 25.98% Swift 10.74% Objective-C 4.35% Dart 51.21% Ruby 7.72%

ext_storage's Introduction

ext_storage (null-safety)

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

https://pub.dev/packages/ext_storage

Features

NOTE This plugin is only supported Android. Now supports null safety.

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

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

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

ExtStorage Android Native
ExtStorage.directoryMusic Environment.DIRECTORY_MUSIC
ExtStorage.directoryPodcasts Environment.DIRECTORY_PODCASTS
ExtStorage.directoryRingtones Environment.DIRECTORY_RINGTONES
ExtStorage.directoryAlarms Environment.DIRECTORY_ALARMS
ExtStorage.directoryNotifications Environment.DIRECTORY_NOTIFICATIONS
ExtStorage.directoryPictures Environment.DIRECTORY_PICTURES
ExtStorage.directoryMovies Environment.DIRECTORY_MOVIES
ExtStorage.directoryDownloads Environment.DIRECTORY_DOWNLOADS
ExtStorage.directoryDCIM Environment.DIRECTORY_DCIM
ExtStorage.directoryDocuments Environment.DIRECTORY_DOCUMENTS
ExtStorage.directoryScreenshots Environment.DIRECTORY_SCREENSHOTS
ExtStorage.directoryAudiobooks Environment.DIRECTORY_AUDIOBOOKS

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
  • Aduyrat

LICENCE

MIT LICENCE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.