Language:
Show Editor
The PESDK
class is the main entry point for opening the editor and lets you open the editor with the callable static function PESDK.openEditor
as shown in this example.
Open the editor#
In order to load an image into the editor simply specify it as the named image
parameter inside the asynchronous PESDK.openEditor
function. In this example, we load a photo from the bundle into the editor.
Handle events#
Once the editor finishes, a PhotoEditorResult
is returned which contains the edited image at PhotoEditorResult.image
. If no result is returned, the user has canceled the editing process by clicking the cancel button inside the editor.
Next Steps#
File:
import 'package:catalog/models/code_example.dart';import 'package:photo_editor_sdk/photo_editor_sdk.dart';class ShowPhotoEditorExample extends CodeExample {void invoke() async {try {// Open the photo editor and handle the export as well as any occurring errors.final result = await PESDK.openEditor(image: "assets/LA.jpg");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 exported a new photo successfully and the newly generated photo is located at `result.image`.return;}} catch (error) {// The user exported a new photo successfully and the newly generated photo is located at `result.image`.print(error);}}}