That is plugin contains native access camera your device, Android and iOS. You can take a photo or record video. Return file.
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
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>
Camera(
orientationEnablePhoto: CameraOrientation.landscape,)
Camera(
orientationEnablePhoto: CameraOrientation.portrait,)
Camera(
orientationEnablePhoto: CameraOrientation.all,) // isDefault
You can add widget top stack camera, Container, Images.png.
Camera(
imageMask: Widget
)
Camera(
mode: CameraMode.normal or CameraMode.fullscreen
)
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()));
})
Camera(
onFile: (File file) => file;
)
You cand record video and preview.
yourFunction () async {
File file = await Navigator.push(context, MaterialPageRoute(builder: (context) => Video()));
})
Add package in pubspec.yaml
camera_camera: current_version
Import this in your page
import 'package:camera_camera/camera_camera.dart';
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.