Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. import 'package:prepmilecookingfeed/model/activity_feed.dart';
  2. import 'package:cloud_firestore/cloud_firestore.dart';
  3.  
  4. class Activity_Home_Mobile {
  5. final DocumentReference reference;
  6. final List<String> activity_feed;
  7. final String title;
  8.  
  9.  
  10. Activity_Home_Mobile.fromMap(Map<String, dynamic> map, {this.reference})
  11. : assert(map['title'] != null),
  12. assert(map['activity_feed'] != null),
  13. title = map['title'],
  14. activity_feed = map['activity_feed'];
  15.  
  16.  
  17. Activity_Home_Mobile.fromSnapshot(DocumentSnapshot snapshot)
  18. : this.fromMap(snapshot.data, reference: snapshot.reference);
  19.  
  20. // @override
  21. // String toString() => "Record<$name:$votes>";
  22.  
  23. }
  24.  
  25. final List<String> activity_feed;
  26. expected => final List<Article> activity_feed;
  27.  
  28. class Article {
  29. final String name;
  30. final String desc;
  31. final String likes;
  32. final String picture_id;
  33. final String quick_desc;
  34. final String steps;
  35. final DocumentReference reference;
  36.  
  37. Article.fromMap(Map<String, dynamic> map, {this.reference})
  38. : assert(map['name'] != null),
  39. assert(map['votes'] != null),
  40. name = map['name'],
  41. likes = map['name'],
  42. desc = map['name'],
  43. picture_id = map['name'],
  44. quick_desc = map['name'],
  45. steps = map['votes'];
  46.  
  47. Article.fromSnapshot(DocumentSnapshot snapshot)
  48. : this.fromMap(snapshot.data, reference: snapshot.reference);
  49.  
  50. // @override
  51. // String toString() => "Record<$name:$votes>";
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement