|
|
|
|
@ -16,7 +16,6 @@ import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
DrAppToastMsg toastMsg = DrAppToastMsg();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class KnownUserLogin extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_KnownUserLoginState createState() => _KnownUserLoginState();
|
|
|
|
|
@ -28,9 +27,10 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
|
|
|
|
|
|
|
|
|
|
String _authorized = "not Authorized";
|
|
|
|
|
bool _isAuthenticating = false;
|
|
|
|
|
Future<String> _loggedUserFuture;
|
|
|
|
|
Future _loggedUserFuture;
|
|
|
|
|
var _loggedUser;
|
|
|
|
|
int _loginType;
|
|
|
|
|
int _loginType = 1;
|
|
|
|
|
Future _loginTypeFuture;
|
|
|
|
|
|
|
|
|
|
Map _loginTypeMap = {
|
|
|
|
|
1: {
|
|
|
|
|
@ -41,8 +41,14 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
|
|
|
|
|
"name": "FingerPrint",
|
|
|
|
|
'imageUrl': 'assets/images/verification_fingerprint_lg_icon.png'
|
|
|
|
|
},
|
|
|
|
|
3: {"name": "Face", 'imageUrl': 'assets/images/verification_faceid_lg_icon.png'},
|
|
|
|
|
4: {"name": "WhatsApp", 'imageUrl': 'assets/images/verification_whatsapp_lg_icon.png'}
|
|
|
|
|
3: {
|
|
|
|
|
"name": "Face",
|
|
|
|
|
'imageUrl': 'assets/images/verification_faceid_lg_icon.png'
|
|
|
|
|
},
|
|
|
|
|
4: {
|
|
|
|
|
"name": "WhatsApp",
|
|
|
|
|
'imageUrl': 'assets/images/verification_whatsapp_lg_icon.png'
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Future<void> getSharedPref() async {
|
|
|
|
|
@ -61,14 +67,13 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
getSharedPref();
|
|
|
|
|
AuthProvider authProv = Provider.of<AuthProvider>(context);
|
|
|
|
|
selectDeviceImei(authProv);
|
|
|
|
|
|
|
|
|
|
return FutureBuilder(
|
|
|
|
|
future: _loggedUserFuture,
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
|
|
|
|
|
future: Future.wait([_loginTypeFuture,_loggedUserFuture]),
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
|
|
|
|
switch (snapshot.connectionState) {
|
|
|
|
|
case ConnectionState.waiting:
|
|
|
|
|
return DrAppCircularProgressIndeicator();
|
|
|
|
|
@ -288,12 +293,13 @@ _authenticate(){
|
|
|
|
|
Future<void> _authenticateBySMS() {
|
|
|
|
|
print('_authenticateBySMS');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> _authenticateByFace() {
|
|
|
|
|
print('_authenticateByFace');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> _authenticateByWhatsApp() {
|
|
|
|
|
print('_authenticateByWhatsApp');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> _getAvailableBiometrics() async {
|
|
|
|
|
@ -321,9 +327,9 @@ Future<void> _authenticateByWhatsApp(){
|
|
|
|
|
selectDeviceImei(AuthProvider authProv) {
|
|
|
|
|
sharedPref.getString('platformImei').then((imei) {
|
|
|
|
|
var imeiModel = {'IMEI': imei};
|
|
|
|
|
authProv.selectDeviceImei(imeiModel).then((res) {
|
|
|
|
|
_loginTypeFuture = authProv.selectDeviceImei(imeiModel).then((res) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
_loginType = 4;//res['SELECTDeviceIMEIbyIMEI_List'][0]['LogInType'];
|
|
|
|
|
_loginType = 2; //res['SELECTDeviceIMEIbyIMEI_List'][0]['LogInType'];
|
|
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
print(_loginType.toString());
|
|
|
|
|
|