Guest User

Untitled

a guest
Oct 12th, 2018
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. "_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>'"
  2.  
  3. {"78":{"id":118,"first_name":"test","last_name":null,"email":"jignesh.test@gmail.com","phone":"","city":"null","state":"null","countrie_id":1,"location":"null","lat":"37.421998333333335","lng":"-122.08400000000002","image":"","role_id":3,"client_id":3,"coordinator_id":1,"sst_id":2,"created_at":"2018-10-08 10:59:18","updated_at":"2018-10-08 10:59:18","deleted_at":null,"status":0},
  4. "79":{"id":119,"first_name":"Rahul test","last_name":null,"email":"rahul.test@gmail.com","phone":"","city":"null","state":"null","countrie_id":1,"location":"null","lat":"19.2284","lng":"72.85813","image":"","role_id":3,"client_id":3,"coordinator_id":1,"sst_id":2,"created_at":"2018-10-08 11:19:14","updated_at":"2018-10-08 11:19:14","deleted_at":null,"status":0},
  5. "80":{"id":120,"first_name":"Customer Name","last_name":null,"email":"jjkkk@gmail.com","phone":"","city":"Mumbai","state":"Maharastra","countrie_id":1,"location":"virar","lat":"123","lng":"456","image":"images/customer_image/0hUSFUSqYAQTt57bVnnHjuQUOACECWzBOfJLWWa6.png","role_id":3,"client_id":1,"coordinator_id":1,"sst_id":2,"created_at":"2018-10-09 12:24:08","updated_at":"2018-10-09 14:03:07","deleted_at":null,"status":0},"status":"success","message":"List Fetched Successfully."}
  6.  
  7. Future<PosModelData> posList(){
  8. print('pos list api called');
  9. return networkUtil.post("http://192.168.0.46/api/v1/poslist",body:{
  10. "sstId":"2"
  11. }).then((response){
  12. if(response["status"]=="success"){
  13. print("List fetched");
  14. posLists=((response) as List).map((data)=>new PosModelData.fromJson(data)).toList();
  15. // print(response.toString());
  16. // print(posLists);
  17. }
  18. });
  19. }
  20.  
  21. class PosModelData {
  22. final String first_name;
  23. final String last_name;
  24. final String email;
  25.  
  26. PosModelData({this.first_name, this.last_name, this.email});
  27.  
  28. factory PosModelData.fromJson(Map json) {
  29. return new PosModelData(
  30. first_name: json['first_name'],
  31. last_name: json['last_name'],
  32. email: json['email'],
  33. );
  34. }
  35. }
Add Comment
Please, Sign In to add comment