checkOutsideNet static method

dynamic checkOutsideNet({
  1. dynamic callBack(
    1. bool isOutsideNet
    )?,
})

Implementation

static checkOutsideNet({Function(bool isOutsideNet)? callBack}) {
  BasicMessageChannel messageChannel = const BasicMessageChannel(
      messageForWifiChannelID, StandardMessageCodec());
  Map map = {'wifiName': '', 'wifiPassword': '', 'operation': 'check'};
  messageChannel.send(map);

  messageChannel.setMessageHandler((message) async {
    bool isOutSide = message["isOutside"];
    if (callBack != null) {
      callBack(isOutSide);
    }
  });
}