パッケージ、リポジトリ、アプリカテゴリを検索

image_picker_gallery_camera のカバー
パッケージ詳細v0.3.0

image_picker_gallery_camera

ギャラリーまたはカメラから画像を選択するためのFlutterパッケージ。このパッケージはカメラ、ギャラリー、および両方から画像を選択することをサポートしています。

AndroidiOSWeb
30日間ダウンロード
228
いいね数
46
Pub ポイント
140

パッケージをインストール

flutter pub add image_picker_gallery_camera

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

デバイスのギャラリー、カメラ、または両方から画像を選択できるFlutterパッケージです。Android、iOS、Webプラットフォームでシンプルかつ一貫したインターフェースを提供します。プロフィールやアップロード、メディア処理に画像入力が必要なFlutterアプリにシームレスに統合できます。単一および複数の画像選択をサポートしており、フォームやソーシャル機能、コンテンツ作成ツールに最適です。使いやすさを最優先に設計されており、プラットフォーム固有の複雑さを抽象化しています。

用途

  • ユーザーのプロフィール画像のアップロード
  • ソーシャルメディア投稿の作成
  • カメラによる文書スキャン
  • EC商品画像キャプチャ
  • フォームベースの画像送信

主な機能

  • ギャラリーまたはカメラから選択
  • ギャラリーおよびカメラモードの両方をサポートしています
  • クロスプラットフォーム互換性(Android、iOS、Web)
  • シンプルな API インテグレーション
  • 複数の画像選択
  • 組み込みの権限処理

適している対象

  • モバイルアプリ開発者
  • 画像入力が必要なWebアプリケーション
  • ユーザー生成コンテンツを必要とするアプリ
  • 画像添付付きフォーム
  • コンテンツ管理システム

注意事項

  • Android および iOS には適切な権限が必要です
  • ブラウザによってWebサポートに制限が生じる可能性があります
  • 大きな画像サイズはパフォーマンスに影響を与える可能性があります
  • ピッカーUIのカスタマイズが限定的
  • 組み込みの画像編集機能なし
  • 下位プラットフォームのカメラ/ギャラリーAPIに依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

image_picker_gallery_camera

Flutter Package to Pick Image From Gallery or Camera

Getting Started

A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera. You can use both Camera and Gallery Option.

Installation

First, add image_picker_gallery_camera as a dependency in your pubspec.yaml file.

iOS

Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:

NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.
NSMicrophoneUsageDescription - describe why your app needs access to the microphone, if you intend to record videos. This is called Privacy - Microphone Usage Description in the visual editor.
Android

No configuration required - the plugin should work out of the box.

Final Output

Example

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:image_picker_gallery_camera/image_picker_gallery_camera.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: 'Example Image Picker',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Example Image Picker'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  var _image;

  Future getImage(ImgSource source) async {
    var image = await ImagePickerGC.pickImage(
        enableCloseButton: true,
        closeIcon: Icon(
          Icons.close,
          color: Colors.red,
          size: 12,
        ),
        context: context,
        source: source,
        barrierDismissible: true,
        cameraIcon: Icon(
          Icons.camera_alt,
          color: Colors.red,
        ), //cameraIcon and galleryIcon can change. If no icon provided default icon will be present
        cameraText: Text(
          "From Camera",
          style: TextStyle(color: Colors.red),
        ),
        galleryText: Text(
          "From Gallery",
          style: TextStyle(color: Colors.blue),
        ));
    setState(() {
      _image = image;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Container(
                width: 300,
                child: ElevatedButton(
                  onPressed: () => getImage(ImgSource.Gallery),
                  style: ElevatedButton.styleFrom(
                    primary: Colors.blue,
                  ),
                  child: Text(
                    "From Gallery".toUpperCase(),
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Container(
                width: 300,
                child: ElevatedButton(
                  onPressed: () => getImage(ImgSource.Camera),
                  style: ElevatedButton.styleFrom(
                    primary: Colors.deepPurple,
                  ),
                  child: Text(
                    "From Camera".toUpperCase(),
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              Container(
                width: 300,
                child: ElevatedButton(
                  onPressed: () => getImage(ImgSource.Both),
                  style: ElevatedButton.styleFrom(
                    primary: Colors.red,
                  ),
                  child: Text(
                    "Both".toUpperCase(),
                    style: TextStyle(color: Colors.white),
                  ),
                ),
              ),
              _image != null ? Image.file(File(_image.path)) : Container(),
            ],
          ),
        ),
      ),
    );
  }
}

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。