I need to pass types to a function that builds specific states stored in a list. For example, I have this list:
List<Type> types = [AppBloc,AppState];
Is it possible in Dart to pass these types to the following function, where A = types[0] = AppBloc and B = types[1] = AppState?
Widget genericBlocBuilder<A extends StateStreamable<B>, B>({
required Widget child,
}) {
return BlocBuilder<A, B>(
builder: (context, state) => child,
);
}