getMarketName static method

Future<String> getMarketName()

Implementation

static Future<String> getMarketName() async {
  const channel = BasicMessageChannel<dynamic>('io.github.wangyng.packet_ng_helper.getMarketName', StandardMessageCodec());

  final Map<String, dynamic> requestMap = {};
  final reply = await channel.send(requestMap);

  if (!(reply is Map)) {
    _throwChannelException();
  }

  final replyMap = Map<String, dynamic>.from(reply);
  if (replyMap['error'] != null) {
    final error = Map<String, dynamic>.from(replyMap['error']);
    _throwException(error);
    return '';
  } else {
    return replyMap["result"];
  }
}