Search Docs
Loading...
Skip to content

Configuration

In this example, we will show you how to make basic configurations for the mobile editor. The example is based on the Design Editor, however, it is exactly the same for all the other solutions.

Configuration#

The openEditor function allows for some further basic configuration of the editor.

EditorConfiguration#

All the basic configuration settings are part of the EditorConfiguration which is required to initialize the editor.

final settings = EditorSettings(
license:
"YOUR_LICENSE", // Get your license from https://img.ly/forms/free-trial, pass null for evaluation mode with watermark
baseUri: "YOUR_BASE_URI",
userId: "YOUR_USER_ID" // A unique string to identify your user/session
);
  • license - the license to activate the Engine with.
license:
"YOUR_LICENSE", // Get your license from https://img.ly/forms/free-trial, pass null for evaluation mode with watermark
  • baseUri - the base URI used by the engine for built-in assets like emoji and fallback fonts, and by the editor for its default and demo asset sources (stickers, filters, and more). The default value points at the versioned IMG.LY CDN https://cdn.img.ly/packages/imgly/cesdk-flutter/<version>/assets. For production use, we recommend downloading the assets, hosting them on your own server, and setting baseUri to your hosted location.
baseUri: "YOUR_BASE_URI",
  • 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 is nil.
userId: "YOUR_USER_ID" // A unique string to identify your user/session

EditorPreset#

  • preset - is used to determine which predefined editor variant you want to use - if any.
preset: EditorPreset.design,

Metadata#

  • metadata - can be used to provide any custom Map<String, dynamic> to the underlying native plugin which you can use for further custom handling.
metadata: {"MY_KEY": "MY_VALUE"}

Full Code#

Here’s the full code:

import "package:imgly_editor/imgly_editor.dart";
class BasicEditorSolution {
/// Opens the editor.
void openEditor() async {
final settings = EditorSettings(
license: "YOUR_LICENSE",
baseUri: "YOUR_BASE_URI",
userId: "YOUR_USER_ID"
);
final _ = await IMGLYEditor.openEditor(
preset: EditorPreset.design,
settings: settings,
metadata: {"MY_KEY": "MY_VALUE"}
);
}
}