onDataReceived method Null safety

  1. @override
void onDataReceived(
  1. Uint8List data
)

Implementation

@override
void onDataReceived(Uint8List data) {
  //print('onData: [${String.fromCharCodes(data).replaceAll("\r\n", "<CRLF>\n")}]');
  _uint8listReader.add(data);
  final lines = _uint8listReader.readLines();
  if (lines != null) {
    onServerResponse(lines);
  }
}