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

A Flutter plugin for iOS and Android for picking images & video from the image & video Library

flutterimagevideopicker #

A Flutter plugin for iOS and Android for picking images & video from the image & video Library

Installation #

First, add photo_gallery 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.

<key>NSPhotoLibraryUsageDescription</key>
<string>Example usage description</string>

Android

Add the following permissions to your AndroidManifest.xml, located in <project root>/android/app/src/main/AndroidManifest.xml:

<manifest ...>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    ...
<manifest/>

API 29+

Add the following property to your AndroidManifest.xml, located in <project root>/android/app/src/main/AndroidManifest.xml to opt-out of scoped storage:

<manifest ...>
    ...
    <application
        android:requestLegacyExternalStorage="true"
        ...>
    <application/>
<manifest/>

Usage #

  • Listing albums in the gallery
import 'package:flutter/material.dart';
import 'package:flutterimagevideopicker/flutterimagevideopicker.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key, required String title});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        height: MediaQuery.of(context).size.height,
        width: MediaQuery.of(context).size.width,
        color: Colors.black,
        child: FlutterImageVideoPicker(
            title: "Gallery",
            onTap: (value) {
              print("value is $value");
            }),
      ),
    );
  }
}

Width and height is only available on Android API 29+ or iOS platform

  • Displaying album thumbnail
3
likes
0
pub points
41%
popularity

Publisher

verified publisherstudentsonlychoice.com

A Flutter plugin for iOS and Android for picking images & video from the image & video Library

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, permission_handler, photo_gallery, transparent_image

More

Packages that depend on flutterimagevideopicker