getCurrentConnectivity method

  1. @VoltronMethod(funcGetCurrentConnectivity)
bool getCurrentConnectivity(
  1. JSPromise promise
)

Implementation

@VoltronMethod(funcGetCurrentConnectivity)
bool getCurrentConnectivity(final JSPromise promise) {
  Connectivity().checkConnectivity().then((res) {
    var params = VoltronMap();
    params.push<String>("network_info", res.name.toUpperCase());
    promise.resolve(params);
  }).catchError((err) {
    promise.reject(err.toString());
  });
  return true;
}