addPlugin method

  1. @override
Future<void> addPlugin()

Called when the plugin is added to the category.

Implementation

@override
Future<void> addPlugin() async {
  try {
    return await _channel.invokeMethod('addPlugin');
  } on PlatformException catch (e) {
    if (e.code == 'AmplifyAlreadyConfiguredException') {
      throw const AmplifyAlreadyConfiguredException(
        AmplifyExceptionMessages.alreadyConfiguredDefaultMessage,
        recoverySuggestion:
            AmplifyExceptionMessages.missingRecoverySuggestion,
      );
    } else {
      throw AmplifyException.fromMap((e.details as Map).cast());
    }
  }
}