first step from fix screen

merge-requests/890/head
Elham Rababh 4 years ago
parent ec83d72038
commit 1f28a09043

@ -32,7 +32,7 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
baseViewModel: model,
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column(
children: [
Expanded(

@ -38,7 +38,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget {
AddPatientSickLeaveScreen(
{this.appointmentNo,
this.patientMRN,
this.patient, this.previousModel});
required this.patient, required this.previousModel});
@override
_AddPatientSickLeaveScreenState createState() =>
@ -52,7 +52,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
TextEditingController _clinicController = new TextEditingController();
TextEditingController _doctorController = new TextEditingController();
TextEditingController _remarkController = new TextEditingController();
DateTime currentDate;
late DateTime currentDate;
AddSickLeaveRequest addSickLeave = AddSickLeaveRequest();
bool isFormSubmitted = false;
@ -85,8 +85,8 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
return BaseView<SickLeaveViewModel>(
onModelReady: (model) async {
await model.getDoctorProfile();
_clinicController.text = model.doctorProfile.clinicDescription;
_doctorController.text = model.doctorProfile.doctorName;
_clinicController.text = model.doctorProfile!.clinicDescription!;
_doctorController.text = model.doctorProfile!.doctorName!;
await model.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN);
},
@ -97,7 +97,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
child: AppScaffold(
baseViewModel: model,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addSickLeave,
title: TranslationBase.of(context).addSickLeave!,
),
isShowAppBar: true,
body: Center(
@ -112,9 +112,9 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).sickLeave +
hintText: TranslationBase.of(context).sickLeave! +
' ' +
TranslationBase.of(context).days,
TranslationBase.of(context).days!,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
@ -154,7 +154,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
minLines: 1,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(Icons.calendar_today)),
icon: Icon(Icons.calendar_today), onPressed: () { },),
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))

@ -23,13 +23,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PatientSickLeaveScreen extends StatelessWidget {
PatiantInformtion patient;
late PatiantInformtion patient;
@override
Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>(
@ -84,7 +84,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
),
),
AddNewOrder(
label: TranslationBase.of(context).noSickLeaveApplied,
label: TranslationBase.of(context).noSickLeaveApplied!,
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Sick Leave Screen"
@ -193,7 +193,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
CustomRow(
label: TranslationBase.of(
context)
.startDate +
.startDate! +
' ' ??
"",
labelSize: SizeConfig
@ -217,7 +217,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
CustomRow(
label: TranslationBase.of(
context)
.endDate +
.endDate! +
' ' ??
"",
labelSize: SizeConfig
@ -269,7 +269,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
)
: patient.patientStatusType != 43
? ErrorMessage(
error: TranslationBase.of(context).noSickLeave,
error: TranslationBase.of(context).noSickLeave!,
)
: SizedBox(),
SizedBox(

@ -10,8 +10,8 @@ import 'package:provider/provider.dart';
class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
InPatientHeader(
{this.model,
this.specialClinic,
{required this.model,
required this.specialClinic,
this.activeTab,
this.selectedMapId,
this.onChangeFunc})

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class NoData extends StatelessWidget {
const NoData({
Key key,
Key? key,
}) : super(key: key);
@override
@ -13,7 +13,7 @@ class NoData extends StatelessWidget {
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
error: TranslationBase.of(context).noDataAvailable!)),
),
);
}

@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget {
final Function onChangeValue;
InPatientListPage(
{this.isMyInPatient,
this.patientSearchViewModel,
this.selectedClinicName,
this.onChangeValue,
this.isAllClinic,
this.showBottomSheet});
{required this.isMyInPatient,
required this.patientSearchViewModel,
required this.selectedClinicName,
required this.onChangeValue,
required this.isAllClinic,
required this.showBottomSheet});
@override
_InPatientListPageState createState() => _InPatientListPageState();
@ -279,7 +279,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
.patientSearchViewModel
.InpatientClinicList[index]);
widget.patientSearchViewModel
.filterByClinic(clinicName: value);
.filterByClinic(clinicName: value.toString());
});
},
activeColor: Colors.red,

@ -24,8 +24,8 @@ class InPatientScreen extends StatefulWidget {
bool isAllClinic = true;
bool showBottomSheet = false;
String selectedClinicName;
InPatientScreen({Key? key, this.specialClinic});
late String selectedClinicName;
InPatientScreen({Key? key, required this.specialClinic});
@override
_InPatientScreenState createState() => _InPatientScreenState();
@ -33,9 +33,9 @@ class InPatientScreen extends StatefulWidget {
class _InPatientScreenState extends State<InPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
int _activeTab = 0;
int selectedMapId;
late int selectedMapId;
@override
void initState() {
@ -79,7 +79,7 @@ class _InPatientScreenState extends State<InPatientScreen>
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: InPatientHeader(
appBar: InPatientHeader(
model: model,
selectedMapId: selectedMapId,
specialClinic: widget.specialClinic,
@ -136,13 +136,13 @@ class _InPatientScreenState extends State<InPatientScreen>
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0,
TranslationBase.of(context).inPatientAll,
TranslationBase.of(context).inPatientAll!,
counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1,
TranslationBase.of(context).myInPatientTitle,
TranslationBase.of(context).myInPatientTitle!,
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),
TranslationBase.of(context).discharged!),
],
),
),

@ -7,10 +7,10 @@ import 'NoData.dart';
class ListOfAllInPatient extends StatelessWidget {
const ListOfAllInPatient({
Key key,
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
Key? key,
required this.isAllClinic,
required this.hasQuery,
required this.patientSearchViewModel,
}) : super(key: key);
final bool isAllClinic;
@ -42,7 +42,7 @@ class ListOfAllInPatient extends StatelessWidget {
isInpatient: true,
isMyPatient: patientSearchViewModel
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile.doctorID,
patientSearchViewModel.doctorProfile!.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
@ -61,7 +61,7 @@ class ListOfAllInPatient extends StatelessWidget {
"arrivalType": "1",
"isMyPatient": patientSearchViewModel
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile.doctorID,
patientSearchViewModel.doctorProfile!.doctorID,
});
},
);
@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget {
patientSearchViewModel.removeOnFilteredList();
}
}
return;
return false;
},
),
),

@ -6,10 +6,10 @@ import '../../../routes.dart';
import 'NoData.dart';
class ListOfMyInpatient extends StatelessWidget {
const ListOfMyInpatient({
Key key,
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
Key? key,
required this.isAllClinic,
required this.hasQuery,
required this.patientSearchViewModel,
}) : super(key: key);
final bool isAllClinic;
@ -56,9 +56,6 @@ class ListOfMyInpatient extends StatelessWidget {
},
);
}),
onNotification: (t) {
return;
},
),
),
);

@ -53,7 +53,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];

@ -23,22 +23,22 @@ class AdmissionOrdersScreen extends StatefulWidget {
class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
late AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getAdmissionOrders(
admissionNo: 2014005178, patientId: patient.patientMRN),
admissionNo: 2014005178, patientId: patient!.patientMRN!),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -50,7 +50,7 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
body: model.admissionOrderList == null ||
model.admissionOrderList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable)
error: TranslationBase.of(context).noDataAvailable!)
: Container(
color: Colors.grey[200],
child: Column(
@ -257,21 +257,6 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
SizedBox(
height: 8,
),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// children: [
// Expanded(
// child: AppText(
// model
// .admissionOrderList[
// index]
// .notes,
// fontSize: 10,
// isCopyable: true,
// ),
// ),
// ])
],
),
SizedBox(

@ -26,7 +26,7 @@ import 'diabetic_details_blood_pressurewideget.dart';
class DiabeticChart extends StatefulWidget {
DiabeticChart({
Key key,
Key? key,
}) : super(key: key);
@override
@ -45,11 +45,11 @@ class _DiabeticChartState extends State<DiabeticChart> {
DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4)
];
DiabeticType selectedDiabeticType;
late DiabeticType selectedDiabeticType;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
ProjectViewModel projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>(
@ -199,7 +199,7 @@ class _DiabeticChartState extends State<DiabeticChart> {
],
),
)
: ErrorMessage(error: TranslationBase.of(context).noItem),
: ErrorMessage(error: TranslationBase.of(context).noItem!),
],
),
)),

@ -13,7 +13,7 @@ class DiabeticDetails extends StatefulWidget {
final List<GetDiabeticChartValuesResponseModel> diabeticDetailsList;
DiabeticDetails(
{Key? key, this.diabeticDetailsList,});
{Key? key, required this.diabeticDetailsList,});
@override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -70,7 +70,7 @@ class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
),
Table(
border: TableBorder(
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]),
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!),
),
children: fullData(projectViewModel),
),

@ -12,7 +12,7 @@ class LineChartForDiabetic extends StatelessWidget {
final bool isOX;
LineChartForDiabetic(
{this.title, this.timeSeries1, this.indexes, this.isOX= false});
{required this.title, required this.timeSeries1, required this.indexes, this.isOX= false});
List<int> xAxixs = [];
List<double> yAxixs = [];
@ -93,7 +93,7 @@ class LineChartForDiabetic extends StatelessWidget {
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
getTextStyles: (value) => TextStyle(
color: Colors.black,
fontSize: 10,
),

@ -39,20 +39,20 @@ class DiagnosisScreen extends StatefulWidget {
class _ProgressNoteState extends State<DiagnosisScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
late AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel;
getDiagnosisForInPatient(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type);
GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel =
GetDiagnosisForInPatientRequestModel(
admissionNo: int.parse(patient.admissionNo),
patientTypeID: patient.patientType,
admissionNo: int.parse(patient!.admissionNo!),
patientTypeID: patient!.patientType!,
patientID: patient.patientId, setupID: "010266");
model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel);
}
@ -61,7 +61,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
@ -77,7 +77,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
body: model.diagnosisForInPatientList == null ||
model.diagnosisForInPatientList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).noItem)
error: TranslationBase.of(context).noItem!)
: Container(
color: Colors.grey[200],
child: Column(
@ -209,7 +209,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
AppText(
TranslationBase.of(
context)
.icd + " : ",
.icd! + " : ",
fontSize: 12,
),
Expanded(

@ -14,9 +14,8 @@ import 'discharge_Summary_widget.dart';
class AllDischargeSummary extends StatefulWidget {
final Function changeCurrentTab;
const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key);
const AllDischargeSummary({Key? key}) : super(key: key);
@override
_AllDischargeSummaryState createState() => _AllDischargeSummaryState();
@ -35,7 +34,7 @@ class _AllDischargeSummaryState extends State<AllDischargeSummary> {
baseViewModel: model,
isShowAppBar: false,
body: model.pendingDischargeSummaryList.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column(
children: [
Expanded(

@ -57,7 +57,7 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
return WillPopScope(

@ -44,7 +44,7 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
body: model.pendingDischargeSummaryList.isEmpty
? ErrorMessage(
error: TranslationBase.of(context)
.noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
.noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column(
children: [
Expanded(

@ -31,7 +31,7 @@ class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];

@ -45,7 +45,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
getProgressNoteList(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
@ -62,7 +62,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];

@ -50,7 +50,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];

@ -13,7 +13,7 @@ class PendingOrdersScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];

@ -1,6 +1,7 @@
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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
@ -13,7 +14,8 @@ import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final PatientProfileAppBarModel patientProfileAppBarModel;
final PatiantInformtion? patient;
final PatientProfileAppBarModel? patientProfileAppBarModel;
final double? height;
final bool isInpatient;
final bool isDischargedPatient;
@ -34,17 +36,42 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final bool? isFromLabResult;
final VoidCallback? onPressed;
PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed, this.height, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare= false, this.doctorName, this.branch, this.appointmentDate, this.profileUrl, this.invoiceNO, this.orderNo, this.isPrescriptions, this.isMedicalFile, this.episode, this.visitDate, this.clinic, this.isAppointmentHeader});
PatientProfileAppBar(this.patient,
{ this.patientProfileAppBarModel,
this.isFromLabResult = false,
this.onPressed,
this.height,
this.isInpatient = false,
this.isDischargedPatient = false,
this.isFromLiveCare = false,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo,
this.isPrescriptions,
this.isMedicalFile,
this.episode,
this.visitDate,
this.clinic,
this.isAppointmentHeader});
late PatiantInformtion localPatient;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
if (patient == null) {
localPatient = patientProfileAppBarModel!.patient!;
} else {
localPatient = patient!;
}
int gender = 1;
if (patientProfileAppBarModel.patient!.patientDetails != null) {
gender = patientProfileAppBarModel.patient!.patientDetails!.gender!;
if (localPatient!.patientDetails != null) {
gender = localPatient!.patientDetails!.gender!;
} else {
gender = patientProfileAppBarModel.patient!.gender!;
gender = localPatient!.gender!;
}
return Container(
@ -75,12 +102,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
Expanded(
child: AppText(
patientProfileAppBarModel.patient!.firstName != null
? (Helpers.capitalize(patientProfileAppBarModel.patient!.firstName) +
localPatient!.firstName != null
? (Helpers.capitalize(localPatient!.firstName) +
" " +
Helpers.capitalize(patientProfileAppBarModel.patient!.lastName))
: Helpers.capitalize(patientProfileAppBarModel.patient!.fullName ??
patientProfileAppBarModel.patient!.patientDetails!.fullName!),
Helpers.capitalize(localPatient!.lastName))
: Helpers.capitalize(localPatient!.fullName ??
localPatient!.patientDetails!.fullName!),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -101,7 +128,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!);
launch("tel://" + localPatient!.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -109,24 +136,30 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
),
),
if(patientProfileAppBarModel.videoCallDurationStream != null)
StreamBuilder(
stream: patientProfileAppBarModel.videoCallDurationStream,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
if(snapshot.hasData && snapshot.data != null)
return InkWell(
onTap: (){
},
child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(snapshot.data!, style: TextStyle(color: Colors.white),),
),
);
else
return Container();
},
),
if (patientProfileAppBarModel!.videoCallDurationStream != null)
StreamBuilder(
stream: patientProfileAppBarModel!.videoCallDurationStream,
builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.hasData && snapshot.data != null)
return InkWell(
onTap: () {},
child: Container(
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(
vertical: 2, horizontal: 10),
child: Text(
snapshot.data!,
style: TextStyle(color: Colors.white),
),
),
);
else
return Container();
},
),
]),
),
Row(children: [
@ -137,7 +170,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
child: Image.asset(
gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -149,12 +184,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
patientProfileAppBarModel.patient!.patientStatusType != null
localPatient!.patientStatusType != null
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patientProfileAppBarModel.patient!.patientStatusType == 43
localPatient!.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
@ -173,8 +208,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
.getTextMultiplierBasedOnWidth() *
3.5,
),
patientProfileAppBarModel.patient!.startTime != null
? AppText(patientProfileAppBarModel.patient!.startTime != null ? patientProfileAppBarModel.patient!.startTime : '',
localPatient!.startTime != null
? AppText(
localPatient!.startTime != null
? localPatient!.startTime
: '',
fontWeight: FontWeight.w700,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
@ -202,7 +240,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: 1,
),
AppText(
patientProfileAppBarModel.patient!.patientId.toString(),
localPatient!.patientId.toString(),
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
@ -215,23 +253,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Row(
children: [
AppText(
patientProfileAppBarModel.patient!.nationalityName ??
patientProfileAppBarModel.patient!.nationality ??
patientProfileAppBarModel.patient!.nationalityId ??
localPatient!.nationalityName ??
localPatient!.nationality ??
localPatient!.nationalityId ??
'',
fontWeight: FontWeight.bold,
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
),
patientProfileAppBarModel.patient!.nationalityFlagURL != null
localPatient!.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patientProfileAppBarModel.patient!.nationalityFlagURL!,
localPatient!.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
errorBuilder: (BuildContext context,
Object exception,
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -244,47 +284,46 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
HeaderRow(
label: TranslationBase.of(context).age! + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),if (patientProfileAppBarModel.patient!.appointmentDate != null &&
patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty &&
"${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),
if (localPatient!.appointmentDate != null &&
localPatient!.appointmentDate!.isNotEmpty &&
!isFromLabResult!)
HeaderRow(
label:
TranslationBase.of(context).appointmentDate! + " : ",
value:
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)),
label: TranslationBase.of(context).appointmentDate! +
" : ",
value: AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
localPatient!.appointmentDate!)),
),
if (patientProfileAppBarModel.isFromLabResult!)
HeaderRow(
label: "Result Date: ",
value:
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}',
if (patientProfileAppBarModel!.isFromLabResult!)
HeaderRow(
label: "Result Date: ",
value:
'${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel!.appointmentDate!, isArabic: projectViewModel.isArabic)}',
),
// if(isInpatient)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (patientProfileAppBarModel.patient!.admissionDate != null &&
patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty)
if (localPatient!.admissionDate != null &&
localPatient!.admissionDate!.isNotEmpty)
HeaderRow(
label: patientProfileAppBarModel.patient!.admissionDate == null
label: localPatient!.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate! +
" : ",
value: patientProfileAppBarModel.patient!.admissionDate == null
value: localPatient!.admissionDate == null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}",
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate.toString())))}",
),
if (patientProfileAppBarModel.patient!.admissionDate != null)
if (localPatient!.admissionDate != null)
HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patientProfileAppBarModel.patient!.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}",
localPatient!.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}",
)
],
),
@ -292,7 +331,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
),
]),
if (patientProfileAppBarModel.isAppointmentHeader!)
if (patientProfileAppBarModel!.isAppointmentHeader!)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -300,12 +339,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom: BorderSide(color: Colors.grey[400]!, width: 2.5),
left: BorderSide(color: Colors.grey[400]!, width: 2.5),
bottom:
BorderSide(color: Colors.grey[400]!, width: 2.5),
left:
BorderSide(color: Colors.grey[400]!, width: 2.5),
)),
),
Expanded(
@ -316,8 +359,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
children: <Widget>[
Container(
child: LargeAvatar(
name: patientProfileAppBarModel.doctorName ?? "",
url: patientProfileAppBarModel.profileUrl,
name: patientProfileAppBarModel!.doctorName ?? "",
url: patientProfileAppBarModel!.profileUrl,
),
width: 25,
height: 25,
@ -346,7 +389,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
),
if (invoiceNO != null && !isPrescriptions!)
HeaderRow(
label: 'Invoice: ',
label: 'Invoice: ',
value: invoiceNO ?? "",
),
if (branch != null)
@ -376,8 +419,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
),
]),
),
]),
),
),
],
@ -395,21 +438,21 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
@override
Size get preferredSize => Size(
double.maxFinite,
patientProfileAppBarModel.height == 0
? patientProfileAppBarModel.isAppointmentHeader!
patientProfileAppBarModel!.height == 0
? patientProfileAppBarModel!.isAppointmentHeader!
? 270
: ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty)
? patientProfileAppBarModel.isFromLabResult!
: ((localPatient!.appointmentDate!.isNotEmpty)
? patientProfileAppBarModel!.isFromLabResult!
? 190
: 170
: patientProfileAppBarModel.patient!.admissionDate != null
? patientProfileAppBarModel.isFromLabResult!
: localPatient!.admissionDate != null
? patientProfileAppBarModel!.isFromLabResult!
? 190
: 170
: patientProfileAppBarModel.isDischargedPatient!
: patientProfileAppBarModel!.isDischargedPatient!
? 240
: 130)
: patientProfileAppBarModel.height!);
: patientProfileAppBarModel!.height!);
}
class HeaderRow extends StatelessWidget {

@ -56,7 +56,7 @@ class AppScaffold extends StatelessWidget {
extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar
? patientProfileAppBarModel != null ? PatientProfileAppBar(
? patientProfileAppBarModel != null ? PatientProfileAppBar(patientProfileAppBarModel!.patient!,
patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ??
AppBar(
elevation: 0,

Loading…
Cancel
Save