Tanks to Md. Yeasin Sheikh, i found a solution using ValueGetter, just updating the value inside copyWith methos like this
RegistrationState copyWith({
//change this
ValueGetter<DateTime?>? birthday,
String? email,
String? password,
}) {
return RegistrationState(
//and this
birthday: birthday != null ? birthday() : this.birthday
specialty: specialty ?? this.specialty,
email: email ?? this.email,
);
}
and then just calling it from cubit function like this
void updateBirthday(DateTime? birthday) {
emit(state.copyWith(birthday: () => birthday));
}