createPage static method

Future<Page> createPage(
  1. Uri originalImageFileUri,
  2. bool shouldDetectDocument
)

Creates a page from an image file URI. The given image will be used as ORIGINAL image. Use the shouldDetectDocument flag to specify whether the auto-document detection should be performed and the (cropped) DOCUMENT image should be created. return Page

Implementation

static Future<Page> createPage(
    Uri originalImageFileUri, bool shouldDetectDocument) async {
  try {
    var arguments = {
      'originalImageFileUri': originalImageFileUri.toString(),
      'shouldDetectDocument': shouldDetectDocument
    };
    final pageJson = await _channel.invokeMethod('createPage', arguments);
    var decoded = jsonDecode(pageJson);
    return Page.fromJson(decoded);
  } catch (e) {
    Logger.root.severe(e);
    rethrow;
  }
}