app_image_picker 1.0.0 copy "app_image_picker: ^1.0.0" to clipboard
app_image_picker: ^1.0.0 copied to clipboard

PlatformAndroid

A Flutter package that provides a simplified and unified interface for picking images from gallery or camera, built on top of image_picker plugin.

app_image_picker #

A Flutter package that provides a simplified and unified interface for picking images from gallery or camera, built on top of image_picker plugin.

Features #

  • Pick images from gallery
  • Capture photos with camera
  • File metadata extraction (mime type, file size, name)
  • Permission handling callback
  • Unified interface for image picking

Installation #

Add the dependency in pubspec.yaml:

dependencies:
  app_image_picker: ^1.0.0

Then run:

flutter pub get

Usage #

import 'package:app_image_picker/app_image_picker.dart';

void main() {
  _takePhoto();
  _choosePhoto();
}

/// 拍照
Future<String?> _takePhoto() async {
  var info = await AppImagePickerFactory.instance.pickFromCamera(
    onPermissionRequest: () async {
      // 调用方实现权限请求
      return true;
    },
  );
  return info?.path;
}

/// 选择图片
Future<String?> _choosePhoto() async {
  var info = await AppImagePickerFactory.instance.pickFromGallery(
    onPermissionRequest: () async {
      // 调用方实现权限请求
      return true;
    },
  );
  return info?.path;
}

Example #

See the example directory for a complete sample app.

License #

The project is under the MIT license.

0
likes
160
points
106
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides a simplified and unified interface for picking images from gallery or camera, built on top of image_picker plugin.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, image_picker, image_picker_android, image_picker_platform_interface

More

Packages that depend on app_image_picker