image_picker 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 50

Image Picker plugin for Flutter #

pub package

A Flutter wrapper for the native image picker.

Note: This is a work-in-progress, and is not fully supported by the Flutter team.

Issues and feedback #

Please file issues to send feedback or report a bug. Thank you!

0.0.2 #

  • Fix crash when trying to access camera on a device without camera (e.g. the Simulator)

0.0.1 #

  • Initial Release

example/lib/main.dart

import 'dart:io';
import 'dart:async';
import 'dart:math';

import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Image Picker Demo',
      home: new MyHomePage(title: 'Image Picker Example'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  Future<File> _imageFile;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Image Picker Example'),
      ),
      body: new Center(
        child: new FutureBuilder(
          future: _imageFile,
          builder: (BuildContext context, AsyncSnapshot<File> snapshot) {
            if (snapshot.connectionState == ConnectionState.done) {
              return new Image.file(snapshot.data);
            } else {
              return new Text('You have not yet picked an image.');
            }
          }
        )
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: () {
          setState(() {
            _imageFile = ImagePicker.pickImage();
          });
        },
        tooltip: 'Pick Image',
        child: new Icon(Icons.add_a_photo),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  image_picker: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:image_picker/image_picker.dart';
  
Version Uploaded Documentation Archive
0.6.0+8 May 23, 2019 Go to the documentation of image_picker 0.6.0+8 Download image_picker 0.6.0+8 archive
0.6.0+7 May 22, 2019 Go to the documentation of image_picker 0.6.0+7 Download image_picker 0.6.0+7 archive
0.6.0+6 May 22, 2019 Go to the documentation of image_picker 0.6.0+6 Download image_picker 0.6.0+6 archive
0.6.0+5 May 22, 2019 Go to the documentation of image_picker 0.6.0+5 Download image_picker 0.6.0+5 archive
0.6.0+4 May 20, 2019 Go to the documentation of image_picker 0.6.0+4 Download image_picker 0.6.0+4 archive
0.6.0+3 May 9, 2019 Go to the documentation of image_picker 0.6.0+3 Download image_picker 0.6.0+3 archive
0.6.0+2 Apr 30, 2019 Go to the documentation of image_picker 0.6.0+2 Download image_picker 0.6.0+2 archive
0.6.0+1 Apr 25, 2019 Go to the documentation of image_picker 0.6.0+1 Download image_picker 0.6.0+1 archive
0.6.0 Apr 25, 2019 Go to the documentation of image_picker 0.6.0 Download image_picker 0.6.0 archive
0.5.4+3 Apr 23, 2019 Go to the documentation of image_picker 0.5.4+3 Download image_picker 0.5.4+3 archive

All 53 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
100
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

This package version is not analyzed, because it is more than two years old. Check the latest stable version for its analysis.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0