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

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

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

@ -108,15 +108,13 @@ class PatientReferralItemWidget extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( AppText(
child: AppText( patientName!,
patientName!, fontSize: 16.0,
fontSize: 16.0, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, color: Color(0xff2E303A),
color: Color(0xff2E303A), fontFamily: 'Poppins',
fontFamily: 'Poppins', letterSpacing: -0.64,
letterSpacing: -0.64,
),
), ),
SizedBox( SizedBox(
width: 0, width: 0,
@ -148,34 +146,23 @@ class PatientReferralItemWidget extends StatelessWidget {
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( CustomRow(
mainAxisAlignment: MainAxisAlignment.start, label:
children: [ TranslationBase.of(context).fileNumber!,
CustomRow( value: patientID!,
label:
TranslationBase.of(context).fileNumber!,
value: patientID!,
),
],
), ),
Row( CustomRow(
mainAxisAlignment: MainAxisAlignment.start, label: isSameBranch
crossAxisAlignment: CrossAxisAlignment.start, ? TranslationBase.of(context)
children: [ .referredFrom!
CustomRow( : TranslationBase.of(context).refClinic!,
label: isSameBranch value: !isReferralClinic!
? isSameBranch
? TranslationBase.of(context) ? TranslationBase.of(context)
.referredFrom! .sameBranch!
: TranslationBase.of(context).refClinic!, : TranslationBase.of(context)
value: !isReferralClinic! .otherBranch!
? isSameBranch : " " + referralClinic!,
? TranslationBase.of(context)
.sameBranch!
: TranslationBase.of(context)
.otherBranch!
: " " + referralClinic!,
),
],
), ),
], ],
), ),
@ -205,15 +192,9 @@ class PatientReferralItemWidget extends StatelessWidget {
) )
], ],
), ),
Row( CustomRow(
mainAxisAlignment: MainAxisAlignment.start, label: TranslationBase.of(context).remarks! + " : ",
crossAxisAlignment: CrossAxisAlignment.start, value: remark ?? "",
children: [
CustomRow(
label: TranslationBase.of(context).remarks! + " : ",
value: remark ?? "",
),
],
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -256,33 +237,30 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
), ),
), ),
Expanded( Container(
flex: 4, margin: EdgeInsets.only(
child: Container( left: 10, top: 25, right: 10, bottom: 0),
margin: EdgeInsets.only( child: Column(
left: 10, top: 25, right: 10, bottom: 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, AppText(
children: [ referralDoctorName ?? "",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 14.0,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
if (clinicDescription != null)
AppText( AppText(
referralDoctorName ?? "", clinicDescription??"",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14.0, fontSize: 10.0,
color: Color(0xff2E303A), color: Color(0xff575757),
letterSpacing: -0.56, 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 String? clinic;
final bool? isAppointmentHeader; final bool? isAppointmentHeader;
final bool? isFromLabResult; final bool? isFromLabResult;
final VoidCallback? onPressed; // final VoidCallback? onPressed;
PatientProfileAppBar(this.patient, PatientProfileAppBar(this.patient,
{ this.patientProfileAppBarModel, { this.patientProfileAppBarModel,
this.isFromLabResult = false, this.isFromLabResult = false,
this.onPressed, // this.onPressed,
this.height=0, this.height=0,
this.isInpatient = false, this.isInpatient = false,
this.isDischargedPatient = false, this.isDischargedPatient = false,
@ -96,7 +96,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () { onPressed: () {
if (onPressed != null) onPressed!(); if (patientProfileAppBarModel!.onPressed != null) patientProfileAppBarModel!.onPressed!();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -417,8 +417,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
label: !isPrescriptions! label: !isPrescriptions!
? 'Result Date:' ? 'Result Date:'
: 'Prescriptions Date ', : 'Prescriptions Date ',
value: value: AppDateUtils.getDayMonthYearDateFormatted(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', patientProfileAppBarModel!.appointmentDate! )
), ),
]), ]),
), ),
@ -438,34 +438,34 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
@override @override
Size get preferredSize => Size( Size get preferredSize => Size(
double.maxFinite, double.maxFinite,
height! == 0 // height! == 0
? isInpatient // ? isInpatient
? (isFromLabResult! ? 210 : 200) // ? (isFromLabResult! ? 210 : 200)
: isAppointmentHeader! // : isAppointmentHeader!
? 290 // ? 290
: SizeConfig.isHeightVeryShort // : SizeConfig.isHeightVeryShort
? 137 // ? 137
: SizeConfig.isHeightShort // : SizeConfig.isHeightShort
? 190 // ? 190
: SizeConfig.heightMultiplier * // : SizeConfig.heightMultiplier *
(SizeConfig.isWidthLarge ? 25 : 20) // (SizeConfig.isWidthLarge ? 25 : 20)
: height! // : height!
// TODO Elham*2 // // TODO Elham*2
// patientProfileAppBarModel!.height == 0 patientProfileAppBarModel!.height == 0
// ? patientProfileAppBarModel!.isAppointmentHeader! ? patientProfileAppBarModel!.isAppointmentHeader!
// ? 270 ? 270
// : ((localPatient!.appointmentDate!.isNotEmpty) : ((patientProfileAppBarModel!.patient!.appointmentDate!.isNotEmpty)
// ? patientProfileAppBarModel!.isFromLabResult! ? patientProfileAppBarModel!.isFromLabResult!
// ? 190 ? 190
// : 170 : 200
// : localPatient!.admissionDate != null : patientProfileAppBarModel!.patient!.admissionDate != null
// ? patientProfileAppBarModel!.isFromLabResult! ? patientProfileAppBarModel!.isFromLabResult!
// ? 190 ? 190
// : 170 : 170
// : patientProfileAppBarModel!.isDischargedPatient! : patientProfileAppBarModel!.isDischargedPatient!
// ? 240 ? 240
// : 130) : 130)
// : patientProfileAppBarModel!.height! : patientProfileAppBarModel!.height!
); );
} }

Loading…
Cancel
Save