logOut static method

void logOut(
  1. dynamic onSuccess(
    1. Device device
    )?,
  2. dynamic onError(
    1. ErrorModel error
    )?
)

Set Log out

Callback to get Device info Throw ErrorModel if there is some error during the processs

Implementation

static void logOut(Function(Device device)? onSuccess,
    Function(ErrorModel error)? onError) async {
  _indigitall
      .invokeMapMethod(_ACTION_LOGOUT)
      .then((value) => {
            if (value != null)
              {
                value.forEach((key, valueMap) {
                  if (key == _CALLBACK_LOGOUT) {
                    if (onSuccess != null) onSuccess(new Device(valueMap));
                  }
                })
              }
          })
      .catchError((error) => {
            if (error is PlatformException)
              {
                if (onError != null)
                  onError(ErrorModel(error.code, error.message))
              }
          });
}