Tuesday, October 25, 2022

[FIXED] What does class ClassName<int>{} means in Dart?

Issue

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?


Solution

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

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



Answered By - Ozan Taskiran
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.