sendMessage method
Sends a message to the Node.js process with an associated tag.
Platform-specific implementations must override this.
Implementation
@override
Future<void> sendMessage(String tag, String message) async {
try {
var data = {'tag': tag, 'message': message};
await _methodChannel.invokeMethod('sendMessage', {
'channel': _eventChannel.name,
'message': jsonEncode(data),
});
} on PlatformException catch (e) {
logger.e('Failed to send message: ${e.message}');
}
}