Uint8List? stringToUint8List(String? data) { if (data == null) { return null; } return Uint8List.fromList(utf8.encode(data)); }