image_picker_saver 0.0.2 copy "image_picker_saver: ^0.0.2" to clipboard
image_picker_saver: ^0.0.2 copied to clipboard

outdated

Image Picker and Saver plugin for Flutter Android supported IOS supported 8.0+ fork form official plugin image_picker' 0.4.6 and add saver to save image to gallery

Image Picker and Saver plugin for Flutter #

pub package

Android supported

IOS supported 8.0+

forked from official plugin image_picker and add saver function to save image to photo gallery.

Installation #

click the pub version icon to read hwo to install this plugin.

Save image Example #


  void _onImageSaveButtonPressed() async {
    http.get(
        'http://upload.art.ifeng.com/2017/0425/1493105660290.jpg')
        .then((response) {
      debugPrint(response.statusCode.toString());

      ImagePickerSaver.saveFile(fileData: response.bodyBytes);

    });
  }

#---- The following is the official plugin description ---

Image Picker plugin for Flutter #

pub package

A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!

Installation #

First, add image_picker as a dependency in your pubspec.yaml file.

iOS #

Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

  • NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
  • NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.
  • NSMicrophoneUsageDescription - describe why your app needs access to the microphone, if you intend to record videos. This is called Privacy - Microphone Usage Description in the visual editor.

Android #

No configuration required - the plugin should work out of the box.

Example #

import 'package:image_picker/image_picker.dart';

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  File _image;

  Future getImage() async {
    var image = await ImagePicker.pickImage(source: ImageSource.camera);

    setState(() {
      _image = image;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Image Picker Example'),
      ),
      body: new Center(
        child: _image == null
            ? new Text('No image selected.')
            : new Image.file(_image),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: getImage,
        tooltip: 'Pick Image',
        child: new Icon(Icons.add_a_photo),
      ),
    );
  }
}
18
likes
0
pub points
80%
popularity

Publisher

unverified uploader

Image Picker and Saver plugin for Flutter Android supported IOS supported 8.0+ fork form official plugin image_picker' 0.4.6 and add saver to save image to gallery

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on image_picker_saver