|
|
|
|
@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import '../google-analytics.dart';
|
|
|
|
|
|
|
|
|
|
class LoginRegistration{
|
|
|
|
|
static int loginMethod;
|
|
|
|
|
static int verificationMethod;
|
|
|
|
|
|
|
|
|
|
final GALogger logger;
|
|
|
|
|
LoginRegistration(this.logger);
|
|
|
|
|
@ -66,20 +68,29 @@ class LoginRegistration{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// R011:login_verify_otp | R009:registration_verification_option
|
|
|
|
|
verify_otp_method({@required int method, bool forRegistration = false}){
|
|
|
|
|
var verification_method = '';
|
|
|
|
|
if(method == 1) verification_method = 'sms';
|
|
|
|
|
if(method == 2) verification_method = 'fingerprint';
|
|
|
|
|
if(method == 3) verification_method = 'face id';
|
|
|
|
|
if(method == 4) verification_method = 'whatsapp';
|
|
|
|
|
|
|
|
|
|
verify_otp_method({bool forRegistration = false}){
|
|
|
|
|
if(forRegistration == false)
|
|
|
|
|
logger("login_verify_otp", parameters: {
|
|
|
|
|
'login_method' : verification_method
|
|
|
|
|
'login_method' : _getLoginMethod(),
|
|
|
|
|
'verification_method' : _getVerificationMethod(),
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
logger("registration_verification_option", parameters: {
|
|
|
|
|
'verification_method' : verification_method
|
|
|
|
|
'verification_method' : _getVerificationMethod()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// R011:login_verify_otp | R009:registration_verification_option
|
|
|
|
|
login_verfication({bool forRegistration = false}){
|
|
|
|
|
if(forRegistration == false)
|
|
|
|
|
logger("login_verfication", parameters: {
|
|
|
|
|
'login_method' : _getLoginMethod(),
|
|
|
|
|
'verification_method' : _getVerificationMethod(),
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
logger("login_varification_register", parameters: {
|
|
|
|
|
'login_method' : _getLoginMethod(),
|
|
|
|
|
'verification_method' : _getVerificationMethod(),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -94,14 +105,9 @@ class LoginRegistration{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// R012.1, R014.1
|
|
|
|
|
login_successful({@required int method}){
|
|
|
|
|
var verification_method = '';
|
|
|
|
|
if(method == 1) verification_method = 'sms';
|
|
|
|
|
if(method == 2) verification_method = 'fingerprint';
|
|
|
|
|
if(method == 3) verification_method = 'face id';
|
|
|
|
|
if(method == 4) verification_method = 'whatsapp';
|
|
|
|
|
login_successful(){
|
|
|
|
|
logger('login_successful', parameters: {
|
|
|
|
|
'login_method' : verification_method
|
|
|
|
|
'login_method' : _getVerificationMethod()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -112,9 +118,9 @@ class LoginRegistration{
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
login_fail({@required String method, error}){
|
|
|
|
|
login_fail({error}){
|
|
|
|
|
logger('login_unsuccessful', parameters: {
|
|
|
|
|
'login_method' : method,
|
|
|
|
|
'login_method' : loginMethod,
|
|
|
|
|
'error': error
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -128,4 +134,19 @@ class LoginRegistration{
|
|
|
|
|
login_with_other_account(){
|
|
|
|
|
logger('login_with_other_account');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_getLoginMethod(){
|
|
|
|
|
if(loginMethod == 1) return 'national id';
|
|
|
|
|
if(loginMethod == 2) return 'file number';
|
|
|
|
|
return 'otp';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String _getVerificationMethod(){
|
|
|
|
|
if(verificationMethod == 1) return 'sms';
|
|
|
|
|
if(verificationMethod == 2) return 'fingerprint';
|
|
|
|
|
if(verificationMethod == 3) return 'face id';
|
|
|
|
|
if(verificationMethod == 4) return 'whatsapp';
|
|
|
|
|
return "unknown";
|
|
|
|
|
}
|
|
|
|
|
}
|