Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

An open source camera Flutter plugin to handle Android / iOS camera

  Overview

Flutter plugin to add Camera support inside your project.

CamerAwesome include a lot of useful features like:

  Installation and usage

Set permissions

<key>NSCameraUsageDescription</key>
<string>Your own description</string>

Import the package

import 'package:camerawesome/camerawesome_plugin.dart';

Define notifiers (if needed) & controller

ValueNotifier is a usefull change notifier from Flutter framework. It fires an event on all listener when value changes. Take a look here for ValueNotifier doc

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
  // [...]
  // Notifiers
  ValueNotifier<CameraFlashes> _switchFlash = ValueNotifier(CameraFlashes.NONE);
  ValueNotifier<Sensors> _sensor = ValueNotifier(Sensors.BACK);
  ValueNotifier<Size> _photoSize = ValueNotifier(null);

  // Controller
  PictureController _pictureController = new PictureController();
  // [...]
}

If you want to change a config, all you need is setting the value. CameraAwesome will handle the rest.

Example:

_switchFlash.value = CameraFlashes.AUTO

Create your camera

// [...]
@override
  Widget build(BuildContext context) {
    return CameraAwesome(
      testMode: false,
      onPermissionsResult: (bool result) { }
      selectDefaultSize: (List<Size> availableSizes) => Size(1920, 1080),
      onCameraStarted: () { },
      onOrientationChanged: (CameraOrientations newOrientation) { },
      zoom: 0.64,
      sensor: _sensor,
      photoSize: _photoSize,
      switchFlashMode: _switchFlash,
      orientation: DeviceOrientation.portraitUp,
      fitted: true,
    );
  };
// [...]

Reveal parameters list

Take a photo 

await _pictureController.takePicture('THE_IMAGE_PATH/myimage.jpg');

  Tested devices

CamerAwesome was developed to support most devices on the market but some feature can’t be fully functional. You can check if your device support all feature by clicking bellow.

Feel free to contribute to improve this compatibility list.Reveal grid

  Our goals

Feel free to help by submitting PR !

Download Flutter Camera Plugin source code on GitHub

https://github.com/Apparence-io/camera_awesome

Check out the implementation details on PUB

https://pub.dev/packages/camerawesome

Exit mobile version