ja2375 / multi_media_picker

A fork of the official image_picker flutter plugin that adds the functionality to pick multiple images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multi_media_picker

A fork of the official image_picker plugin that adds the functionality to pick multiple images.

NOTE: On iOS only one image can be picked as of now. Android is fully supported.

Installation

In your pubspec.yaml file within your Flutter Project:

dependencies:
  multi_media_picker: <lastest version>

iOS

NOT FULLY SUPPORTED YET

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:multi_media_picker/multi_media_picker.dart';

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

class _MyHomePageState extends State<MyHomePage> {
  List<File> _images;

  Future getImage() async {
    var images = await MultiMediaPicker.pickImages(sources: ImageSource.camera);

    setState(() {
      _images = images;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Image Picker Example'),
      ),
      body: Center(
        child: _images == null
            ? Text('No image selected.')
            : Image.file(_images[0]),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: getImage,
        tooltip: 'Pick Image',
        child: Icon(Icons.add_a_photo),
      ),
    );
  }
}

About

A fork of the official image_picker flutter plugin that adds the functionality to pick multiple images.

License:MIT License


Languages

Language:Java 62.8%Language:Objective-C 16.8%Language:Dart 15.3%Language:Ruby 5.1%