isAIFeatureEnabled static method
Implementation
static Future<void> isAIFeatureEnabled(String feature, {required Function(bool isEnabled) onSuccess, required Function(CometChatException e) onError}) async{
try{
if(feature.isEmpty){
onError(CometChatException(ErrorCode.errorEmptyFeature, ErrorMessage.errorEmptyFeature, ErrorMessage.errorEmptyFeature));
}else{
final arguments = {
"feature": feature
};
final result = await channel.invokeMethod('isAIFeatureEnabled', arguments);
onSuccess(result);
}
} on PlatformException catch (e) {
debugPrint("Error: $e");
onError(CometChatException(e.code, e.details, e.message));
} catch (e) {
debugPrint("Error: $e");
onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
}
}