scanButtonPressed method

  1. @override
Future<void> scanButtonPressed()
override

Notify all plugins that the scan button was pressed.

Can only be called on the master.

Implementation

@override
Future<void> scanButtonPressed() async {
  if (!isMaster) {
    await CommunicationHelper.sendAndWait(
        this,
        Message(id, GeigerApi.masterId, MessageType.scanPressed,
            GeigerUrl(null, GeigerApi.masterId, 'scanPressed')));
  } else {
    await broadcastMessage(
        Message(GeigerApi.masterId, null, MessageType.scanPressed, null));
  }
}