import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import '../models/character.dart'; enum HomeStatus { initial, loading, loaded, error } class HomeState extends Equatable { final HomeStatus status; final List characters; final String errorMessage; const HomeState({ this.status = HomeStatus.initial, this.characters = const [], this.errorMessage = '', }); HomeState copyWith({ HomeStatus? status, List? characters, String? errorMessage, }) { return HomeState( status: status ?? this.status, characters: characters ?? this.characters, errorMessage: errorMessage ?? this.errorMessage, ); } @override List get props => [status, characters, errorMessage]; }