Home > Enterprise >  What does class ClassName<int>{} means in Dart?
What does class ClassName<int>{} means in Dart?

Time:10-19

class MyBloc extends Bloc<MyEvent, MyState> {
  MyBloc() : super(StateA()) {
    on<EventA>((event, emit) => emit(StateA()));
    on<EventB>((event, emit) => emit(StateB()));
  }
}

How Bloc use <MyEvent, MyState> under the hood?

CodePudding user response:

I think you are searching for generics. Here is a good starting point:

https://dart.dev/guides/language/language-tour#generics

  • Related