channel property

MethodChannel channel
final

Implementation

static final MethodChannel channel = MethodChannel(_CHANNEL_NAME)
  ..setMethodCallHandler((call) async {
    if (call.method == _NOTIFY_UPDATE) {
      var stringData = call.arguments as String?;
      if (stringData == null)
        _serviceDataStreamController.sink.add(null);
      else {
        Map<String, dynamic> json = jsonDecode(stringData);
        _serviceDataStreamController.sink.add(json);
      }
    }
  });