media_saver 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

media_saver #


Quick and Simple save media file for Android and IOS

Features #

  • Implements native permission (Android)
  • Save image to Pictures for Android and IOS
  • Support save jpg/png/gif image
  • Support set image name, set image dir, set image suffix

Installation #

Add it to your pubspec.yaml file

   media_saver: <PLUGIN_VERSION>

Install it

pub get

Import it

import 'package:media_saver/media_saver.dart';

For iOS you need setting info.plist with

  Privacy - Photo Library Additions Usage Description

Usage #

    var response = await Dio().get(
      options: Options(responseType: ResponseType.bytes),

    String path = await MediaSaver.saveImage(
      imageType: ImageType.PNG,
      fileName: 'saveFileName',
      directory: 'demo',

License #

MIT @yk3372 @wsh794972562

1.0.0 #

  • android is Ready, IOS is developing


import 'dart:typed_data';

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:media_saver/media_saver.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  String state;

  void initState() {

  void _saveImage() async {
    setState(() {
      state = 'begin download';
    var response = await Dio().get(
      options: Options(responseType: ResponseType.bytes),
    setState(() {
      state = 'download success, saving...';

    bool path = await MediaSaver.saveImage(
      imageType: ImageType.JPG,
      fileName: 'saveFileName',
      directory: 'demo',
    setState(() {
      state = 'savePath: $path';

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('media saver'),
        body: Container(
          child: Column(
            children: <Widget>[
              Text(state ?? 'init'),
                onTap: _saveImage,
                behavior: HitTestBehavior.opaque,
                child: Container(
                  width: 100,
                  height: 100,
                  color: Colors.redAccent,
                  child: Text(
                    style: TextStyle(
                      color: Colors.white,

Use this package as a library

1. Depend on it

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

  media_saver: ^1.0.2

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:media_saver/media_saver.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Maintenance suggestions

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.


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