isAdmin method

  1. @override
Future<bool?> isAdmin(
  1. String userJid,
  2. String groupJID
)
override

This method is used to check if the user is admin in a group.

Implementation

@override
Future<bool?> isAdmin(String userJid, String groupJID) async {
  bool? response;
  try {
    response = await mirrorFlyMethodChannel.invokeMethod<bool>(
        'isAdmin', {"jid": userJid, "group_jid": groupJID});
    LogMessage.d("isAdmin Result ", " $response");
    return response;
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    return false;
  } on Exception catch (error) {
    LogMessage.d("Exception ", " $error");
    return false;
  }
}