fix app bar

merge-requests/935/head
Elham Rababh 4 years ago
parent 4779d29010
commit 8a6a68cdfe

@ -1,3 +1,6 @@
import 'dart:ui';
import '../patiant_info_model.dart';
class PatientProfileAppBarModel {
@ -21,6 +24,8 @@ class PatientProfileAppBarModel {
bool? isFromLabResult;
Stream <String> ?videoCallDurationStream;
VoidCallback? onPressed;
PatientProfileAppBarModel(
{this.height = 0.0,
@ -40,7 +45,7 @@ class PatientProfileAppBarModel {
this.visitDate,
this.clinic,
this.isAppointmentHeader = false,
this.isFromLabResult =false, this.videoCallDurationStream});
this.isFromLabResult =false, this.videoCallDurationStream, this.onPressed});
PatientProfileAppBarModel.fromJson(Map<String, dynamic> json) {
height = json['height'];
@ -62,6 +67,7 @@ class PatientProfileAppBarModel {
isAppointmentHeader = json['isAppointmentHeader'];
isFromLabResult = json['isFromLabResult'];
videoCallDurationStream = json['videoCallDurationStream'];
onPressed = json['onPressed'];
}
@ -86,6 +92,7 @@ class PatientProfileAppBarModel {
data['isAppointmentHeader'] = this.isAppointmentHeader;
data['isFromLabResult'] = this.isFromLabResult;
data['videoCallDurationStream'] = this.videoCallDurationStream;
data['onPressed'] = this.onPressed;
return data;
}
}

@ -210,17 +210,20 @@ class _EndCallScreenState extends State<EndCallScreen> {
appBarTitle: TranslationBase.of(context).patientProfile!,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileAppBar(patient, onPressed: () {
Navigator.pop(context);
},
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
isInpatient: isInpatient,
height: (patient!.patientStatusType != null &&
patient!.patientStatusType == 43)
patient!.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
: 0,
isDischargedPatient: isDischargedPatient),
? 240
: 0,
onPressed: () {
Navigator.pop(context);
} ,
isDischargedPatient: isDischargedPatient
),
body: Container(
height: !isSearchAndOut
? isDischargedPatient

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -22,9 +23,15 @@ class SpecialLabResultDetailsPage extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileAppBar(
patient,
// appBar: PatientProfileAppBar(
// patient,
// ),
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
),
body: Container(
child: SingleChildScrollView(
child: Column(

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
@ -31,8 +32,10 @@ class MedicalReportDetailPage extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileAppBar(
patient,
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
),
body: Container(
child: SingleChildScrollView(

@ -108,15 +108,13 @@ class PatientReferralItemWidget extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: AppText(
patientName!,
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
letterSpacing: -0.64,
),
AppText(
patientName!,
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
letterSpacing: -0.64,
),
SizedBox(
width: 0,
@ -148,34 +146,23 @@ class PatientReferralItemWidget extends StatelessWidget {
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
CustomRow(
label:
TranslationBase.of(context).fileNumber!,
value: patientID!,
),
],
CustomRow(
label:
TranslationBase.of(context).fileNumber!,
value: patientID!,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
label: isSameBranch
CustomRow(
label: isSameBranch
? TranslationBase.of(context)
.referredFrom!
: TranslationBase.of(context).refClinic!,
value: !isReferralClinic!
? isSameBranch
? TranslationBase.of(context)
.referredFrom!
: TranslationBase.of(context).refClinic!,
value: !isReferralClinic!
? isSameBranch
? TranslationBase.of(context)
.sameBranch!
: TranslationBase.of(context)
.otherBranch!
: " " + referralClinic!,
),
],
.sameBranch!
: TranslationBase.of(context)
.otherBranch!
: " " + referralClinic!,
),
],
),
@ -205,15 +192,9 @@ class PatientReferralItemWidget extends StatelessWidget {
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
label: TranslationBase.of(context).remarks! + " : ",
value: remark ?? "",
),
],
CustomRow(
label: TranslationBase.of(context).remarks! + " : ",
value: remark ?? "",
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
@ -256,33 +237,30 @@ class PatientReferralItemWidget extends StatelessWidget {
),
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
referralDoctorName ?? "",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 14.0,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
if (clinicDescription != null)
AppText(
referralDoctorName ?? "",
clinicDescription??"",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 14.0,
color: Color(0xff2E303A),
letterSpacing: -0.56,
fontSize: 10.0,
color: Color(0xff575757),
letterSpacing: -0.4,
),
if (clinicDescription != null)
AppText(
clinicDescription??"",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 10.0,
color: Color(0xff575757),
letterSpacing: -0.4,
),
],
),
],
),
),
],

@ -34,12 +34,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final String? clinic;
final bool? isAppointmentHeader;
final bool? isFromLabResult;
final VoidCallback? onPressed;
// final VoidCallback? onPressed;
PatientProfileAppBar(this.patient,
{ this.patientProfileAppBarModel,
this.isFromLabResult = false,
this.onPressed,
// this.onPressed,
this.height=0,
this.isInpatient = false,
this.isDischargedPatient = false,
@ -96,7 +96,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black,
onPressed: () {
if (onPressed != null) onPressed!();
if (patientProfileAppBarModel!.onPressed != null) patientProfileAppBarModel!.onPressed!();
Navigator.pop(context);
},
),
@ -417,8 +417,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
label: !isPrescriptions!
? 'Result Date:'
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
value: AppDateUtils.getDayMonthYearDateFormatted(
patientProfileAppBarModel!.appointmentDate! )
),
]),
),
@ -438,34 +438,34 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
@override
Size get preferredSize => Size(
double.maxFinite,
height! == 0
? isInpatient
? (isFromLabResult! ? 210 : 200)
: isAppointmentHeader!
? 290
: SizeConfig.isHeightVeryShort
? 137
: SizeConfig.isHeightShort
? 190
: SizeConfig.heightMultiplier *
(SizeConfig.isWidthLarge ? 25 : 20)
: height!
// TODO Elham*2
// patientProfileAppBarModel!.height == 0
// ? patientProfileAppBarModel!.isAppointmentHeader!
// ? 270
// : ((localPatient!.appointmentDate!.isNotEmpty)
// ? patientProfileAppBarModel!.isFromLabResult!
// ? 190
// : 170
// : localPatient!.admissionDate != null
// ? patientProfileAppBarModel!.isFromLabResult!
// ? 190
// : 170
// : patientProfileAppBarModel!.isDischargedPatient!
// ? 240
// : 130)
// : patientProfileAppBarModel!.height!
// height! == 0
// ? isInpatient
// ? (isFromLabResult! ? 210 : 200)
// : isAppointmentHeader!
// ? 290
// : SizeConfig.isHeightVeryShort
// ? 137
// : SizeConfig.isHeightShort
// ? 190
// : SizeConfig.heightMultiplier *
// (SizeConfig.isWidthLarge ? 25 : 20)
// : height!
// // TODO Elham*2
patientProfileAppBarModel!.height == 0
? patientProfileAppBarModel!.isAppointmentHeader!
? 270
: ((patientProfileAppBarModel!.patient!.appointmentDate!.isNotEmpty)
? patientProfileAppBarModel!.isFromLabResult!
? 190
: 200
: patientProfileAppBarModel!.patient!.admissionDate != null
? patientProfileAppBarModel!.isFromLabResult!
? 190
: 170
: patientProfileAppBarModel!.isDischargedPatient!
? 240
: 130)
: patientProfileAppBarModel!.height!
);
}

Loading…
Cancel
Save