readScore method

Future<int> readScore(
  1. String score
)
override

Implementation

Future<int> readScore(String score) async {
  Map<String, String> m = {
    MessageTag.MESSAGE_TYPE: MessageType.READ_SCORE,
    MessageTag.MESSAGE_CONTENT: score,
  };

  ReceivePort rport = new ReceivePort();
  _sendPort.send([m, rport.sendPort]);

  int res = 0;
  await for (var msg in rport) {
    res = int.parse(msg[0][MessageTag.MESSAGE_CONTENT]);
    break;
  }
  rport.close();
  return res;
}