camera_snap 0.1.0 copy "camera_snap: ^0.1.0" to clipboard
camera_snap: ^0.1.0 copied to clipboard

Capture image using the selfie camera or the back camera.

Camera Snap Plugin #

pub package

A Flutter plugin for iOS and Android to capture images from the camera without saving it to the gallery.

Installation #

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

iOS #

iOS 10.0 of higher is needed to use the camera plugin. If compiling for any version lower than 10.0 make sure to check the iOS version before using the camera plugin. For example, using the device_info plugin.

Add two rows to the ios/Runner/Info.plist:

  • one with the key Privacy - Camera Usage Description and a usage description.
  • and one with the key Privacy - Microphone Usage Description and a usage description.

Or in text format add the key:


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

Android #

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21

Usage #

void takePicture() async {
  final imagePath = await Navigator.of(context).push(
    MaterialPageRoute(
      builder: (_) =>
          CameraSnapScreen(
              cameraType: CameraType.front,
              appBar: AppBar(title: 'Take Picture')
          ),
    ),
  );
  if (imagePath == null) {
    print('cancelled');
    return;
  }
  
  print(imagePath);
}
2
likes
110
pub points
31%
popularity

Publisher

verified publisherdjade.net

Capture image using the selfie camera or the back camera.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

camera, flutter, permission_handler

More

Packages that depend on camera_snap