Giter VIP home page Giter VIP logo

camera_extended's Introduction

camera_extended

A Flutter package base from plugin camera & flutter_image_compress for compressing image.

Getting Started

In your flutter project add the dependency in your pubspec.yaml:

dependencies:
...
camera_extended:
    git:
      url: https://github.com/cyansoft-dev/camera_extended.git
      ref: master

Feature

  • Add control the flash.
  • Add feature pitching for zoom in out.
  • Add change camera.
  • Can add custom widget for handling error permission.
  • Can setting quality of image for resize image file.
  • Add video record feature.

Usage

importing package

import 'package:camera_extended/camera_extended.dart';

Example

CameraExtended(
      quality: 80,
      onCapture: (image) {
        debugPrint(image!.path);
      },
      child: Container(),
 );

Example with custom widget for handling error permission

CameraExtended(
      quality: 80,
      onCapture: (image) {
        debugPrint(image!.path);
      },
      onErrorBuilder: (context, controller) {
        return Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              const Text(
                "Camera permission denied \nPlease give permission.",
                textAlign: TextAlign.center,
              ),
              SizedBox(height: 15),
              MaterialButton(
                color: Colors.blue,
                onPressed: () async {
                  // add this for request permission
                  await controller.requestPermission();
                },
                child: Row(
                  mainAxisSize: MainAxisSize.min,
                  children: [
                    const Icon(
                      Icons.verified_user_rounded,
                      color: Colors.white,
                    ),
                    SizedBox(width: 5),
                    const Text(
                      "Give Permission",
                      style: TextStyle(
                          color: Colors.white, fontWeight: FontWeight.w700),
                    ),
                  ],
                ),
              )
            ],
          ),
        );
      },
    }, 
    child: Container(),
 );

Android Integration

Add the following to AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA"/>

In app/build.grade set minimum SDK version

minSdkVersion 21

IOS Integration

Add the following to info.plist:

<key>NSCameraUsageDescription</key>
<string>This app needs access camera when open</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access microphone when open</string>

camera_extended's People

Watchers

cyansoft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.