sendBytesPayload method
Send bytes Uint8List payload to endpoint
Convert String to Uint8List as follows -
String a = "hello";
Uint8List bytes = Uint8List.fromList(a.codeUnits);
Convert bytes Uint8List to String as follows -
String str = String.fromCharCodes(payload.bytes);
Implementation
Future<void> sendBytesPayload(String endpointId, Uint8List bytes) async {
return await _channel.invokeMethod(
'sendPayload',
<String, dynamic>{
'endpointId': endpointId,
'bytes': bytes,
},
);
}