0 purchases
camera snap
Camera Snap Plugin #
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>
copied to clipboard
Android #
Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.
minSdkVersion 21
copied to clipboard
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);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.