Closed jassirr closed 7 months ago
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
State MyState extends Equatable {
int value;
void getValue() { return state.value; }
} class MyBloc extends Bloc<MyEvent,MyState> { MyBloc() : super(MyState()) {
}
someFunction(event, emitter) { emit(state.copyWith(status: status.loading)); int value = state.getValue(); }
Expected behavior I want to mock this getValue function in my State class to in blocTest
Screenshots If applicable, add screenshots to help explain your problem.
Logs Run flutter analyze and attach any output of that command below. If there are any analysis errors, try resolving them before filing this issue.
flutter analyze
Paste the output of running flutter doctor -v here.
flutter doctor -v
Additional context Add any other context about the problem here.
You can use seed in blocTest to set the bloc’s state to whatever you like before adding events. Hope that helps!
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
State MyState extends Equatable {
int value;
void getValue() { return state.value; }
} class MyBloc extends Bloc<MyEvent,MyState> { MyBloc() : super(MyState()) {
}
someFunction(event, emitter) { emit(state.copyWith(status: status.loading)); int value = state.getValue(); }
}
Expected behavior I want to mock this getValue function in my State class to in blocTest
Screenshots If applicable, add screenshots to help explain your problem.
Logs Run
flutter analyze
and attach any output of that command below. If there are any analysis errors, try resolving them before filing this issue.Paste the output of running
flutter doctor -v
here.Additional context Add any other context about the problem here.