isExtensionEnabled static method

Future<bool> isExtensionEnabled(
  1. String extensionId, {
  2. dynamic onSuccess(
    1. bool
    )?,
  3. dynamic onError(
    1. CometChatException excep
    )?,
})

Implementation

static Future<bool> isExtensionEnabled(String extensionId , {Function(bool )? onSuccess,
  Function(CometChatException excep)? onError}) async {

   try {
    final result = await channel.invokeMethod('isExtensionEnabled', {
      "extensionId": extensionId
    });
    if(onSuccess != null) onSuccess(result as bool);
    return result as bool;
   } on PlatformException catch (platformException) {
     if(onError != null) onError(CometChatException(platformException.code, platformException.details, platformException.message));
     return false;
   } catch (e) {
     debugPrint("Error: $e");
     if(onError != null) onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
   }
   return false;

}