Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. class Data {
  2. String sId;
  3. String name;
  4. String category;
  5. String image;
  6. int iV;
  7. var decoded;
  8. Uint8List bytes ;
  9.  
  10. Data({this.sId, this.name, this.category, this.image, this.iV, this.bytes});
  11.  
  12. Data.fromJson(Map<String, dynamic> json) {
  13. sId = json['_id'];
  14. name = json['name'];
  15. category = json['category'];
  16. image = json['image'];
  17. iV = json['__v'];
  18. // decoded = Base64Decoder().convert(image);
  19. bytes = base64.decode(image);
  20. }
  21.  
  22. Container(
  23. margin: const EdgeInsets.symmetric(horizontal: 2.0),
  24. width: 100.0,
  25. height: 140.0,
  26. child:Image.memory('${data.bytes}'),
  27. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement