image_picker 0.1.3
image_picker: ^0.1.3

outdated Dart 2 incompatible

Flutter plugin that shows an image picker and uses the camera.

Image Picker plugin for Flutter #

pub package

A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!

Usage #

To use this plugin, add image_picker as a dependency in your pubspec.yaml file.

Example #

class _MyHomePageState extends State<MyHomePage> {
  File imageFile;

  getImage() async {
    var _fileName = await ImagePicker.pickImage();
    setState(() {
      imageFile = _fileName;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Image Picker Example'),
      ),
      body: new Center(
        child: imageFile == null
            ? new Text('No image selected.')
            : new Image.file(imageFile),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: getImage,
        tooltip: 'Pick Image',
        child: new Icon(Icons.add_a_photo),
      ),
    );
  }
}
1236
likes
0
pub points
99%
popularity

Publisher

flutter.dev

Flutter plugin that shows an image picker and uses the camera.

Homepage
Repository (GitHub)
View/report issues

Dependencies

flutter

More

Packages that depend on image_picker