ext_selection.dart 698 B

12345678910111213141516171819202122232425
  1. import 'package:eye_video/bizmodule/main/selections/model/selection_model.dart';
  2. extension ExtSelection on Selection {
  3. bool get isFollowCard =>
  4. type == 'followCard' &&
  5. data != null &&
  6. data.content != null &&
  7. data.content.data != null &&
  8. data.content.data.cover != null;
  9. bool get isSmallVideoCard =>
  10. type == 'videoSmallCard' && data != null && data.cover != null;
  11. bool get isHeaderCard =>
  12. type == 'textCard' &&
  13. data != null &&
  14. data.type == 'header5' &&
  15. data.text.isNotEmpty;
  16. bool get isSquareCard =>
  17. type == 'squareCardCollection' &&
  18. data != null &&
  19. data.header != null &&
  20. data.selectionList != null;
  21. }