I am trying to emit a state more than one time because I am validating a form no need to add any thing on the constructor and make copyWith func etc..
so could you help me with other solutions?
class PersonUnValid extends PersonState {
const PersonUnValid();
@override
List<Object> get props => [];
}
void validate() {
personKey.currentState!.save();
if (Formz.validate(personForm.inputs) == FormzStatus.valid) {
emit(const PersonValid());
return;
}
emit(PersonUnValid());
}