Hi,
Here is my states:
abstract class RegistrationFormState extends Equatable {
}
class InitialRegistrationFormState extends RegistrationFormState {
@override
List
List
}
class VerificationResult extends RegistrationFormState{
Prisoner prisonerDetails;
VerificationResult(this.prisonerDetails);
@override
List
}
My Bloc:
if(event is VerifyIDNumber){
print("Verifying id number: ${event.idNumber} of type ${event.idType}");
//state.currentStep=1;
yield VerificationLoading();
await Future.delayed(Duration(seconds: 2));
print("Future finished");
yield VerificationResult(Prisoner());
}
the line yield VerificationResult never causes layout to be rebuilt. is there something am doing wrong? Kindly assist.
Hi @kechkibet 馃憢
Thanks for opening an issue!
Can you please try updating your props getters to return an empty list of props like
@override
List get props => [];
For InitialRegistrationFormState and VerificationLoading? Thanks 馃憤
Hi,
Thanks for the quick response here is my state now:
class InitialRegistrationFormState extends RegistrationFormState {
@override
List
List
}
class VerificationResult extends RegistrationFormState{
Prisoner prisonerDetails;
VerificationResult(this.prisonerDetails);
@override
// TODO: implement props
List
}
Here is the log:
I/flutter (23478): Verifying id number: 12312312 of type ID
I/flutter (23478): Verification Loading
I/flutter (23478): Future finished
As you can see the future finishes but the yield doesnt get to ui. Still same issue.
@kechkibet can you provide a link to a sample app which illustrates the issue? Thanks!
Hi,
Turns out down the widget tree i was calling bloc.close(); on a dispose method. Turns out we need to close on the same widget that created it only.
Thanks sir.
Most helpful comment
Hi,
Turns out down the widget tree i was calling bloc.close(); on a dispose method. Turns out we need to close on the same widget that created it only.
Thanks sir.