validateUsername function

String? validateUsername(
  1. String? username
)

Implementation

String? validateUsername(String? username) {
  if (username == null || username.isEmpty) {
    return "lbl_username_required";
  } else if (username.length < 3) {
    return "lbl_username_must_be_at_least_3_characters";
  }
  return null;
}