about property

TextFieldState about
latefinal

MyUser.bio field state.

Implementation

late final TextFieldState about = TextFieldState(
  text: myUser.value?.bio?.val,
  onFocus: (s) async {
    s.error.value = null;

    if (s.text.isNotEmpty) {
      try {
        UserBio(s.text);
      } on FormatException catch (_) {
        s.error.value = 'err_incorrect_input'.l10n;
        return;
      }
    }

    final UserBio? bio = UserBio.tryParse(s.text);

    try {
      await updateUserBio(bio);
    } catch (_) {
      s.error.value = 'err_data_transfer'.l10n;
    }
  },
);