username validation fix

This commit is contained in:
2024-11-30 01:46:20 +02:00
parent 199b8ab08c
commit 7bb745268d
4 changed files with 16 additions and 13 deletions

View File

@@ -85,6 +85,8 @@ class _MIHHomeState extends State<MIHHome> {
);
void setAppsNewPersonal(List<MIHTile> tileList) {
ImageProvider logo = MzanziInnovationHub.of(context)!.theme.logoImage();
if (widget.signedInUser.fname == "") {
tileList.add(MIHTile(
videoID: "jFV3NN65DtQ",
@@ -94,10 +96,9 @@ class _MIHHomeState extends State<MIHHome> {
widget.signedInUser, widget.propicFile));
},
tileName: "Setup Profie",
tileIcon: Icon(
Icons.perm_identity,
color: getSec(),
size: 230,
tileIcon: Padding(
padding: const EdgeInsets.all(15.0),
child: Image(image: logo),
),
p: getPrim(),
s: getSec(),

View File

@@ -214,8 +214,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
}
bool isUsernameValid(String username) {
return RegExp(r'^(?=[a-zA-Z0-9._]{8,20}$)(?!.*[_.]{2})[^_.].*[^_.]$')
.hasMatch(username);
return RegExp(r'^[a-zA-Z][a-zA-Z0-9_]{5,19}$').hasMatch(username);
}
Future<void> submitForm() async {