Timezone fixes & Activate/Deactivate file changes

merge-update-with-lab-changes
haroon amjad 4 years ago
parent b756bf8caf
commit 2ba744c3a6

@ -1847,5 +1847,7 @@ const Map localizedValues = {
"lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" },
"lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" },
"lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" },
"deleteAccount": { "en": "Delete my account", "ar": "الحساب احذف" }, "deleteAccount": { "en": "Deactivate my account", "ar": "الحساب احذف" },
"deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد إلغاء تنشيط حسابك؟" },
"accountDeactivated": { "en": "Your account has been deactivated successfully", "ar": "تم إلغاء تنشيط حسابك بنجاح" },
}; };

@ -105,7 +105,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"", "",
widget.appo.projectName, widget.appo.projectName,
DateUtil.convertStringToDate(widget.appo.appointmentDate), DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.startTime.substring(0, 5), widget.appo.isLiveCareAppointment ? DateUtil.convertStringToDate(widget.appo.appointmentDate).toString().split(" ")[1].substring(0, 5) : widget.appo.startTime.substring(0, 5),
null, null,
widget.appo.doctorRate, widget.appo.doctorRate,
widget.appo.actualDoctorRate, widget.appo.actualDoctorRate,

@ -378,8 +378,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate),
isSortByClinic: _isSortByClinic, isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate + 0.0, rating: _appointmentResult.actualDoctorRate + 0.0,
// appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5), appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5),
appointmentTime: _appointmentResult.startTime.substring(0, 5), // appointmentTime: _appointmentResult.startTime.substring(0, 5),
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
? _appointmentResult.remaniningHoursTocanPay ? _appointmentResult.remaniningHoursTocanPay
: null : null

@ -237,41 +237,41 @@ class _clinic_listState extends State<ClinicList> {
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
showLiveCareInfoDialog(GetERAppointmentFeesList getERAppointmentFeesList) async { // showLiveCareInfoDialog(GetERAppointmentFeesList getERAppointmentFeesList) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { // if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); // var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() { // setState(() {
authUser = data; // authUser = data;
}); // });
} // }
//
showGeneralDialog( // showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), // barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) { // transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; // final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform( // return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), // transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( // child: Opacity(
opacity: a1.value, // opacity: a1.value,
child: LiveCareInfoDialog(), // child: LiveCareInfoDialog(),
), // ),
); // );
}, // },
transitionDuration: Duration(milliseconds: 500), // transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true, // barrierDismissible: true,
barrierLabel: '', // barrierLabel: '',
context: context, // context: context,
pageBuilder: (context, animation1, animation2) {}) // pageBuilder: (context, animation1, animation2) {})
.then((value) { // .then((value) {
if (value) { // if (value) {
if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { // if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
addNewCallForPatientER(authUser.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString()); // addNewCallForPatientER(authUser.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString());
} else { // } else {
navigateToPaymentMethod(getERAppointmentFeesList, context); // navigateToPaymentMethod(getERAppointmentFeesList, context);
} // }
} // }
}); // });
} // }
Future navigateToPaymentMethod(GetERAppointmentFeesList getERAppointmentFeesList, context) async { Future navigateToPaymentMethod(GetERAppointmentFeesList getERAppointmentFeesList, context) async {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();

@ -8,6 +8,7 @@ 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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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';
@ -215,7 +216,9 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact), inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact),
mHeight(10), mHeight(10),
InkWell( InkWell(
onTap: () {}, onTap: () {
deactivateAccount();
},
child: Text( child: Text(
TranslationBase.of(context).deleteAccount, TranslationBase.of(context).deleteAccount,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline),
@ -252,10 +255,6 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
); );
} }
deactivateAccount() {
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
@ -338,14 +337,35 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
); );
} }
getSettings() { deactivateAccount() {
// GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ConfirmDialog dialog = new ConfirmDialog(
authService.getSettings().then((result) => { context: context,
// GifLoaderDialogUtils.hideDialog(AppGlobal.context), confirmMessage: TranslationBase.of(context).deactivateAccount,
setValue(result["PateintInfoForUpdateList"][0]) okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () {
Navigator.of(context).pop();
callDeactivateAccountAPI();
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
callDeactivateAccountAPI() {
GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> request = {};
request["IsActive"] = false;
authService.deactivateAccount(request).then((result) {
AppToast.showSuccessToast(message: TranslationBase.of(context).accountDeactivated);
GifLoaderDialogUtils.hideDialog(context);
}); });
} }
getSettings() {
authService.getSettings().then((result) => {setValue(result["PateintInfoForUpdateList"][0])});
}
setValue(value) { setValue(value) {
setState(() { setState(() {
this.language = int.parse(value["PreferredLanguage"]); this.language = int.parse(value["PreferredLanguage"]);

@ -2,6 +2,8 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request_register.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request_register.dart';
@ -14,9 +16,12 @@ import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.
import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../../locator.dart'; import '../../locator.dart';
// SharedPreferences sharedPref = new SharedPreferences(); // SharedPreferences sharedPref = new SharedPreferences();
@ -47,6 +52,8 @@ const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard';
const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate'; const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate';
const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo'; const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo';
const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_InsertUpdate';
class AuthProvider with ChangeNotifier { class AuthProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
@ -468,12 +475,6 @@ class AuthProvider with ChangeNotifier {
Future<dynamic> getDashboard() async { Future<dynamic> getDashboard() async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
// request['VersionID'] = VERSION_ID;
// request['Channel'] = CHANNEL;
// request['IPAdress'] = IP_ADDRESS;
// request['generalid'] = GENERAL_ID;
// request['LanguageID'] = LANGUAGE_ID;
// request['DeviceTypeID'] = DeviceTypeID;
dynamic localRes; dynamic localRes;
try { try {
@ -495,16 +496,14 @@ class AuthProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(PROFILE_SETTING, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(PROFILE_SETTING, onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
return Future.value(error); return Future.value(error);
// throw error;
}, body: {}); }, body: {});
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
//return Future.value(error);
} }
} }
@ -512,16 +511,41 @@ class AuthProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(SAVE_SETTING, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SAVE_SETTING, onSuccess: (dynamic response, int statusCode) {
localRes = response; //CheckActivationCode.fromJson(); localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
localRes = error; localRes = error;
return Future.value(error); return Future.value(error);
// throw error;
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
//return Future.value(error);
} }
} }
Future deactivateAccount(request) async {
dynamic localRes;
try {
await new BaseAppClient().post(DEACTIVATE_ACCOUNT, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
localRes = error;
return Future.value(error);
}, body: request);
logout();
return Future.value(localRes);
} catch (error) {
throw error;
}
}
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
model.setState(0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}
} }

@ -4,7 +4,7 @@ import '../widgets/Loader/gif_loader_container.dart';
class GifLoaderDialogUtils { class GifLoaderDialogUtils {
static showMyDialog(BuildContext context) { static showMyDialog(BuildContext context) {
showDialog(context: context, builder: (cxt) => GifLoaderContainer()); showDialog(context: context, barrierDismissible: false, builder: (cxt) => GifLoaderContainer());
} }
static hideDialog(BuildContext context) { static hideDialog(BuildContext context) {

@ -2857,6 +2857,8 @@ class TranslationBase {
String get lakumDiscontinue => localizedValues["lakumDiscontinue"][locale.languageCode]; String get lakumDiscontinue => localizedValues["lakumDiscontinue"][locale.languageCode];
String get lakumSuccess => localizedValues["lakumSuccess"][locale.languageCode]; String get lakumSuccess => localizedValues["lakumSuccess"][locale.languageCode];
String get deleteAccount => localizedValues["deleteAccount"][locale.languageCode]; String get deleteAccount => localizedValues["deleteAccount"][locale.languageCode];
String get deactivateAccount => localizedValues["deactivateAccount"][locale.languageCode];
String get accountDeactivated => localizedValues["accountDeactivated"][locale.languageCode];
} }

@ -29,7 +29,9 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return WillPopScope(
onWillPop: () async => false,
child: Center(
//progress-loading.gif //progress-loading.gif
child: Container( child: Container(
// margin: EdgeInsets.only(bottom: 40), // margin: EdgeInsets.only(bottom: 40),
@ -37,6 +39,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
controller: controller1, controller: controller1,
image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
), ),
)); )),
);
} }
} }

Loading…
Cancel
Save