A Flutter package base from plugin camera & flutter_image_compress for compressing image.
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
- 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.
import 'package:camera_extended/camera_extended.dart';
CameraExtended(
quality: 80,
onCapture: (image) {
debugPrint(image!.path);
},
child: Container(),
);
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(),
);
Add the following to AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA"/>
In app/build.grade set minimum SDK version
minSdkVersion 21
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>