ApiRequest.fromUtf8 constructor

ApiRequest.fromUtf8({
  1. required int id,
  2. required String data,
})

Create a request using an encoded UTF-8 string as the data.

Implementation

factory ApiRequest.fromUtf8({
  required int id,
  required String data,
}) {
  return ApiRequest(id: id, data: Uint8List.fromList(utf8.encode(data)));
}