36 lines
698 B
Dart
36 lines
698 B
Dart
|
import 'package:bloc/bloc.dart';
|
||
|
import 'package:equatable/equatable.dart';
|
||
|
import '../../../data/dtos/hero_dto.dart';
|
||
|
import '../../../data/repositories/hero_repository.dart';
|
||
|
|
||
|
|
||
|
// States
|
||
|
abstract class HeroListState extends Equatable {
|
||
|
@override
|
||
|
List<Object> get props => [];
|
||
|
}
|
||
|
|
||
|
class HeroListInitial extends HeroListState {}
|
||
|
|
||
|
class HeroListLoading extends HeroListState {}
|
||
|
|
||
|
class HeroListLoaded extends HeroListState {
|
||
|
final List<HeroDto> heroes;
|
||
|
|
||
|
HeroListLoaded(this.heroes);
|
||
|
|
||
|
@override
|
||
|
List<Object> get props => [heroes];
|
||
|
}
|
||
|
|
||
|
class HeroListError extends HeroListState {
|
||
|
final String message;
|
||
|
|
||
|
HeroListError(this.message);
|
||
|
|
||
|
@override
|
||
|
List<Object> get props => [message];
|
||
|
}
|
||
|
|
||
|
|