add pin login and add pin code
This commit is contained in:
@@ -21,6 +21,7 @@ class User {
|
||||
String? preferCurrency;
|
||||
bool enablePinLogin;
|
||||
String? pinDigit;
|
||||
List<String> privileges = [];
|
||||
|
||||
String get initial =>
|
||||
name != null && name != "" ? name!.substring(0, 1) : "?";
|
||||
@@ -48,7 +49,9 @@ class User {
|
||||
String get getFcsUnseenCount =>
|
||||
fcsUnseenCount > 100 ? "99+" : fcsUnseenCount.toString();
|
||||
|
||||
List<String> privileges = [];
|
||||
// for pin login
|
||||
String? pinToken;
|
||||
bool get isPinLogin => pinToken!=null;
|
||||
|
||||
String get phone => phoneNumber != null && phoneNumber!.startsWith("959")
|
||||
? "0${phoneNumber!.substring(2)}"
|
||||
@@ -117,7 +120,9 @@ class User {
|
||||
userUnseenCount: map['user_unseen_count'] ?? 0,
|
||||
fcsUnseenCount: map['fcs_unseen_count'] ?? 0,
|
||||
preferCurrency: map['preferred_currency'],
|
||||
lastMessageTime: _date == null ? null : _date.toDate());
|
||||
lastMessageTime: _date == null ? null : _date.toDate(),
|
||||
enablePinLogin: map['enable_pin_login'] ?? false,
|
||||
pinDigit: map['pin'] ?? '');
|
||||
}
|
||||
|
||||
bool diffPrivileges(User another) {
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart' as vector;
|
||||
|
||||
class Privilege {
|
||||
String id;
|
||||
@@ -49,6 +50,8 @@ class Privilege {
|
||||
iconData = MaterialCommunityIcons.layers;
|
||||
} else if (this.id == privilege_report) {
|
||||
iconData = Feather.file_text;
|
||||
} else if (this.id == privilege_pin) {
|
||||
iconData = vector.MaterialCommunityIcons.account_lock_outline;
|
||||
} else {
|
||||
iconData = MaterialCommunityIcons.account_question;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user