enable method
void
enable({
- dynamic onSuccess(
- bool success
- dynamic onError(
- CometChatException exception
Method to populate data source
Implementation
void enable(
{Function(bool success)? onSuccess,
Function(CometChatException exception)? onError}) {
CometChat.isExtensionEnabled(getExtensionId(), onSuccess: (bool success) {
if (success) {
addExtension();
}
if (onSuccess != null) {
onSuccess(success);
}
}, onError: (CometChatException exception) {
if (onError != null) {
onError(exception);
}
if (kDebugMode) {
debugPrint(
"Exception occurred while enabling ${getExtensionId()} extension: ${exception.details}");
}
});
}