merge-update-with-lab-changes
devamirsaleemahmad 2 years ago
parent ed748a626b
commit cbc38940ea

@ -151,8 +151,8 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
body?['PatientID'] = 1231755; //3844083 // body?['PatientID'] = 1231755; //3844083
body?['TokenID'] = "@dm!n"; // body?['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
// Mobile no.: 0502303285 // Mobile no.: 0502303285

@ -69,6 +69,9 @@ class _MyApp extends State<MyApp> {
//0537503378 //0537503378
//1231755 //1231755
//2466305493
//0567184134 mobile
// checkForUpdate() { // checkForUpdate() {
// // todo need to verify 'imp' // // todo need to verify 'imp'

@ -98,7 +98,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.doctor.projectName!, widget.doctor.projectName!,
null, null,
null, null,
widget.doctor.nationalityFlagURL!, widget.doctor.nationalityFlagURL ?? "",
widget.doctor.doctorRate, widget.doctor.doctorRate,
null, null,
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
@ -212,7 +212,7 @@ class _BookConfirmState extends State<BookConfirm> {
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT); bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
if (isLiveCareSchedule != null && isLiveCareSchedule) { if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} else { } else {
@ -257,12 +257,12 @@ class _BookConfirmState extends State<BookConfirm> {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async { cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = DoctorsListService();
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT); bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
service.cancelAppointment(appo, context, isReschedule: true).then((res) { service.cancelAppointment(appo, context, isReschedule: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () async { Future.delayed(Duration(milliseconds: 1500), () async {
if (isLiveCareSchedule != null && isLiveCareSchedule) { if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} else { } else {
@ -285,7 +285,7 @@ class _BookConfirmState extends State<BookConfirm> {
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject); getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
getToDoCount(); getToDoCount();
} else { } else {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = ConfirmDialog(
isDissmissable: false, isDissmissable: false,
context: context, context: context,
confirmMessage: res['ErrorEndUserMessage'], confirmMessage: res['ErrorEndUserMessage'],
@ -334,8 +334,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
// checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
getToDoCount(); getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
@ -350,7 +349,7 @@ class _BookConfirmState extends State<BookConfirm> {
projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList(); appo = AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
appo.projectID = res['SameClinicApptList'][0]['ProjectID']; appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
@ -362,13 +361,14 @@ class _BookConfirmState extends State<BookConfirm> {
appo.originalProjectID = 0; appo.originalProjectID = 0;
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = ConfirmDialog(
context: context, context: context,
confirmMessage: res['ErrorEndUserMessage'], confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo, context)}, okFunction: () => {cancelAppointment(docObject, appo, context)},
cancelFunction: () => {}); cancelFunction: () => {},
);
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
}).catchError((err) { }).catchError((err) {
@ -382,10 +382,12 @@ class _BookConfirmState extends State<BookConfirm> {
insertLiveCareScheduledAppointment(context, DoctorList docObject) { insertLiveCareScheduledAppointment(context, DoctorList docObject) {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime; final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0]; widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0];
widget.selectedTime = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5); widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service
.insertLiveCareScheduleAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, context)
.then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']); print(res['AppointmentNo']);

@ -84,7 +84,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
getCurrentLanguage(); getCurrentLanguage();
isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT); isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
if (isLiveCareSchedule != null && isLiveCareSchedule) if (isLiveCareSchedule != null && isLiveCareSchedule)
getDoctorScheduledFreeSlots(context, widget.doctor); getDoctorScheduledFreeSlots(context, widget.doctor);
else { else {
@ -471,7 +471,6 @@ class MeetingDataSource extends CalendarDataSource {
} }
return meetingData; return meetingData;
} }
} }
class Meeting { class Meeting {

@ -106,7 +106,7 @@ class _SchedulePageState extends State<SchedulePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Padding( child: Padding(
padding: projectViewModel.isArabic ? EdgeInsets.only(right: 20) : EdgeInsets.only(left: 20), padding: projectViewModel.isArabic ? EdgeInsets.only(right: 17) : EdgeInsets.only(left: 17),
child: Row(children: [ child: Row(children: [
Column( Column(
children: [ children: [

@ -650,7 +650,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
: value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount); model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); FlutterAppIconBadge.updateBadge(int.parse(notificationCount.split("+").first));
} }
}), }),
}); });

@ -53,13 +53,13 @@ class ConfirmLogin extends StatefulWidget {
class _ConfirmLogin extends State<ConfirmLogin> { class _ConfirmLogin extends State<ConfirmLogin> {
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
var _availableBiometrics; var _availableBiometrics;
var sharedPref = new AppSharedPreferences(); var sharedPref = AppSharedPreferences();
late bool authenticated; bool authenticated = false;
final authService = new AuthProvider(); final authService = AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
late int mobileNumber; late int mobileNumber;
String errorMsg = ''; String errorMsg = '';
late SelectDeviceIMEIRES user; SelectDeviceIMEIRES user = SelectDeviceIMEIRES();
bool isLoading = false; bool isLoading = false;
var registerd_data; var registerd_data;
bool isMoreOption = false; bool isMoreOption = false;
@ -84,7 +84,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
late bool _loading; late bool _loading;
late int fingrePrintBefore; int fingrePrintBefore = 0;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
@ -632,7 +632,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
userData = result.list, userData = result.list,
sharedPref.setString(BLOOD_TYPE, result.patientBloodType), sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? "O+"),
//Remove o+ from here Added by Aamir
authenticatedUserObject.user = result.list, authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res), projectViewModel.setPrivilege(privilegeList: res),
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
@ -658,9 +659,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
}) })
.catchError((err) { .catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
startSMSService(tempType); startSMSService(tempType);
}); });

@ -38,7 +38,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
clinicID: widget.patientLabOrders!.clinicID!, clinicID: widget.patientLabOrders!.clinicID!,
projectID: widget.patientLabOrders!.projectID!, projectID: widget.patientLabOrders!.projectID!,
orderNo: widget.patientLabOrders!.orderNo!, orderNo: widget.patientLabOrders!.orderNo!,
setupID: widget.patientLabOrders!.setupID!, setupID: widget.patientLabOrders!.setupID ?? "0",
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)), isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)),
), ),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_inp.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_inp.dart';
@ -29,7 +30,7 @@ class PrescriptionItemsPage extends StatelessWidget {
final Prescriptions prescriptions; final Prescriptions prescriptions;
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
PrescriptionItemsPage({ Key? key, required this.prescriptions}); PrescriptionItemsPage({Key? key, required this.prescriptions});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,7 +43,8 @@ class PrescriptionItemsPage extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: model.state != ViewState.Busy ? Column( body: model.state != ViewState.Busy
? Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -58,12 +60,16 @@ class PrescriptionItemsPage extends StatelessWidget {
"", "",
prescriptions.name!, prescriptions.name!,
DateUtil.convertStringToDate(prescriptions.appointmentDate!), DateUtil.convertStringToDate(prescriptions.appointmentDate!),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate! : model.prescriptionReportListINP[0].orderDate!)), DateUtil.formatDateToTime(
DateUtil.convertStringToDate(
model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate! : model.prescriptionReportListINP[0].orderDate!,
),
),
prescriptions.nationalityFlagURL!, prescriptions.nationalityFlagURL!,
prescriptions.doctorRate, prescriptions.doctorRate,
prescriptions.actualDoctorRate, prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate, prescriptions.noOfPatientsRate,
projectViewModel.user!.emailAddress!, projectViewModel.user.emailAddress!,
), ),
isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false, isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false,
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
@ -285,8 +291,8 @@ class PrescriptionItemsPage extends StatelessWidget {
Text( Text(
(model.prescriptionReportEnhList[index].itemDescription!.isNotEmpty (model.prescriptionReportEnhList[index].itemDescription!.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription ? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '') : model.prescriptionReportEnhList[index].itemDescriptionN ?? '')!
!.toLowerCase() .toLowerCase()
.capitalizeFirstofEach, .capitalizeFirstofEach,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
@ -408,7 +414,8 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
], ],
) : Container(), )
: Container(),
), ),
); );
} }

@ -14,7 +14,7 @@ import '../show_zoom_image_dialog.dart';
/// [height] the avatar height /// [height] the avatar height
/// [onTap] on tap function /// [onTap] on tap function
class LargeAvatar extends StatelessWidget { class LargeAvatar extends StatelessWidget {
LargeAvatar({Key? key, this.name, this.url, this.disableProfileView= false, this.radius = 70.0, this.width = 70, this.height = 60, this.onTap, this.isAppointmentAvatar= false}) : super(key: key); LargeAvatar({Key? key, this.name, this.url, this.disableProfileView = false, this.radius = 70.0, this.width = 70, this.height = 60, this.onTap, this.isAppointmentAvatar = false}) : super(key: key);
final String? name; final String? name;
final String? url; final String? url;
@ -41,7 +41,11 @@ class LargeAvatar extends StatelessWidget {
), ),
if (!disableProfileView && !isAppointmentAvatar) if (!disableProfileView && !isAppointmentAvatar)
Container( Container(
child: Icon(Icons.search,size: 18,color: Colors.white,), child: Icon(
Icons.search,
size: 18,
color: Colors.white,
),
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200), decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
) )
@ -63,8 +67,9 @@ class LargeAvatar extends StatelessWidget {
return InkWell( return InkWell(
onTap: disableProfileView onTap: disableProfileView
? null ? null
: isAppointmentAvatar ? onTap : () { : isAppointmentAvatar
print("ssssss " + url!.trim()); ? onTap
: () {
showZoomImageDialog(context, url!.trim() ?? ""); showZoomImageDialog(context, url!.trim() ?? "");
}, },
child: Container( child: Container(

@ -36,7 +36,8 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!), onModelReady: (model) =>
model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!),
builder: (_, model, w) => NetworkBaseView( builder: (_, model, w) => NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Column( child: Column(
@ -45,7 +46,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.patientLabOrder!.doctorName!, widget.patientLabOrder!.doctorName!,
widget.patientLabOrder!.doctorID!, widget.patientLabOrder!.doctorID ?? 0,
widget.patientLabOrder!.doctorImageURL!, widget.patientLabOrder!.doctorImageURL!,
widget.patientLabOrder!.speciality ?? [""], widget.patientLabOrder!.speciality ?? [""],
widget.billNo!, widget.billNo!,
@ -56,7 +57,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
widget.patientLabOrder!.doctorRate!, widget.patientLabOrder!.doctorRate!,
widget.patientLabOrder!.actualDoctorRate!, widget.patientLabOrder!.actualDoctorRate!,
widget.patientLabOrder!.noOfPatientsRate!, widget.patientLabOrder!.noOfPatientsRate!,
projectViewModel.user!.emailAddress!), projectViewModel.user.emailAddress!),
onTap: widget.onTap!, onTap: widget.onTap!,
), ),
SizedBox(height: 10), SizedBox(height: 10),

@ -16,7 +16,7 @@ class ConfirmDialog {
final Function? cancelFunction; final Function? cancelFunction;
final isDissmissable; final isDissmissable;
ConfirmDialog({@required this.context, this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, required this.okFunction, @required this.cancelFunction, this.isDissmissable = true}); ConfirmDialog({required this.context, this.title, required this.confirmMessage, required this.okText, required this.cancelText, required this.okFunction, required this.cancelFunction, this.isDissmissable = true});
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
Dialog alert = Dialog( Dialog alert = Dialog(
@ -28,8 +28,8 @@ class ConfirmDialog {
confirmMessage, confirmMessage,
okText, okText,
cancelText, cancelText,
cancelFunction: cancelFunction!, cancelFunction: cancelFunction,
okFunction: okFunction!, okFunction: okFunction,
), ),
), ),
); );

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.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/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,7 +42,7 @@ class DoctorHeader extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel!.speciality.first : ""; String _speciality = (headerModel.speciality ?? []).length > 0 ? headerModel.speciality.first : "";
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Container( return Container(
color: Colors.white, color: Colors.white,
@ -53,7 +54,7 @@ class DoctorHeader extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(left: 21, right: 21, bottom: 12), padding: EdgeInsets.only(left: 21, right: 21, bottom: 12),
child: Text( child: Text(
headerModel!.doctorName!, headerModel.doctorName,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
@ -66,13 +67,15 @@ class DoctorHeader extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LargeAvatar( LargeAvatar(
name: headerModel!.doctorName, name: headerModel.doctorName,
url: headerModel!.doctorImageURL, url: headerModel.doctorImageURL,
width: 51, width: 51,
height: 51, height: 51,
disableProfileView: headerModel.doctorImageURL.isEmpty && headerModel.doctorImageURL == null ? true : false,
), ),
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(
flex: 4,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -101,10 +104,10 @@ class DoctorHeader extends StatelessWidget {
headerModel.time ?? DateUtil.formatDateToTime(headerModel.date!), headerModel.time ?? DateUtil.formatDateToTime(headerModel.date!),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
if (headerModel?.nationalityFlagURL != null) if (headerModel.nationalityFlagURL != null)
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Image.network(headerModel.nationalityFlagURL ?? "", height: 20), child: headerModel.nationalityFlagURL.isNotEmpty && headerModel.nationalityFlagURL != null ? Image.network(headerModel.nationalityFlagURL, height: 20) : SizedBox(),
), ),
], ],
) )
@ -294,7 +297,8 @@ class DoctorHeader extends StatelessWidget {
RatingBar( RatingBar(
itemSize: 20.0, itemSize: 20.0,
allowHalfRating: true, allowHalfRating: true,
initialRating: this.headerModel!.decimalDoctorRate! != null ? double.tryParse(this.headerModel!.decimalDoctorRate!)! : this.headerModel!.actualDoctorRate!.toDouble(), initialRating:
this.headerModel!.decimalDoctorRate! != null ? double.tryParse(this.headerModel!.decimalDoctorRate!)! : this.headerModel!.actualDoctorRate!.toDouble(),
ratingWidget: RatingWidget( ratingWidget: RatingWidget(
full: Icon( full: Icon(
Icons.star, Icons.star,

@ -58,14 +58,14 @@ class OTPWidget extends StatefulWidget {
this.defaultBorderColor = Colors.black, this.defaultBorderColor = Colors.black,
this.textBorderColor = Colors.black, this.textBorderColor = Colors.black,
this.pinTextAnimatedSwitcherTransition, this.pinTextAnimatedSwitcherTransition,
this.pinTextAnimatedSwitcherDuration= const Duration(), this.pinTextAnimatedSwitcherDuration = const Duration(),
this.hasError= false, this.hasError = false,
this.errorBorderColor= Colors.red, this.errorBorderColor = Colors.red,
this.onTextChanged, this.onTextChanged,
this.autoFocus= false, this.autoFocus = false,
this.focusNode, this.focusNode,
this.textDirection= TextDirection.ltr, this.textDirection = TextDirection.ltr,
this.keyboardType= TextInputType.number, this.keyboardType = TextInputType.number,
this.pinBoxOuterPadding = const EdgeInsets.symmetric(horizontal: 4.0), this.pinBoxOuterPadding = const EdgeInsets.symmetric(horizontal: 4.0),
this.pinBoxColor = Colors.white, this.pinBoxColor = Colors.white,
this.pinBoxBorderWidth = 2.0, this.pinBoxBorderWidth = 2.0,
@ -121,11 +121,11 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
void initState() { void initState() {
super.initState(); super.initState();
focusNode = widget.focusNode ?? FocusNode(); focusNode = widget.focusNode ?? FocusNode();
_highlightAnimationController = AnimationController(vsync: this);
_initTextController(); _initTextController();
_calculateStrList(); _calculateStrList();
widget.controller?.addListener(_controllerListener); widget.controller!.addListener(_controllerListener);
focusNode?.addListener(_focusListener); focusNode.addListener(_focusListener);
} }
void _controllerListener() { void _controllerListener() {
@ -182,11 +182,11 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
@override @override
void dispose() { void dispose() {
if (widget.focusNode == null) { if (widget.focusNode == null) {
focusNode?.dispose(); focusNode.dispose();
} else { } else {
focusNode?.removeListener(_focusListener); focusNode.removeListener(_focusListener);
} }
_highlightAnimationController?.dispose(); _highlightAnimationController.dispose();
widget.controller?.removeListener(_controllerListener); widget.controller?.removeListener(_controllerListener);
super.dispose(); super.dispose();
@ -295,7 +295,11 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
List<Widget> pinCodes = List.generate(widget.maxLength, (int i) { List<Widget> pinCodes = List.generate(widget.maxLength, (int i) {
return _buildPinCode(i, context); return _buildPinCode(i, context);
}); });
return Row(children: pinCodes, mainAxisSize: MainAxisSize.min,mainAxisAlignment: MainAxisAlignment.spaceBetween,); return Row(
children: pinCodes,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
);
} }
Widget _buildPinCode(int i, BuildContext context) { Widget _buildPinCode(int i, BuildContext context) {

Loading…
Cancel
Save