stringToBytes method

int stringToBytes(
  1. String data
)

Implementation

int stringToBytes(String data) {
  final bytes = utf8.encode(data);
  final size = Uint8List.fromList(bytes);
  return size.lengthInBytes;
}