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 AmplifyAlreadyConfiguredException(
          AmplifyExceptionMessages.alreadyConfiguredDefaultMessage,
          recoverySuggestion:
              AmplifyExceptionMessages.alreadyConfiguredDefaultSuggestion);
    } else {
      throw AmplifyException.fromMap(Map<String, String>.from(e.details));
    }
  }
}