startFeature method

Future<void> startFeature(
  1. String accessToken,
  2. AuthmeFeature feature, {
  3. int requestCode = 1001,
  4. bool needConfirm = true,
  5. bool isResultPageDisplayable = true,
  6. bool isResultEditable = true,
  7. bool isFraudIntroEnable = true,
})

Implementation

Future<void> startFeature(
    String accessToken,
    AuthmeFeature feature, {
      int requestCode = 1001,
      bool needConfirm = true,
      bool isResultPageDisplayable = true,
      bool isResultEditable = true,
      bool isFraudIntroEnable = true,
    }) async {
  try {
    await _channel.invokeMethod('startFeature', {
      'token': accessToken,
      'feature': feature.rawValue,
      'requestCode': requestCode,
      'config': {
        'needConfirm': needConfirm,
        'isResultPageDisplayable': isResultPageDisplayable,
        'isResultEditable': isResultEditable,
        'isFraudIntroEnable': isFraudIntroEnable,
      }
    });
  } on PlatformException catch (e) {
    log("Failed to start feature: ${e.message}");
    rethrow;
  }
}