img_picker 1.0.2 copy "img_picker: ^1.0.2" to clipboard
img_picker: ^1.0.2 copied to clipboard

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

example/lib/main.dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:img_picker_platform_interface/img_picker_platform_interface.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Image Picker Demo',
      home: MyHomePage(title: 'Image Picker Example'),
    );
  }
}

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

  final String? title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Future<void> uploadPhotos() async {
    final List<XFile> photoList = await ImagePickerPlatform.instance
        .getMultiImageWithOptions(options: MultiImagePickerOptions(limit: 2));
    var s = 0;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: FilledButton(
          onPressed: () {
            uploadPhotos();
          },
          child: Text('Upload Photo'),
        ),
      ),
    );
  }
}
4
likes
160
points
100
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

Topics

#camera #image-picker #files #file-selection

Documentation

API reference

License

MIT (license)

Dependencies

flutter, img_picker_android, img_picker_ios, img_picker_platform_interface

More

Packages that depend on img_picker

Packages that implement img_picker