Skip to main content

Configure Blur

PhotoEditor SDK supports configuring the focus tool allowing flexible adaptation to different needs and use cases. For a detailed explanation of how to configure different editor views, refer to this guide.


The set of available adjust tools can be configured by assigning an array to the FocusOptions.items property. By default, all focus modes are enabled, in our example, we only want to provide radial and linear blurs.

import 'package:catalog/models/code_example.dart';
import 'package:imgly_sdk/imgly_sdk.dart';
import 'package:photo_editor_sdk/photo_editor_sdk.dart';
class PhotoFocusConfigurationExample extends CodeExample {
void invoke() async {
// Create [FocusOptions] to configure the focus tool.
final focusOptions = FocusOptions(
// By default the editor shows all available adjust tools.
// For this example, the editor should only show a small selection
// of them.
items: [
// Create a [Configuration] instance.
final configuration = Configuration(focus: focusOptions);
try {
// Open the photo editor and handle the export as well as any occurring errors.
final result = await PESDK.openEditor(
image: "assets/LA.jpg", configuration: configuration);
if (result != null) {
// The user exported a new photo successfully and the newly generated photo is located at `result.image`.
} else {
// The user tapped on the cancel button within the editor.
} catch (error) {
// There was an error generating the image.