In this example, we will show you how to initialize the Camera SDK’s mobile editor in your Flutter app. We also prepared a dedicated example application which you can checkout on GitHub.
Integration#
The openCamera function allows for some further basic configuration of the camera.
CameraSettings#
All the basic configuration settings are part of the EngineSettings which are required to initialize the camera.
license– the license to activate the Engine with.userID– an optional unique ID tied to your application’s user. This helps us accurately calculate monthly active users (MAU). Especially useful when one person uses the app on multiple devices with a sign-in feature, ensuring they’re counted once. Providing this aids in better data accuracy. The default value isnil.
const settings = CameraSettings( license: "YOUR_LICENSE", // Get your license from https://img.ly/forms/free-trial, pass null for evaluation mode with watermark userId: "YOUR_USER_ID", // A unique string to identify your user/session);Reactions#
You can optionally provide a video parameter which lets the user react to that video.
final result = await IMGLYCamera.openCamera(settings);print(result?.toJson());Full Code#
Here’s the full code for the camera integration:
camera_quickstart_solution.dart#
import 'package:imgly_camera/imgly_camera.dart';
class CameraQuickstartSolution { /// Opens the camera. void openCamera() async { const settings = CameraSettings( license: "YOUR_LICENSE", // Get your license from https://img.ly/forms/free-trial, pass null for evaluation mode with watermark userId: "YOUR_USER_ID", // A unique string to identify your user/session );
final result = await IMGLYCamera.openCamera(settings); print(result?.toJson()); }}That is all. For more than basic configuration, check out all the available configurations .