Code Monkey home page Code Monkey logo

custom_image_picker's Introduction

custom_image_picker

A flutter plugin that allows you to retrieve the device's images and albums in order to customize your image picker depending on your needs.

Getting Started

Add dependency

dependencies:
  custom_image_picker: ^0.0.5

Usage

Import the library

import 'package:custom_image_picker/custom_image_picker.dart';

Get albums:

List<PhoneAlbum> albums = [];
final customImagePicker = CustomImagePicker();
customImagePicker.getAllImages(callback: (retrievedAlbums) {
     albums = retrievedAlbums;
});

Each album contains the following data

class PhoneAlbum {
  final String id;
  final String name;
  final String coverUri;
  final int photosCount;

  PhoneAlbum(this.id, this.name, this.coverUri, this.photosCount);

  ...
}

Get photos of an album:

List<PhonePhoto> imagesOfAlbum = [];
final customImagePicker = CustomImagePicker();
 customImagePicker.getPhotosOfAlbum(
     albumID, // The id of the album you want to retrieve the images for
     page: page, // The page number defaults to '1', in each page the library returns 50 images of the album
     callback: (images) {
         imagesOfAlbum.addAll(images);
     },
   );

Each photo contains the following data

class PhoneAlbum {
  final String id;
  final String albumName;
  final String photoUri;

  PhonePhoto(this.id, this.albumName, this.photoUri);

  ...
}

Platforms:

The library works for both Android & iOS, but it doesn't support pagination for iOS yet, we are working on delivering this feature ASAP.

Where we are going with this

We are currently trying to make more functions available to the package, so please feel free to add any suggestions in the issues

custom_image_picker's People

Contributors

josuemcapita avatar tahamalas avatar

Watchers

 avatar

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.