导包
Widget getImg(String s, width) {
Uint8List bytes = base64.decode(s.replaceAll(RegExp(r'\s+'), ''));
Widget widget = Image.memory(
该代码片段展示了一个在Dart中将Base64编码的字符串解码为Uint8List,并创建一个适应指定宽度的ImageWidget的方法。它使用了base64.decode进行解码,然后通过Image.memory构建Widget,设置fit为BoxFit.cover确保图像按比例填充宽度。
导包
Widget getImg(String s, width) {
Uint8List bytes = base64.decode(s.replaceAll(RegExp(r'\s+'), ''));
Widget widget = Image.memory(
1万+
682
1694

被折叠的 条评论
为什么被折叠?