Guest User

Untitled

a guest
Jan 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import 'package:equatable/equatable.dart';
  2.  
  3. import 'package:common_github_search/common_github_search.dart';
  4.  
  5. abstract class GithubSearchState extends Equatable {
  6. GithubSearchState([List props = const []]) : super(props);
  7. }
  8.  
  9. class SearchStateEmpty extends GithubSearchState {
  10. @override
  11. String toString() => 'SearchStateEmpty';
  12. }
  13.  
  14. class SearchStateLoading extends GithubSearchState {
  15. @override
  16. String toString() => 'SearchStateLoading';
  17. }
  18.  
  19. class SearchStateSuccess extends GithubSearchState {
  20. final List<SearchResultItem> items;
  21.  
  22. SearchStateSuccess(this.items) : super([items]);
  23.  
  24. @override
  25. String toString() => 'SearchStateSuccess { items: ${items.length} }';
  26. }
  27.  
  28. class SearchStateError extends GithubSearchState {
  29. final String error;
  30.  
  31. SearchStateError(this.error) : super([error]);
  32.  
  33. @override
  34. String toString() => 'SearchStateError';
  35. }
Add Comment
Please, Sign In to add comment