part of 'product_bloc.dart'; abstract class ProductsState { const ProductsState._(); factory ProductsState.loading() => const ProductsLoading(); factory ProductsState.error(String errorMessage) => ProductsError(errorMessage); factory ProductsState.loaded(List products) => ProductsLoaded(products); bool isLoading() => this is ProductsLoading; bool isLoaded() => this is ProductsLoaded; bool hasError() => this is ProductsError; T as() => this as T; } class ProductsLoading extends ProductsState { const ProductsLoading() : super._(); } class ProductsError extends ProductsState { final String errorMessage; const ProductsError(this.errorMessage) : super._(); } class ProductsLoaded extends ProductsState { final List products; const ProductsLoaded(this.products) : super._(); }