add update phone number and recovery email

This commit is contained in:
tzw
2025-01-14 17:10:10 +06:30
parent 21cf7a2517
commit ace3af1785
22 changed files with 1087 additions and 221 deletions

View File

@@ -22,6 +22,7 @@ class User {
bool enablePinLogin;
String? pinDigit;
List<String> privileges = [];
String? recoveryEmail;
String get initial =>
name != null && name != "" ? name!.substring(0, 1) : "?";
@@ -51,7 +52,7 @@ class User {
// for pin login
String? pinToken;
bool get isPinLogin => pinToken!=null;
bool get isPinLogin => pinToken != null;
String get phone => phoneNumber != null && phoneNumber!.startsWith("959")
? "0${phoneNumber!.substring(2)}"
@@ -62,21 +63,21 @@ class User {
bool get disabled => status != null && status == user_disabled_status;
String get share => "Your phone number:$phoneNumber";
User({
this.id,
this.name,
this.phoneNumber,
this.fcsID,
this.status,
this.privileges = const [],
this.lastMessage,
this.lastMessageTime,
this.userUnseenCount = 0,
this.fcsUnseenCount = 0,
this.preferCurrency,
this.enablePinLogin = false,
this.pinDigit,
});
User(
{this.id,
this.name,
this.phoneNumber,
this.fcsID,
this.status,
this.privileges = const [],
this.lastMessage,
this.lastMessageTime,
this.userUnseenCount = 0,
this.fcsUnseenCount = 0,
this.preferCurrency,
this.enablePinLogin = false,
this.pinDigit,
this.recoveryEmail});
factory User.fromJson(Map<String, dynamic> json) {
return User(