adv_image_picker 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

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.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.1

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]
67
Health:
Code health derived from static analysis. [more]
92
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
83
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

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

Analysis of lib/plugins/adv_image_picker_plugin.dart reported 10 hints, including:

line 43 col 5: 'BinaryMessages' is deprecated and shouldn't be used.

line 43 col 20: 'setMessageHandler' is deprecated and shouldn't be used.

line 45 col 9: This function has a return type of 'Future

line 47 col 7: 'BinaryMessages' is deprecated and shouldn't be used.

line 47 col 22: 'setMessageHandler' is deprecated and shouldn't be used.

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. (-1 points)

Analysis of lib/pages/camera.dart reported 2 hints:

line 14 col 8: Unused import: 'package:pit_components/components/adv_future_builder.dart'.

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

Fix additional 5 files with analysis or formatting issues. (-1 points)

Additional issues in the following files:

  • lib/pages/result.dart (1 hint)
  • lib/slide_left_route.dart (1 hint)
  • lib/adv_image_picker.dart (Run flutter format to format lib/adv_image_picker.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.)

Maintenance suggestions

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.5 0.0.5
flutter 0.0.0
image_list ^0.1.3+2 0.1.3+2
path_provider ^1.3.0 1.3.0
photo_view ^0.5.0 0.5.0
pit_components ^0.5.0 0.5.0+1
Transitive dependencies
collection 1.14.11 1.14.12
intl 0.15.8 0.16.0
meta 1.1.7
path 1.6.4
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8