Hibok
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

45 rader
996 B

  1. import 'package:flutter/material.dart';
  2. import './constants.dart';
  3. enum Device { MAC, WIN }
  4. class Conversation {
  5. final String avatar;
  6. final String title;
  7. final Color titleColor;
  8. final String desc;
  9. final String updateAt;
  10. final int unreadMsgCount;
  11. final bool dispalyDot;
  12. const Conversation(
  13. {@required this.avatar,
  14. @required this.title,
  15. this.titleColor: AppColors.TitleColor,
  16. this.desc,
  17. @required this.updateAt,
  18. this.unreadMsgCount: 0,
  19. this.dispalyDot: false})
  20. : assert(avatar != null),
  21. assert(title != null),
  22. assert(updateAt != null);
  23. bool isAvatarFromNet() {
  24. if (this.avatar.indexOf('http') == 0 || this.avatar.indexOf('https') == 0) {
  25. return true;
  26. }
  27. return false;
  28. }
  29. }
  30. class ConversationPageData {
  31. final Device device;
  32. final List<Conversation> conversations;
  33. const ConversationPageData({
  34. this.device,
  35. this.conversations,
  36. });
  37. }