Language:
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.
items
#
items
#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.
File:
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: [FocusTool.none,FocusTool.radial,FocusTool.linear,]);// 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`.print(result.image);} else {// The user tapped on the cancel button within the editor.return;}} catch (error) {// There was an error generating the image.print(error);}}}