start method

  1. @override
Future<IDCheckioResult> start(
  1. IDCheckioParams params,
  2. OnlineContext? onlineContext,
  3. IDCheckTheme? theme
)
override

Implementation

@override
Future<IDCheckioResult> start(IDCheckioParams params, OnlineContext? onlineContext, IDCheckTheme? theme) async {
  try {
    String json = await (methodChannel.invokeMethod('start', <String, dynamic>{
      'params': params.toJson(),
      if (onlineContext != null) 'onlineContext': "${onlineContext.toJson()}" else 'onlineContext': null,
      if (theme != null) 'theme': "${theme.toJson()}" else 'theme': null
    }));
    IDCheckioResult result = IDCheckioResult.fromJson(jsonDecode(json));
    return result;
  } on PlatformException catch (e) {
    throw PlatformException(code: "CAPTURE_FAILED", message: e.message);
  }
}