code property
latefinal
TextFieldState of the UserPassword input.
Implementation
late final TextFieldState code = TextFieldState(
onChanged: (s) => s.error.value = null,
onSubmitted: (s) async {
final code = ConfirmationCode.tryParse(s.text);
if (code == null) {
s.error.value = 'err_wrong_recovery_code'.l10n;
} else {
s.editable.value = false;
s.status.value = RxStatus.loading();
try {
await _myUserService.deleteUserEmail(email, confirmation: code);
pop?.call();
s.clear();
} on DeleteUserEmailException catch (e) {
s.error.value = e.toMessage();
} catch (e) {
s.resubmitOnError.value = true;
s.error.value = 'err_data_transfer'.l10n;
s.unsubmit();
rethrow;
} finally {
s.editable.value = true;
s.status.value = RxStatus.empty();
}
}
},
);