camera_camera 1.0.26

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

Camera_Camera #

That is plugin contains native access camera your device, Android and iOS. You can take a photo or record video. Return file.

Android #

You need add in AndroidManifest.xml

<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

You need add in app/build.gradle

minSdkVersion 21

IOS #

You need add in info.plist

    	<key>NSCameraUsageDescription</key>
      <string>Can I use the camera please?</string>
      <key>NSMicrophoneUsageDescription</key>
      <string>Can I use the mic please?</string>

Mode Photo #

Enable Photo #


Camera(
 orientationEnablePhoto: CameraOrientation.landscape,)

Camera(
 orientationEnablePhoto: CameraOrientation.portrait,)

Camera(
 orientationEnablePhoto: CameraOrientation.all,) // isDefault

Mask Camera #

You can add widget top stack camera, Container, Images.png.


Camera(
 imageMask: Widget
)

Screen Mode #


Camera(
 
 mode: CameraMode.normal or CameraMode.fullscreen
)

Mode Focus #

You can add Rectangle , Circle or Square Focus

Camera(
       mode: CameraMode.normal,
      imageMask: CameraFocus.rectangle(
                color: Colors.black.withOpacity(0.5),
                ),
     )

You can take a photo and edit.


yourFunction () async {

File file = await  Navigator.push(context, MaterialPageRoute(builder: (context) => Camera()));

})

Other mode getFile #


Camera(
  onFile: (File file) => file;
)

Mode Video #

You cand record video and preview.


yourFunction () async {

File file = await  Navigator.push(context, MaterialPageRoute(builder: (context) => Video()));

})

Installation #

Add package in pubspec.yaml


camera_camera: current_version

Usage #

Import this in your page


import  'package:camera_camera/camera_camera.dart';

Contributing #

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License #

MIT

1.0.26 #

  • Migrate from screen to wakelock.

1.0.24 #

  • Update interval for use path_provider

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  camera_camera: ^1.0.26

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:camera_camera/camera_camera.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Nov 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/page/bloc/bloc_camera.dart.

Run flutter format to format lib/page/bloc/bloc_camera.dart.

Format lib/page/bloc/bloc_video.dart.

Run flutter format to format lib/page/bloc/bloc_video.dart.

Format lib/page/camera.dart.

Run flutter format to format lib/page/camera.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/page/video.dart (Run flutter format to format lib/page/video.dart.)
  • lib/shared/widgets/focus_widget.dart (Run flutter format to format lib/shared/widgets/focus_widget.dart.)
  • lib/shared/widgets/orientation_icon.dart (Run flutter format to format lib/shared/widgets/orientation_icon.dart.)
  • lib/shared/widgets/rotate_icon.dart (Run flutter format to format lib/shared/widgets/rotate_icon.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-30 points)

The version constraint in pubspec.yaml does not support the latest published versions for 3 dependencies (camera, native_device_orientation, rxdart).

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/gabulsavul was unreachable.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
camera ^0.4.3+2 0.4.3+2 0.5.6+3
flutter 0.0.0
native_device_orientation ^0.2.0 0.2.0 0.3.0
path_provider >=1.0.0 <2.0.0 1.4.4
rxdart ^0.22.0 0.22.6 0.23.0-dev.1
video_player ^0.10.0+4 0.10.3+1
wakelock ^0.1.3 0.1.3
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test