login changes
@ -0,0 +1,39 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "1008895414777",
|
||||
"project_id": "doctorapp-9f172",
|
||||
"storage_bucket": "doctorapp-9f172.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28",
|
||||
"android_client_info": {
|
||||
"package_name": "com.example.doctor_app_flutter"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "1008895414777",
|
||||
"project_id": "doctorapp-9f172",
|
||||
"storage_bucket": "doctorapp-9f172.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28",
|
||||
"android_client_info": {
|
||||
"package_name": "com.example.doctor_app_flutter"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
|
||||
android.enableR8=true
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
org.gradle.jvmargs=-Xmx4608m
|
||||
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,88 @@
|
||||
class GetIMEIDetailsModel {
|
||||
String iMEI;
|
||||
int logInTypeID;
|
||||
bool outSA;
|
||||
String mobile;
|
||||
String identificationNo;
|
||||
int doctorID;
|
||||
String doctorName;
|
||||
String doctorNameN;
|
||||
int clinicID;
|
||||
String clinicDescription;
|
||||
String clnicDescriptionN;
|
||||
String projectName;
|
||||
String genderDescription;
|
||||
String genderDescriptionN;
|
||||
String titleDescription;
|
||||
String titleDescriptionN;
|
||||
bool biometricEnabled;
|
||||
int preferredLanguage;
|
||||
bool isActive;
|
||||
|
||||
GetIMEIDetailsModel(
|
||||
{this.iMEI,
|
||||
this.logInTypeID,
|
||||
this.outSA,
|
||||
this.mobile,
|
||||
this.identificationNo,
|
||||
this.doctorID,
|
||||
this.doctorName,
|
||||
this.doctorNameN,
|
||||
this.clinicID,
|
||||
this.clinicDescription,
|
||||
this.clnicDescriptionN,
|
||||
this.projectName,
|
||||
this.genderDescription,
|
||||
this.genderDescriptionN,
|
||||
this.titleDescription,
|
||||
this.titleDescriptionN,
|
||||
this.biometricEnabled,
|
||||
this.preferredLanguage,
|
||||
this.isActive});
|
||||
|
||||
GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
iMEI = json['IMEI'];
|
||||
logInTypeID = json['LogInTypeID'];
|
||||
outSA = json['OutSA'];
|
||||
mobile = json['Mobile'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
clinicID = json['ClinicID'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
clnicDescriptionN = json['ClnicDescriptionN'];
|
||||
projectName = json['ProjectName'];
|
||||
genderDescription = json['Gender_Description'];
|
||||
genderDescriptionN = json['Gender_DescriptionN'];
|
||||
titleDescription = json['Title_Description'];
|
||||
titleDescriptionN = json['Title_DescriptionN'];
|
||||
biometricEnabled = json['BiometricEnabled'];
|
||||
preferredLanguage = json['PreferredLanguage'];
|
||||
isActive = json['IsActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IMEI'] = this.iMEI;
|
||||
data['LogInTypeID'] = this.logInTypeID;
|
||||
data['OutSA'] = this.outSA;
|
||||
data['Mobile'] = this.mobile;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['ClinicDescription'] = this.clinicDescription;
|
||||
data['ClnicDescriptionN'] = this.clnicDescriptionN;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['Gender_Description'] = this.genderDescription;
|
||||
data['Gender_DescriptionN'] = this.genderDescriptionN;
|
||||
data['Title_Description'] = this.titleDescription;
|
||||
data['Title_DescriptionN'] = this.titleDescriptionN;
|
||||
data['BiometricEnabled'] = this.biometricEnabled;
|
||||
data['PreferredLanguage'] = this.preferredLanguage;
|
||||
data['IsActive'] = this.isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
class InsertIMEIDetailsModel {
|
||||
String iMEI;
|
||||
int logInTypeID;
|
||||
bool outSA;
|
||||
String mobileNo;
|
||||
String identificationNo;
|
||||
int doctorID;
|
||||
String doctorName;
|
||||
String doctorNameN;
|
||||
int clinicID;
|
||||
String clinicDescription;
|
||||
String clinicDescriptionN;
|
||||
String projectName;
|
||||
int projectID;
|
||||
String genderDescription;
|
||||
String genderDescriptionN;
|
||||
String titleDescription;
|
||||
String titleDescriptionN;
|
||||
bool bioMetricEnabled;
|
||||
int preferredLanguage;
|
||||
bool isActive;
|
||||
|
||||
InsertIMEIDetailsModel(
|
||||
{this.iMEI,
|
||||
this.logInTypeID,
|
||||
this.outSA,
|
||||
this.mobileNo,
|
||||
this.identificationNo,
|
||||
this.doctorID,
|
||||
this.doctorName,
|
||||
this.doctorNameN,
|
||||
this.clinicID,
|
||||
this.clinicDescription,
|
||||
this.clinicDescriptionN,
|
||||
this.projectName,
|
||||
this.projectID,
|
||||
this.genderDescription,
|
||||
this.genderDescriptionN,
|
||||
this.titleDescription,
|
||||
this.titleDescriptionN,
|
||||
this.bioMetricEnabled,
|
||||
this.preferredLanguage,
|
||||
this.isActive});
|
||||
|
||||
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
iMEI = json['IMEI'];
|
||||
logInTypeID = json['LogInTypeID'];
|
||||
outSA = json['OutSA'];
|
||||
mobileNo = json['MobileNo'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
clinicID = json['ClinicID'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||
projectName = json['ProjectName'];
|
||||
projectID = json['ProjectID'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
genderDescriptionN = json['GenderDescriptionN'];
|
||||
titleDescription = json['TitleDescription'];
|
||||
titleDescriptionN = json['TitleDescriptionN'];
|
||||
bioMetricEnabled = json['BioMetricEnabled'];
|
||||
preferredLanguage = json['PreferredLanguage'];
|
||||
isActive = json['IsActive'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IMEI'] = this.iMEI;
|
||||
data['LogInTypeID'] = this.logInTypeID;
|
||||
data['OutSA'] = this.outSA;
|
||||
data['MobileNo'] = this.mobileNo;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['ClinicDescription'] = this.clinicDescription;
|
||||
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['GenderDescriptionN'] = this.genderDescriptionN;
|
||||
data['TitleDescription'] = this.titleDescription;
|
||||
data['TitleDescriptionN'] = this.titleDescriptionN;
|
||||
data['BioMetricEnabled'] = this.bioMetricEnabled;
|
||||
data['PreferredLanguage'] = this.preferredLanguage;
|
||||
data['IsActive'] = this.isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/imei_details.dart';
|
||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
||||
|
||||
class AuthService extends BaseService {
|
||||
List<GetIMEIDetailsModel> _imeiDetails = [];
|
||||
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
|
||||
|
||||
Future selectDeviceImei(imei) async {
|
||||
try {
|
||||
// dynamic localRes;
|
||||
await baseAppClient.post(SELECT_DEVICE_IMEI,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_imeiDetails = [];
|
||||
response['List_DoctorDeviceDetails'].forEach((v) {
|
||||
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: {"IMEI": imei, "TokenID": "@dm!n"});
|
||||
//return Future.value(localRes);
|
||||
} catch (error) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/imei_details.dart';
|
||||
import 'package:doctor_app_flutter/core/service/auth_service.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||
import 'package:doctor_app_flutter/locator.dart';
|
||||
|
||||
class IMEIViewModel extends BaseViewModel {
|
||||
AuthService _authService = locator<AuthService>();
|
||||
List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;
|
||||
|
||||
Future selectDeviceImei(imei) async {
|
||||
setState(ViewState.Busy);
|
||||
await _authService.selectDeviceImei(imei);
|
||||
if (_authService.hasError) {
|
||||
error = _authService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,346 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SMSOTP {
|
||||
final type;
|
||||
final mobileNo;
|
||||
final Function onSuccess;
|
||||
final Function onFailure;
|
||||
final context;
|
||||
|
||||
int remainingTime = 600;
|
||||
|
||||
Future<Null> timer;
|
||||
|
||||
static BuildContext _context;
|
||||
|
||||
static bool _loading;
|
||||
|
||||
SMSOTP(
|
||||
this.context,
|
||||
this.type,
|
||||
this.mobileNo,
|
||||
this.onSuccess,
|
||||
this.onFailure,
|
||||
);
|
||||
|
||||
final verifyAccountForm = GlobalKey<FormState>();
|
||||
|
||||
TextEditingController digit1 = TextEditingController(text: "");
|
||||
TextEditingController digit2 = TextEditingController(text: "");
|
||||
TextEditingController digit3 = TextEditingController(text: "");
|
||||
TextEditingController digit4 = TextEditingController(text: "");
|
||||
|
||||
Map verifyAccountFormValue = {
|
||||
'digit1': '',
|
||||
'digit2': '',
|
||||
'digit3': '',
|
||||
'digit4': '',
|
||||
};
|
||||
final focusD1 = FocusNode();
|
||||
final focusD2 = FocusNode();
|
||||
final focusD3 = FocusNode();
|
||||
final focusD4 = FocusNode();
|
||||
String errorMsg;
|
||||
ProjectViewModel projectProvider;
|
||||
String displayTime = '';
|
||||
|
||||
displayDialog(BuildContext context) async {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
projectProvider = Provider.of(context);
|
||||
return AlertDialog(
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
this.onFailure();
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
content: StatefulBuilder(builder: (context, setState) {
|
||||
if (displayTime == '') {
|
||||
startTimer(setState);
|
||||
}
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
height: SizeConfig.realScreenHeight * 0.5,
|
||||
width: SizeConfig.realScreenWidth * 0.8,
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
type == 1
|
||||
? Image.asset('assets/images/login/103.png')
|
||||
: Image.asset('assets/images/login/104.png'),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: AppText(
|
||||
TranslationBase.of(context).verificationMessage +
|
||||
' XXXXXX' +
|
||||
mobileNo
|
||||
.toString()
|
||||
.substring(mobileNo.toString().length - 3),
|
||||
textAlign: TextAlign.center,
|
||||
)),
|
||||
Form(
|
||||
key: verifyAccountForm,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: SizeConfig.realScreenWidth * 0.15,
|
||||
child: TextFormField(
|
||||
textInputAction: TextInputAction.next,
|
||||
style: buildTextStyle(),
|
||||
autofocus: true,
|
||||
maxLength: 1,
|
||||
controller: digit1,
|
||||
textAlign: TextAlign.center,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: buildInputDecoration(context),
|
||||
onSaved: (val) {},
|
||||
validator: validateCodeDigit,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD2);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD2);
|
||||
verifyAccountFormValue['digit1'] =
|
||||
val.trim();
|
||||
checkValue();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: SizeConfig.realScreenWidth * 0.15,
|
||||
child: TextFormField(
|
||||
focusNode: focusD2,
|
||||
textInputAction: TextInputAction.next,
|
||||
maxLength: 1,
|
||||
controller: digit2,
|
||||
textAlign: TextAlign.center,
|
||||
style: buildTextStyle(),
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: buildInputDecoration(context),
|
||||
onSaved: (val) {},
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD3);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD3);
|
||||
verifyAccountFormValue['digit2'] =
|
||||
val.trim();
|
||||
checkValue();
|
||||
}
|
||||
},
|
||||
validator: validateCodeDigit),
|
||||
),
|
||||
Container(
|
||||
width: SizeConfig.realScreenWidth * 0.15,
|
||||
child: TextFormField(
|
||||
focusNode: focusD3,
|
||||
textInputAction: TextInputAction.next,
|
||||
maxLength: 1,
|
||||
controller: digit3,
|
||||
textAlign: TextAlign.center,
|
||||
style: buildTextStyle(),
|
||||
keyboardType: TextInputType.number,
|
||||
decoration:
|
||||
buildInputDecoration(context),
|
||||
onSaved: (val) {},
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD4);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD4);
|
||||
verifyAccountFormValue['digit3'] =
|
||||
val.trim();
|
||||
checkValue();
|
||||
}
|
||||
},
|
||||
validator: validateCodeDigit)),
|
||||
Container(
|
||||
width: SizeConfig.realScreenWidth * 0.15,
|
||||
child: TextFormField(
|
||||
focusNode: focusD4,
|
||||
maxLength: 1,
|
||||
textAlign: TextAlign.center,
|
||||
style: buildTextStyle(),
|
||||
controller: digit4,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration:
|
||||
buildInputDecoration(context),
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD4);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
verifyAccountFormValue['digit4'] =
|
||||
val.trim();
|
||||
checkValue();
|
||||
}
|
||||
},
|
||||
validator: validateCodeDigit)),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: AppText(
|
||||
TranslationBase.of(context).validationMessage +
|
||||
' ' +
|
||||
displayTime,
|
||||
color: Colors.red,
|
||||
textAlign: TextAlign.center,
|
||||
))
|
||||
],
|
||||
))),
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
TextStyle buildTextStyle() {
|
||||
return TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
);
|
||||
}
|
||||
|
||||
InputDecoration buildInputDecoration(BuildContext context) {
|
||||
return InputDecoration(
|
||||
counterText: " ",
|
||||
// ts/images/password_icon.png
|
||||
// contentPadding: EdgeInsets.only(top: 20, bottom: 20),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide: BorderSide(color: Theme.of(context).primaryColor),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String validateCodeDigit(value) {
|
||||
if (value.isEmpty) {
|
||||
return ' ';
|
||||
} else if (value.length == 3) {
|
||||
print(value);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
checkValue() {
|
||||
//print(verifyAccountFormValue);
|
||||
if (verifyAccountForm.currentState.validate()) {
|
||||
onSuccess(digit1.text.toString() +
|
||||
digit2.text.toString() +
|
||||
digit3.text.toString() +
|
||||
digit4.text.toString());
|
||||
}
|
||||
}
|
||||
|
||||
getSecondsAsDigitalClock(int inputSeconds) {
|
||||
var sec_num =
|
||||
int.parse(inputSeconds.toString()); // don't forget the second param
|
||||
var hours = (sec_num / 3600).floor();
|
||||
var minutes = ((sec_num - hours * 3600) / 60).floor();
|
||||
var seconds = sec_num - hours * 3600 - minutes * 60;
|
||||
var minutesString = "";
|
||||
var secondsString = "";
|
||||
minutesString =
|
||||
minutes < 10 ? "0" + minutes.toString() : minutes.toString();
|
||||
secondsString =
|
||||
seconds < 10 ? "0" + seconds.toString() : seconds.toString();
|
||||
return minutesString + ":" + secondsString;
|
||||
}
|
||||
|
||||
startTimer(setState) {
|
||||
this.remainingTime--;
|
||||
setState(() {
|
||||
displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
|
||||
});
|
||||
|
||||
timer = Future.delayed(Duration(seconds: 1), () {
|
||||
if (this.remainingTime > 0) {
|
||||
startTimer(setState);
|
||||
} else {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void showLoadingDialog(BuildContext context, bool _loading) async {
|
||||
_context = context;
|
||||
|
||||
if (_loading == false) {
|
||||
Navigator.of(context).pop();
|
||||
return;
|
||||
}
|
||||
_loading = true;
|
||||
await showDialog(
|
||||
context: _context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return SimpleDialog(
|
||||
elevation: 0.0,
|
||||
backgroundColor: Colors.transparent,
|
||||
children: <Widget>[
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
static void hideSMSBox(context) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
}
|
||||