Home > Enterprise >  Initalize a Future List in a bloc
Initalize a Future List in a bloc

Time:07-03

How can I initialize my Future<List<Pokemon>> in the super constructor ?

class PokedexBloc extends Bloc<PokedexEvent, Future<List<Pokemon>>> {
  PokedexBloc() : super(Future<Pokemon[]>()) { }
}

CodePudding user response:

You can't have a Future as a state. You'd have to use e.g. List<Pokemon>

  • Related