conversation.dart 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. import '../common/style/style.dart';
  2. class Conversation {
  3. String avatar;
  4. String title;
  5. int titleColor;
  6. String des;
  7. String updateAt;
  8. bool isMute;
  9. int unreadMsgCount;
  10. bool displayDot;
  11. int groupId;
  12. String userId;
  13. int type;
  14. bool isAvatarFromNet() {
  15. if(this.avatar.indexOf('http') == 0 || this.avatar.indexOf('https') == 0) {
  16. return true;
  17. }
  18. return false;
  19. }
  20. Conversation({
  21. this.avatar,
  22. this.title,
  23. this.titleColor : AppColors.TitleColor,
  24. this.des,
  25. this.updateAt,
  26. this.isMute : false,
  27. this.unreadMsgCount : 0,
  28. this.displayDot : false,
  29. this.groupId,
  30. this.userId,
  31. this.type
  32. }) : assert(avatar != null),
  33. assert(title != null),
  34. assert(updateAt != null);
  35. static List<Conversation> mockConversations = [
  36. new Conversation(
  37. avatar: 'assets/images/temporary/avator2.png',
  38. title: '[模拟数据]文件传输助手',
  39. des: '[模拟数据]',
  40. updateAt: '19:56',
  41. unreadMsgCount: 0,
  42. displayDot: true,
  43. groupId: 000000,
  44. userId:"000000",
  45. type: 1
  46. ),
  47. new Conversation(
  48. avatar: 'assets/images/temporary/avator4.png',
  49. title: '[模拟数据]腾讯新闻',
  50. des: '[模拟数据]豪车与出租车刮擦 俩车主划拳定责',
  51. updateAt: '17:20',
  52. groupId: 000000,
  53. userId:"000000",
  54. type: 1
  55. ),
  56. new Conversation(
  57. avatar: 'assets/images/temporary/avator3.png',
  58. title: '[模拟数据]微信游戏',
  59. titleColor: 0xff586b95,
  60. des: '[模拟数据]25元现金助力开学季!',
  61. updateAt: '17:12',
  62. groupId: 000000,
  63. userId:"000000",
  64. type: 1
  65. ),
  66. new Conversation(
  67. avatar: 'https://randomuser.me/api/portraits/men/10.jpg',
  68. title: '[模拟数据]汤姆丁',
  69. des: '[模拟数据]今晚要一起去吃肯德基吗?',
  70. updateAt: '17:56',
  71. isMute: true,
  72. unreadMsgCount: 0,
  73. groupId: 000000,
  74. userId:"000000",
  75. type: 1
  76. ),
  77. // new Conversation(
  78. // avatar: 'https://randomuser.me/api/portraits/women/10.jpg',
  79. // title: 'Tina Morgan',
  80. // des: '晚自习是什么来着?你知道吗,看到的话赶紧回复我',
  81. // updateAt: '17:58',
  82. // isMute: false,
  83. // unreadMsgCount: 0,
  84. // groupId: 000000,
  85. // userId:"000000",
  86. // type: 1
  87. // ),
  88. // new Conversation(
  89. // avatar: 'assets/images/ic_fengchao.png',
  90. // title: '蜂巢智能柜',
  91. // titleColor: 0xff586b95,
  92. // des: '喷一喷,竟比洗牙还神奇!5秒钟还你一个漂亮洁白的口腔。',
  93. // updateAt: '17:12',
  94. // groupId: 000000,
  95. // userId:"000000",
  96. // type: 1
  97. // ),
  98. // new Conversation(
  99. // avatar: 'https://randomuser.me/api/portraits/women/57.jpg',
  100. // title: 'Lily',
  101. // des: '今天要去运动场锻炼吗?',
  102. // updateAt: '昨天',
  103. // isMute: false,
  104. // unreadMsgCount: 0,
  105. // groupId: 000000,
  106. // userId:"000000",
  107. // type: 1
  108. // ),
  109. // new Conversation(
  110. // avatar: 'https://randomuser.me/api/portraits/men/10.jpg',
  111. // title: '汤姆丁',
  112. // des: '今晚要一起去吃肯德基吗?',
  113. // updateAt: '17:56',
  114. // isMute: true,
  115. // unreadMsgCount: 0,
  116. // ),
  117. // new Conversation(
  118. // avatar: 'https://randomuser.me/api/portraits/women/10.jpg',
  119. // title: 'Tina Morgan',
  120. // des: '晚自习是什么来着?你知道吗,看到的话赶紧回复我',
  121. // updateAt: '17:58',
  122. // isMute: false,
  123. // unreadMsgCount: 0,
  124. // groupId: 000000,
  125. // userId:"000000",
  126. // type: 1
  127. // ),
  128. // new Conversation(
  129. // avatar: 'https://randomuser.me/api/portraits/women/57.jpg',
  130. // title: 'Lily',
  131. // des: '今天要去运动场锻炼吗?',
  132. // updateAt: '昨天',
  133. // isMute: false,
  134. // unreadMsgCount: 0,
  135. // groupId: 000000,
  136. // userId:"000000",
  137. // type: 1
  138. // ),
  139. // new Conversation(
  140. // avatar: 'https://randomuser.me/api/portraits/men/10.jpg',
  141. // title: '汤姆丁',
  142. // des: '今晚要一起去吃肯德基吗?',
  143. // updateAt: '17:56',
  144. // isMute: true,
  145. // unreadMsgCount: 0,
  146. // groupId: 000000,
  147. // userId:"000000",
  148. // type: 1
  149. // ),
  150. // new Conversation(
  151. // avatar: 'https://randomuser.me/api/portraits/women/10.jpg',
  152. // title: 'Tina Morgan',
  153. // des: '晚自习是什么来着?你知道吗,看到的话赶紧回复我',
  154. // updateAt: '17:58',
  155. // isMute: false,
  156. // unreadMsgCount: 0,
  157. // groupId: 000000,
  158. // userId:"000000",
  159. // type: 1
  160. // ),
  161. // new Conversation(
  162. // avatar: 'https://randomuser.me/api/portraits/women/57.jpg',
  163. // title: 'Lily',
  164. // des: '今天要去运动场锻炼吗?',
  165. // updateAt: '昨天',
  166. // isMute: false,
  167. // unreadMsgCount: 0,
  168. // groupId: 000000,
  169. // userId:"000000",
  170. // type: 1
  171. // )
  172. ];
  173. }