convert a String of “uint8list” to a Unit8List

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


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> orUint8ListtoString`


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.

Popular posts from this blog

Visual Studio Code: How to configure includePath for better IntelliSense results

Spring cloud config client Could not locate PropertySource

Makefile test if variable is not empty