convert a String of “uint8list” to a Unit8List


convert a String of “uint8list” to a Unit8List
I have a memory image stored in Sqllite converted to String with the toString() method, I want to convert it to Unit8List to display it inside a MemoryImage widget
1 Answer
1
codeUnits
gets you a List<int>
Uint8List.fromList(...)
converts List<int>
to Uint8List
String.fromCharCodes(...)
converts List<int> or
Uint8Listto
String`
codeUnits
List<int>
Uint8List.fromList(...)
List<int>
Uint8List
String.fromCharCodes(...)
List<int> or
to
List<int> list = 'xxx'.codeUnits;
Uint8List bytes = Uint8List.fromList(list);
String string = String.fromCharCodes(bytes);
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.