adv_image_picker 1.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

Advanced Image Picker #

This is our custom Image Picker that enabling you to multi pick image with our Custom UI

Note: This plugin is still under development, and some Components might not be available yet or still has so many bugs.

  • Known bug, Flutter Native View will error when orientation changes

Installation #

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

adv_image_picker: ^0.2.1

Example #

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  List<File> files = [];

  void _pickImage() async {
    files.addAll(await AdvImagePicker.pickImagesToFile(context));

    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: GridView.count(crossAxisCount: 4,
          children: files.map((File f) => Image.file(f, fit: BoxFit.cover,)).toList(),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _pickImage,
        child: Icon(Icons.add),
      ),
    );
  }
}

1.0.5 #

  • Fix dependency with the latest basic components

1.0.4+2 #

  • Fix dependency with the latest basic components

1.0.4+1 #

  • Fix iOS target size that cause PHImageResultIsDegradedKey
  • Handle iOS permission request before open page

1.0.4 #

  • Upgrade adv_camera version

1.0.3 #

  • Change pit_components to basic_components

1.0.2 #

  • Fix Android force closed when select image from gallery

1.0.1 #

  • Adding maxSize to pick image from camera
  • Some bug fixing

1.0.0 #

  • [Breaking Change] try to upgrade to 1.9.1
  • Using new Camera

0.3.3 #

  • Fix onPermissionRationaleShouldBeShown to continue request permission

0.3.2 #

  • Fix terminated apps when used under Flutter 1.5.4
  • Using Image List plugin to enhance user-experience when scrolling through local image

0.3.1 #

  • Change dependency to photo_view to 0.3.0

0.3.0 #

  • Breaking change: Flutter upgrade to 1.5.4

0.2.3 #

  • PIT Components dependency upgraded

0.2.2 #

  • Rotation bug and bug after lock screen fixed

0.2.1 #

  • AndroidX Upgrade fixes (dexter dependency)

0.2.0+3 #

  • AndroidX Upgrade fixes (dexter dependency)

0.2.0+2 #

  • AndroidX Upgrade fixes

0.2.0+1 #

  • Upgrade to AndroidX

0.2.0 #

  • Upgrade to AndroidX

0.1.2 #

  • Avoiding AndroidX

0.1.1 #

  • Result Null Checking fixes

0.1.0 #

  • Dependencies to stable channel Flutter

0.0.7 #

  • Dependencies error fixed

0.0.6 #

  • Android FileProvider error fix

0.0.5 #

  • Bug Fixed

0.0.4 #

  • Bug Fixed

0.0.3 #

  • Bug Fixed

0.0.2 #

  • Toggle to switch enable multiple select and enable only Camera / Gallery added

0.0.1 #

  • Initial Release

example/README.md

import 'dart:io';

import 'package:adv_image_picker/adv_image_picker.dart';
import 'package:flutter/material.dart';

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

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

class MyHomePage extends StatefulWidget {
 MyHomePage({Key key, this.title}) : super(key: key);

 final String title;

 @override
 _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
 int _counter = 0;
 List<File> files = [];

 void _pickImage() async {
   files.addAll(await AdvImagePicker.pickImagesToFile(context));

   setState(() {

   });
 }

 @override
 Widget build(BuildContext context) {
   return Scaffold(
     appBar: AppBar(
       title: Text(widget.title),
     ),
     body: Center(
       child: GridView.count(crossAxisCount: 4,
         children: files.map((File f) => Image.file(f, fit: BoxFit.cover,)).toList(),
       ),
     ),
     floatingActionButton: FloatingActionButton(
       onPressed: _pickImage,
       child: Icon(Icons.add),
     ),
   );
 }
}

Use this package as a library

1. Depend on it

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


dependencies:
  adv_image_picker: ^1.0.5

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

We analyzed this package on Dec 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.4

Health suggestions

Fix lib/plugins/adv_image_picker_plugin.dart. (-1.99 points)

Analysis of lib/plugins/adv_image_picker_plugin.dart reported 4 hints:

line 53 col 5: 'defaultBinaryMessenger' is deprecated and shouldn't be used. Use ServicesBinding.instance.defaultBinaryMessenger instead. This feature was deprecated after v1.6.5..

line 57 col 7: 'defaultBinaryMessenger' is deprecated and shouldn't be used. Use ServicesBinding.instance.defaultBinaryMessenger instead. This feature was deprecated after v1.6.5..

line 84 col 5: 'defaultBinaryMessenger' is deprecated and shouldn't be used. Use ServicesBinding.instance.defaultBinaryMessenger instead. This feature was deprecated after v1.6.5..

line 88 col 7: 'defaultBinaryMessenger' is deprecated and shouldn't be used. Use ServicesBinding.instance.defaultBinaryMessenger instead. This feature was deprecated after v1.6.5..

Fix lib/models/album_item.dart. (-1 points)

Analysis of lib/models/album_item.dart reported 2 hints:

line 35 col 16: Avoid wrapping fields in getters and setters just to be "safe".

line 39 col 7: Avoid wrapping fields in getters and setters just to be "safe".

Fix lib/pages/camera.dart. (-0.50 points)

Analysis of lib/pages/camera.dart reported 1 hint:

line 42 col 7: The value of the field '_currentCameraIndex' isn't used.

Fix additional 6 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/slide_left_route.dart (1 hint)
  • lib/adv_image_picker.dart (Run flutter format to format lib/adv_image_picker.dart.)
  • lib/components/toast.dart (Run flutter format to format lib/components/toast.dart.)
  • lib/pages/gallery.dart (Run flutter format to format lib/pages/gallery.dart.)
  • lib/pages/preview.dart (Run flutter format to format lib/pages/preview.dart.)
  • lib/pages/result.dart (Run flutter format to format lib/pages/result.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (photo_view).

The package description is too short. (-17 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
adv_camera ^0.0.6 0.0.6
basic_components ^1.0.0 1.0.0+6
flutter 0.0.0
image_list ^0.1.3+2 0.1.3+2
path_provider ^1.3.0 1.5.1
photo_view ^0.5.0 0.5.0 0.9.0
Transitive dependencies
collection 1.14.11 1.14.12
intl 0.15.8 0.16.0
meta 1.1.8
path 1.6.4
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8