forgot password

merge-requests/140/head
Sultan Khan 4 years ago
parent 4976870d2e
commit aa8f9f18e1

@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Doctor ///Doctor
@ -57,11 +57,16 @@ const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; const GET_AMBULANCE_REQUEST =
const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; const GET_PATIENT_ALL_PRES_ORDERS =
const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID =
'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
const UPDATE_PRESS_ORDER =
'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
///FindUs ///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -120,7 +125,8 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list //URL to get active appointment list
const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; const GET_ACTIVE_APPOINTMENTS_LIST_URL =
"Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list //URL to get projects list
const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
@ -144,7 +150,8 @@ const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
@ -267,13 +274,14 @@ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST =
'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; const GET_COVID_DRIVETHRU_PAYMENT_INFO =
'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
const GET_COVID_DRIVETHRU_FREE_SLOTS =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
///Smartwatch Integration Services ///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD = const GET_PATIENT_LAST_RECORD =
@ -331,14 +339,18 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// Home Health Care // Home Health Care
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; const HHC_GET_ALL_SERVICES =
const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
const PATIENT_ER_UPDATE_PRES_ORDER ="Services/Patients.svc/REST/PatientER_UpdatePresOrder"; const HHC_GET_ALL_CMC_SERVICES =
const GET_ORDER_DETAIL_BY_ID ="Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
const GET_CMC_ORDER_DETAIL_BY_ID ="Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; const PATIENT_ER_UPDATE_PRES_ORDER =
const GET_CHECK_UP_ITEMS ="Services/Patients.svc/REST/GetCheckUpItems"; "Services/Patients.svc/REST/PatientER_UpdatePresOrder";
const GET_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =

@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children; return children;
}, },
), ),
onDaySelected: (date, events,holidays) { onDaySelected: (date, events) {
_onDaySelected(date, events); _onDaySelected(date, events);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },

@ -348,7 +348,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children; return children;
}, },
), ),
onDaySelected: (date, event,holidays) { onDaySelected: (date, event) {
_onDaySelected( _onDaySelected(
date, date,
event, event,

@ -4,8 +4,10 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,11 +19,13 @@ class ForgotPassword extends StatefulWidget {
class _ForgotPassword extends State<ForgotPassword> { class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia'; String selectedType = 'Saudi Arabia';
String countryCode = '966';
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = null;
final TextEditingController mobileNo = TextEditingController(); String mobileNo;
var con;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
con = context;
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).forgotFileNoTitle, appBarTitle: TranslationBase.of(context).forgotFileNoTitle,
isShowAppBar: true, isShowAppBar: true,
@ -47,33 +51,11 @@ class _ForgotPassword extends State<ForgotPassword> {
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[],
// Expanded(
// // add Expanded to have your dropdown button fill remaining space
// child: DropdownButtonHideUnderline(
// child: DropdownButton(
// isExpanded: true,
// value: selectedType,
// iconSize: 40,
// elevation: 16,
// onChanged: (String newValue) => {
// setState(() {
// selectedType = newValue;
// })
// },
// items: <String>[
// 'Saudi Arabia',
// 'Dubai',
// ].map<DropdownMenuItem<String>>(
// (String value) {
// return DropdownMenuItem<String>(
// value: value,
// child: Text(value),
// );
// }).toList()))),
],
), ),
MobileNo(controller: mobileNo), MobileNo(
onNumberChange: (value) => {mobileNo = value},
onCountryChange: (value) => countryCode = value),
], ],
), ),
), ),
@ -103,10 +85,10 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS() { sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider(); final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo.text, context).then((res) { authService.sendPatientIDSMS(mobileNo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() {}); this.startSMSService(mobileNo, res['LogInTokenID']);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -116,4 +98,49 @@ class _ForgotPassword extends State<ForgotPassword> {
print(err); print(err);
}); });
} }
startSMSService(mobile, token) {
new SMSOTP(
context,
1,
mobile,
(value) => {this.checkActivationCode(value, token, int.parse(mobileNo))},
() => {
print('Faild..'),
},
).displayDialog(context);
}
checkActivationCode(value, token, mobileNo) {
GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider();
var request = {
"LogInTokenID": token,
"PatientOutSA": countryCode == '966' ? 0 : 1,
"PatientMobileNumber": mobileNo,
"ZipCode": countryCode,
"activationCode": value,
"isRegister": false,
"IsSilentLogin": false
};
authService.forgotPasswordActivation(request, value).then((res) {
if (res is String) {
GifLoaderDialogUtils.hideDialog(con);
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: res);
});
} else {
GifLoaderDialogUtils.hideDialog(con);
Navigator.of(context).pop();
AlertDialogBox(
context: con,
confirmMessage: res['ReturnMessage'],
okText: TranslationBase.of(con).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(con);
Navigator.of(context).pop();
}).showAlertDialog(context);
}
});
}
} }

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authent
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -15,6 +16,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hijri/hijri_calendar.dart';
import 'package:intl/intl.dart';
class RegisterInfo extends StatefulWidget { class RegisterInfo extends StatefulWidget {
@override @override
@ -31,15 +34,15 @@ class _RegisterInfo extends State<RegisterInfo> {
new Location(name: 'KSA', value: '1'), new Location(name: 'KSA', value: '1'),
new Location(name: 'Dubai', value: '2'), new Location(name: 'Dubai', value: '2'),
]; ];
var language; String language = '1';
var registerd_data; var registerd_data;
final List<Language> languageList = [ final List<Language> languageList = [
new Language(name: 'English', value: '2'), new Language(name: 'English', value: '2'),
new Language(name: 'Arabic', value: '1'), new Language(name: 'Arabic', value: '1'),
]; ];
var email = ''; String email = '';
var location; String location = '1';
@override @override
void initState() { void initState() {
@ -56,18 +59,13 @@ class _RegisterInfo extends State<RegisterInfo> {
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( padding: EdgeInsets.all(20),
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( AppText(
flex: 1, TranslationBase.of(context).patientInfo,
child: AppText( fontSize: SizeConfig.textMultiplier * 3,
TranslationBase.of(context).patientInfo, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 3, ),
textAlign: TextAlign.left,
)),
registerInfo != null && page == 1 registerInfo != null && page == 1
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -146,7 +144,8 @@ class _RegisterInfo extends State<RegisterInfo> {
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
hintText:registerd_data.patientMobileNumber, hintText:
registerd_data.patientMobileNumber.toString(),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
@ -223,9 +222,10 @@ class _RegisterInfo extends State<RegisterInfo> {
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
onChanged: (value) { onChanged: (value) => {
this.email = value; setState(() {
this.isValid(); email = value;
})
}, },
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
@ -233,30 +233,28 @@ class _RegisterInfo extends State<RegisterInfo> {
], ],
) )
: SizedBox(), : SizedBox(),
Expanded( Column(
flex: 2, mainAxisAlignment: MainAxisAlignment.end,
child: Column( children: <Widget>[
mainAxisAlignment: MainAxisAlignment.end, Row(
children: <Widget>[ children: <Widget>[
Row( Expanded(
children: <Widget>[ child: DefaultButton(
Expanded( page == 1
child: DefaultButton( ? TranslationBase.of(context).next
page == 1 : TranslationBase.of(context).register,
? TranslationBase.of(context).next () => {nextPage()},
: TranslationBase.of(context).register, textColor: Colors.white,
() => {nextPage()}, color: this.isValid() == false && page == 2
textColor: Colors.white, ? Colors.grey
color: this.isValid() == false && page == 2 : Colors.black,
? Colors.grey ))
: Colors.black,
))
],
),
], ],
)) ),
],
)
]), ]),
))); ));
} }
nextPage() { nextPage() {
@ -271,8 +269,17 @@ class _RegisterInfo extends State<RegisterInfo> {
registerNow() { registerNow() {
dynamic request = getTempUserRequest(); dynamic request = getTempUserRequest();
request = RegisterUserRequest.fromJson(request);
this.authService.registerUser(request); this.authService.registerUser(request).then((result) => {
print(result),
// userData = result.list;
//AuthenticatedUser.fromJson(result['List'][0]),
sharedPref.setObject(USER_PROFILE, result.list),
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID),
Navigator.of(context).pushNamed(HOME)
});
} }
getRegisterInfo() async { getRegisterInfo() async {
@ -291,25 +298,30 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
getTempUserRequest() { getTempUserRequest() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
print(dateFormat.parse(registerInfo.dateOfBirth));
var hDate =
new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth));
var date = hDate.toString();
return { return {
"Patientobject": { "Patientobject": {
"TempValue": true, "TempValue": true,
"PatientIdentificationType": 1, "PatientIdentificationType": 1,
"PatientIdentificationNo": registerInfo.idNumber, "PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data['patientMobileNumber'], "MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": registerd_data['zipCode'] == '966' ? '0' : '1', "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"FirstName": registerInfo.firstNameEn, "FirstName": registerInfo.firstNameEn,
"MiddleName": registerInfo.secondNameEn, "MiddleName": registerInfo.secondNameEn,
"LastName": registerInfo.lastNameEn, "LastName": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth, "StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": "DateofBirth": DateUtil.convertISODateToJsonDate(
DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth), registerInfo.dateOfBirth.replaceAll('/', '-')),
"Gender": registerInfo.gender, "Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationality, "NationalityID": registerInfo.nationality,
"DateofBirthN": registerInfo.dateOfBirth, "DateofBirthN": date,
"EmailAddress": email, "EmailAddress": email,
"SourceType": location, "SourceType": location,
"PreferredLanguage": registerd_data['languageID'], "PreferredLanguage": registerd_data.languageID.toString(),
"Marital": registerInfo.maritalStatusCode == 'U' "Marital": registerInfo.maritalStatusCode == 'U'
? '0' ? '0'
: registerInfo.maritalStatusCode == 'M' : registerInfo.maritalStatusCode == 'M'
@ -317,7 +329,7 @@ class _RegisterInfo extends State<RegisterInfo> {
: '2', : '2',
}, },
"PatientIdentificationID": registerInfo.idNumber, "PatientIdentificationID": registerInfo.idNumber,
"PatientMobileNumber": registerd_data['PatientMobileNumber'], "PatientMobileNumber": registerd_data.patientMobileNumber,
}; };
// var patientObject ={}; // var patientObject ={};

@ -82,7 +82,7 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Carnivore', 'Off',
style: new TextStyle(fontSize: 16.0), style: new TextStyle(fontSize: 16.0),
), ),
new Radio( new Radio(
@ -98,7 +98,7 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Herbivore', 'Invert',
style: new TextStyle( style: new TextStyle(
fontSize: 16.0, fontSize: 16.0,
), ),
@ -116,7 +116,23 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Omnivore', 'Dim',
style: new TextStyle(fontSize: 16.0),
),
new Radio(
value: 2,
groupValue: bindValue,
onChanged: (value) {
bindValue = value;
},
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text(
'Black and White',
style: new TextStyle(fontSize: 16.0), style: new TextStyle(fontSize: 16.0),
), ),
new Radio( new Radio(
@ -130,7 +146,53 @@ class _GeneralSettings extends State<GeneralSettings>
), ),
], ],
) )
])) ])),
Container(
padding: EdgeInsets.all(10),
child: AppText(
'Permission',
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
Container(
color: Colors.white,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Camera'),
Switch(
value: isVibration,
onChanged: (value) {
setState(() {
isVibration = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Location'),
Switch(
value: isVibration,
onChanged: (value) {
setState(() {
isVibration = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
))
])); ]));
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -11,14 +12,80 @@ class _ProfileSettings extends State<ProfileSettings>
with TickerProviderStateMixin { with TickerProviderStateMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isVibration = true; bool isVibration = true;
var language = 1;
return Container( return Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[ child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Text('Mode'), Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'File No',
color: Colors.black,
),
AppText(
'124545',
color: Colors.black,
),
],
),
),
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
),
Padding(
child: AppText('SMS and Confirmation Calls Language ',
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText('English'),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
language = value;
},
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText('Arabic'),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
language = value;
},
)
],
)),
Padding(
child: AppText('Alert'),
padding: EdgeInsets.all(10),
),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Vibration touch feedback'), AppText('Alert by Email'),
Switch( Switch(
value: isVibration, value: isVibration,
onChanged: (value) { onChanged: (value) {
@ -33,9 +100,11 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Accsibility Mode'), AppText('Alert by SMS'),
Switch( Switch(
value: isVibration, value: isVibration,
onChanged: (value) { onChanged: (value) {
@ -47,6 +116,46 @@ class _ProfileSettings extends State<ProfileSettings>
activeColor: Colors.green, activeColor: Colors.green,
) )
], ],
)),
Padding(
child: AppText('Alert'),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Email'),
TextField(
style: TextStyle(color: Colors.red),
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Emergency contact name'),
TextField(
style: TextStyle(color: Colors.red),
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Emergency contact number'),
TextField(
style: TextStyle(color: Colors.red),
)
],
)) ))
])); ]));
} }

@ -35,6 +35,8 @@ const SEND_ACTIVATION_CODE =
'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
const CHECK_ACTIVATION_CODE = const CHECK_ACTIVATION_CODE =
'Services/Authentication.svc/REST/CheckActivationCode'; 'Services/Authentication.svc/REST/CheckActivationCode';
const FORGOT_PASSWORD =
'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
const CHECK_PATIENT_FOR_REGISTRATION = const CHECK_PATIENT_FOR_REGISTRATION =
"Services/Authentication.svc/REST/CheckPatientForRegisteration"; "Services/Authentication.svc/REST/CheckPatientForRegisteration";
@ -111,7 +113,7 @@ class AuthProvider with ChangeNotifier {
var imei = await sharedPref.getString(PUSH_TOKEN); var imei = await sharedPref.getString(PUSH_TOKEN);
// if (!request.) { // if (!request.) {
newRequest.iMEI =imei; //imei!=null ? imei : ''; newRequest.iMEI = imei; //imei!=null ? imei : '';
newRequest.firstName = request.firstName + " " + request.lastName; newRequest.firstName = request.firstName + " " + request.lastName;
newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; newRequest.firstNameN = request.firstNameN + " " + request.lastNameN;
newRequest.lastNameN = request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? "";
@ -307,14 +309,14 @@ class AuthProvider with ChangeNotifier {
} }
} }
Future<dynamic> registerUser(RegisterUserRequest request) async { Future<dynamic> registerUser(request) async {
request.versionID = VERSION_ID; request['VersionID'] = VERSION_ID;
request.channel = CHANNEL; request['Channel'] = CHANNEL;
request.iPAdress = IP_ADDRESS; request['IPAdress'] = IP_ADDRESS;
request.generalid = GENERAL_ID; request['Generalid'] = GENERAL_ID;
request.deviceTypeID = DeviceTypeID; request['DeviceTypeID'] = DeviceTypeID;
request.languageID = LANGUAGE_ID; request['LanguageID'] = LANGUAGE_ID;
var requestN = RegisterUserRequest.fromJson(request);
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
try { try {
@ -324,7 +326,7 @@ class AuthProvider with ChangeNotifier {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
return Future.value(error); return Future.value(error);
}, body: request.toJson()); }, body: requestN.toJson());
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
@ -394,4 +396,32 @@ class AuthProvider with ChangeNotifier {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<dynamic> forgotPasswordActivation(request, [value]) async {
// var neRequest = CheckActivationCodeReq.fromJson(request);
// neRequest.activationCode = value ?? "0000";
// neRequest.isSilentLogin = value != null ? false : true;
request['VersionID'] = VERSION_ID;
request['Channel'] = CHANNEL;
request['IPAdress'] = IP_ADDRESS;
request['generalid'] = GENERAL_ID;
request['LanguageID'] = LANGUAGE_ID;
request['DeviceTypeID'] = DeviceTypeID;
dynamic localRes;
try {
await new BaseAppClient().post(FORGOT_PASSWORD,
onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson();
}, onFailure: (String error, int statusCode) {
localRes = error;
return Future.value(error);
// throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
throw error;
//return Future.value(error);
}
}
} }

Loading…
Cancel
Save