Merge branch 'flutter_vervion_2_by_elham' into 'flutter_2_developemt'

Flutter vervion 2 by elham

See merge request Cloud_Solution/doctor_app_flutter!890
merge-requests/891/merge
Elham Ali 4 years ago
commit 1eb2221a00

@ -346,7 +346,6 @@ const GET_MEDICATION_FOR_IN_PATIENT =
const GET_EPISODE_FOR_INPATIENT = const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
///Operation Details Services ///Operation Details Services
const GET_RESERVATIONS = const GET_RESERVATIONS =
@ -377,12 +376,15 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT = const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode"; "Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const PATIENT_REGISTRATION =
const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo"; "Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo";
/// Discharge Summary /// Discharge Summary
const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; const GET_PENDING_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
var selectedPatientType = 1; var selectedPatientType = 1;

@ -10,18 +10,40 @@ import 'package:doctor_app_flutter/models/operation_report/get_reservations_requ
class DischargeSummaryService extends BaseService { class DischargeSummaryService extends BaseService {
List<GetDischargeSummaryResModel> _pendingDischargeSummaryList = []; List<GetDischargeSummaryResModel> _pendingDischargeSummaryList = [];
List<GetDischargeSummaryResModel> get pendingDischargeSummaryList => _pendingDischargeSummaryList; List<GetDischargeSummaryResModel> get pendingDischargeSummaryList =>
_pendingDischargeSummaryList;
List<GetDischargeSummaryResModel> _allDischargeSummaryList = [];
List<GetDischargeSummaryResModel> get allDischargeSummaryList =>
_allDischargeSummaryList;
Future getPendingDischargeSummary( Future getPendingDischargeSummary(
{required GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { {required GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
hasError = false; hasError = false;
await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_pendingDischargeSummaryList.clear(); _pendingDischargeSummaryList.clear();
response['List_PendingDischargeSummary'].forEach( response['List_PendingDischargeSummary'].forEach(
(v) { (v) {
_pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); _pendingDischargeSummaryList
.add(GetDischargeSummaryResModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getDischargeSummaryReqModel.toJson());
}
Future getAllDischargeSummary(
{GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
hasError = false;
await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY,
onSuccess: (dynamic response, int statusCode) {
_allDischargeSummaryList.clear();
response['List_DischargeSummary'].forEach(
(v) {
_allDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v));
}, },
); );
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -81,7 +81,7 @@ List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
// setState(ViewState.Idle); // setState(ViewState.Idle);
} }
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
ClinicModel clinicModel = ClinicModel( ClinicModel clinicModel = ClinicModel(

@ -15,6 +15,10 @@ class DischargeSummaryViewModel extends BaseViewModel {
_dischargeSummaryService.pendingDischargeSummaryList; _dischargeSummaryService.pendingDischargeSummaryList;
List<GetDischargeSummaryResModel> get allDisChargeSummaryList =>
_dischargeSummaryService.allDischargeSummaryList;
Future getPendingDischargeSummary({required int patientId, required int admissionNo, }) async { Future getPendingDischargeSummary({required int patientId, required int admissionNo, }) async {
GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId );
hasError = false; hasError = false;
@ -28,4 +32,19 @@ class DischargeSummaryViewModel extends BaseViewModel {
} }
} }
Future getAllDischargeSummary({int patientId, int admissionNo, }) async {
GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId );
hasError = false;
setState(ViewState.Busy);
await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel);
if (_dischargeSummaryService.hasError) {
error = _dischargeSummaryService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
} }

File diff suppressed because it is too large Load Diff

@ -28,69 +28,73 @@ class GetDischargeSummaryResModel {
int editedBy; int editedBy;
String editedOn; String editedOn;
bool isPatientDied; bool isPatientDied;
Null isMedicineApproved; dynamic isMedicineApproved;
Null isOpenBillDischarge; dynamic isOpenBillDischarge;
Null activatedDate; dynamic activatedDate;
Null activatedBy; dynamic activatedBy;
Null lAMA; dynamic lAMA;
Null patientCodition; dynamic patientCodition;
Null others; dynamic others;
Null reconciliationInstruction; dynamic reconciliationInstruction;
String dischargeInstructions; String dischargeInstructions;
String reason; String reason;
Null dischargeDisposition; dynamic dischargeDisposition;
Null hospitalID; dynamic hospitalID;
String createdByName; String createdByName;
Null createdByNameN; dynamic createdByNameN;
String editedByName; String editedByName;
Null editedByNameN; dynamic editedByNameN;
String clinicName;
String projectName;
GetDischargeSummaryResModel( GetDischargeSummaryResModel(
{this.setupID, {this.setupID,
this.projectID, this.projectID,
this.dischargeNo, this.dischargeNo,
this.dischargeDate, this.dischargeDate,
this.admissionNo, this.admissionNo,
this.assessmentNo, this.assessmentNo,
this.patientType, this.patientType,
this.patientID, this.patientID,
this.clinicID, this.clinicID,
this.doctorID, this.doctorID,
this.finalDiagnosis, this.finalDiagnosis,
this.persentation, this.persentation,
this.pastHistory, this.pastHistory,
this.planOfCare, this.planOfCare,
this.investigations, this.investigations,
this.followupPlan, this.followupPlan,
this.conditionOnDischarge, this.conditionOnDischarge,
this.significantFindings, this.significantFindings,
this.planedProcedure, this.planedProcedure,
this.daysStayed, this.daysStayed,
this.remarks, this.remarks,
this.eRCare, this.eRCare,
this.status, this.status,
this.isActive, this.isActive,
this.createdBy, this.createdBy,
this.createdOn, this.createdOn,
this.editedBy, this.editedBy,
this.editedOn, this.editedOn,
this.isPatientDied, this.isPatientDied,
this.isMedicineApproved, this.isMedicineApproved,
this.isOpenBillDischarge, this.isOpenBillDischarge,
this.activatedDate, this.activatedDate,
this.activatedBy, this.activatedBy,
this.lAMA, this.lAMA,
this.patientCodition, this.patientCodition,
this.others, this.others,
this.reconciliationInstruction, this.reconciliationInstruction,
this.dischargeInstructions, this.dischargeInstructions,
this.reason, this.reason,
this.dischargeDisposition, this.dischargeDisposition,
this.hospitalID, this.hospitalID,
this.createdByName, this.createdByName,
this.createdByNameN, this.createdByNameN,
this.editedByName, this.editedByName,
this.editedByNameN}); this.editedByNameN,
this.clinicName,
this.projectName});
GetDischargeSummaryResModel.fromJson(Map<String, dynamic> json) { GetDischargeSummaryResModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
@ -138,6 +142,8 @@ class GetDischargeSummaryResModel {
createdByNameN = json['CreatedByNameN']; createdByNameN = json['CreatedByNameN'];
editedByName = json['EditedByName']; editedByName = json['EditedByName'];
editedByNameN = json['EditedByNameN']; editedByNameN = json['EditedByNameN'];
clinicName = json['ClinicDescription'];
projectName = json['ProjectName'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -187,6 +193,9 @@ class GetDischargeSummaryResModel {
data['CreatedByNameN'] = this.createdByNameN; data['CreatedByNameN'] = this.createdByNameN;
data['EditedByName'] = this.editedByName; data['EditedByName'] = this.editedByName;
data['EditedByNameN'] = this.editedByNameN; data['EditedByNameN'] = this.editedByNameN;
data['ClinicDescription'] = this.clinicName;
data['ProjectName'] = this.projectName;
return data; return data;
} }
} }

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -25,6 +26,7 @@ import '../../widgets/auth/verification_methods_list.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
///TODO Elham* check if this still in user or not
class VerificationMethodsScreen extends StatefulWidget { class VerificationMethodsScreen extends StatefulWidget {
final password; final password;
@ -339,7 +341,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
SecondaryButton( SecondaryButton(
label: TranslationBase label: TranslationBase
.of(context) .of(context)
.useAnotherAccount, .useAnotherAccount??'',
color: Color(0xFFD02127), color: Color(0xFFD02127),
//fontWeight: FontWeight.w700, //fontWeight: FontWeight.w700,
onTap: () { onTap: () {
@ -387,7 +389,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await sharedPref.setString(TOKEN, await sharedPref.setString(TOKEN,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType,isSilentLogin: true); this.startSMSService(authMethodType,isSilentLogin: true);
@ -470,8 +472,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({String value,bool isSilentLogin = false}) async { checkActivationCode({String? value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);

@ -12,9 +12,8 @@ import 'package:flutter/material.dart';
import 'doctor_repaly_chat.dart'; import 'doctor_repaly_chat.dart';
class AllDoctorQuestions extends StatefulWidget { class AllDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); const AllDoctorQuestions({Key? key}) : super(key: key);
@override @override
_AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState();
@ -31,10 +30,9 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false, isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty 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( : Column(
children: [ children: [
Expanded( Expanded(
@ -82,7 +80,7 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
}); });
model.getDoctorReply(pageIndex: pageIndex); model.getDoctorReply(pageIndex: pageIndex);
} }
return; return false;
}, },
), ),
), ),

@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget {
final DoctorReplayViewModel previousModel; final DoctorReplayViewModel previousModel;
bool showMsgBox = false; bool showMsgBox = false;
DoctorReplayChat( DoctorReplayChat(
{Key? key, this.reply, this.previousModel, {Key? key, required this.reply, required this.previousModel,
}); });
@override @override
@ -37,8 +37,8 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(widget.reply.doctorResponse.isNotEmpty){ if(widget.reply.doctorResponse!.isNotEmpty){
msgController.text = widget.reply.doctorResponse; msgController.text = widget.reply.doctorResponse!;
} else { } else {
widget.showMsgBox = true; widget.showMsgBox = true;
@ -172,7 +172,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
margin: EdgeInsets.symmetric(horizontal: 0), margin: EdgeInsets.symmetric(horizontal: 0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" +widget.reply.mobileNumber); launch("tel://" +widget.reply.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -194,7 +194,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
), ),
AppText( AppText(
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.white, color: Colors.white,
@ -236,7 +236,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
SizedBox(height: 30,), SizedBox(height: 30,),
SizedBox(height: 30,), SizedBox(height: 30,),
if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty)
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(
@ -269,7 +269,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
width: 50, width: 50,
height: 50, height: 50,
child: Image.asset( child: Image.asset(
widget.previousModel.doctorProfile.gender == 0 widget.previousModel.doctorProfile!.gender == 0
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -280,7 +280,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: AppText( child: AppText(
widget.previousModel.doctorProfile.doctorName, widget.previousModel.doctorProfile!.doctorName,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),

@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart';
class DoctorReplyScreen extends StatefulWidget { class DoctorReplyScreen extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key); const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key);
@override @override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState(); _DoctorReplyScreenState createState() => _DoctorReplyScreenState();
@ -36,7 +36,7 @@ class DoctorReplyScreen extends StatefulWidget {
class _DoctorReplyScreenState extends State<DoctorReplyScreen> class _DoctorReplyScreenState extends State<DoctorReplyScreen>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
int pageIndex = 1; int pageIndex = 1;
@ -69,7 +69,7 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen>
return false; return false;
}, },
child: AppScaffold( child: AppScaffold(
appBarTitle: TranslationBase.of(context).replay2, appBarTitle: TranslationBase.of(context).replay2!,
isShowAppBar: false, isShowAppBar: false,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -109,7 +109,7 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen>
tabWidget( tabWidget(
screenSize, screenSize,
_activeTab == 1, _activeTab == 1,
TranslationBase.of(context).all, TranslationBase.of(context).all!,
), ),
], ],
), ),

@ -188,10 +188,10 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
isCopyable:false, isCopyable:false,
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age! + " : ",
isCopyable:false, isCopyable:false,
value: value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}",
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -213,7 +213,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: text:
TranslationBase.of(context).requestType + TranslationBase.of(context).requestType! +
": ", ": ",
style: TextStyle( style: TextStyle(
fontSize: SizeConfig fontSize: SizeConfig

@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart';
class NotRepliedDoctorQuestions extends StatefulWidget { class NotRepliedDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
const NotRepliedDoctorQuestions({Key? key, this.changeCurrentTab}) const NotRepliedDoctorQuestions({Key? key, required this.changeCurrentTab})
: super(key: key); : super(key: key);
@override @override
@ -33,10 +33,10 @@ class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2, appBarTitle: TranslationBase.of(context).replay2!,
isShowAppBar: false, isShowAppBar: false,
body: model.listDoctorNotRepliedQuestions.isEmpty body: model.listDoctorNotRepliedQuestions.isEmpty
? ErrorMessage(error: TranslationBase.of(context).noItem) ? ErrorMessage(error: TranslationBase.of(context).noItem!)
: Column( : Column(
children: [ children: [
Expanded( Expanded(
@ -91,7 +91,7 @@ class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
}); });
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
} }
return; return false;
}, },
), ),
), ),

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget { class HomePatientCard extends StatelessWidget {
final Color backgroundColor; final Color backgroundColor;
final IconData cardIcon; final IconData cardIcon;
final String cardIconImage; final String? cardIconImage;
final Color backgroundIconColor; final Color backgroundIconColor;
final String text; final String text;
final Color textColor; final Color textColor;
@ -17,7 +17,7 @@ class HomePatientCard extends StatelessWidget {
required this.backgroundColor, required this.backgroundColor,
required this.backgroundIconColor, required this.backgroundIconColor,
required this.cardIcon, required this.cardIcon,
required this.cardIconImage, this.cardIconImage,
required this.text, required this.text,
required this.textColor, required this.textColor,
required this.onTap, required this.onTap,
@ -75,7 +75,7 @@ class HomePatientCard extends StatelessWidget {
color: textColor, color: textColor,
) )
: Image.asset( : Image.asset(
cardIconImage, cardIconImage!,
height: iconSize, height: iconSize,
width: iconSize, width: iconSize,
), ),

@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPat
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
@ -29,6 +30,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../routes.dart'; import '../../routes.dart';
import 'home_screen_header.dart'; import 'home_screen_header.dart';
@ -51,7 +53,7 @@ class _HomeScreenState extends State<HomeScreen> {
bool isExpanded = false; bool isExpanded = false;
bool isInpatient = false; bool isInpatient = false;
int sliderActiveIndex = 0; int sliderActiveIndex = 0;
String? clinicId; var clinicId;
late AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
int colorIndex = 0; int colorIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
@ -328,22 +330,6 @@ class _HomeScreenState extends State<HomeScreen> {
DashboardViewModel model, projectsProvider) { DashboardViewModel model, projectsProvider) {
colorIndex = 0; colorIndex = 0;
// List<Color> backgroundColors = List(3);
// backgroundColors[0] = Color(0xffD02127);
// backgroundColors[1] = Colors.grey[300];
// backgroundColors[2] = Color(0xff2B353E);
// List<Color> backgroundIconColors = List(3);
// backgroundIconColors[0] = Colors.white12;
// backgroundIconColors[1] = Colors.white38;
// backgroundIconColors[2] = Colors.white10;
// List<Color> textColors = List(3);
// textColors[0] = Colors.white;
// textColors[1] = Color(0xFF353E47);
// textColors[2] = Colors.white;
//
// List<HomePatientCard> patientCards = [];
//
List<Color> backgroundColors = []; List<Color> backgroundColors = [];
backgroundColors.add(Color(0xffD02127)); backgroundColors.add(Color(0xffD02127));
backgroundColors.add(Colors.grey[300]!); backgroundColors.add(Colors.grey[300]!);
@ -407,7 +393,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
FadePage( FadePage(
page: InPatientScreen( page: InPatientScreen(
specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!), specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!)!,
), ),
), ),
); );
@ -421,7 +407,7 @@ class _HomeScreenState extends State<HomeScreen> {
//TODO Elham* match the of the icon //TODO Elham* match the of the icon
cardIcon: DoctorApp.arrival_patients, cardIcon: DoctorApp.arrival_patients,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context).registerNewPatient, text: TranslationBase.of(context).registerNewPatient!,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,

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

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

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

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

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

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

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

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

@ -53,7 +53,7 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
@override @override
Widget build(BuildContext context) { 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']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];

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

@ -26,7 +26,7 @@ import 'diabetic_details_blood_pressurewideget.dart';
class DiabeticChart extends StatefulWidget { class DiabeticChart extends StatefulWidget {
DiabeticChart({ DiabeticChart({
Key key, Key? key,
}) : super(key: key); }) : super(key: key);
@override @override
@ -45,11 +45,11 @@ class _DiabeticChartState extends State<DiabeticChart> {
DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4)
]; ];
DiabeticType selectedDiabeticType; late DiabeticType selectedDiabeticType;
@override @override
Widget build(BuildContext context) { 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']; PatiantInformtion patient = routeArgs['patient'];
ProjectViewModel projectsProvider = Provider.of(context); ProjectViewModel projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>( 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; final List<GetDiabeticChartValuesResponseModel> diabeticDetailsList;
DiabeticDetails( DiabeticDetails(
{Key? key, this.diabeticDetailsList,}); {Key? key, required this.diabeticDetailsList,});
@override @override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -70,7 +70,7 @@ class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
), ),
Table( Table(
border: TableBorder( border: TableBorder(
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!),
), ),
children: fullData(projectViewModel), children: fullData(projectViewModel),
), ),

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

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

@ -1,66 +1,92 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'discharge_Summary_widget.dart'; import 'discharge_Summary_widget.dart';
class AllDischargeSummary extends StatefulWidget { class AllDischargeSummary extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatiantInformtion patient;
const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key); const AllDischargeSummary({this.changeCurrentTab, this.patient});
@override @override
_AllDischargeSummaryState createState() => _AllDischargeSummaryState(); _AllDischargeSummaryState createState() => _AllDischargeSummaryState();
} }
class _AllDischargeSummaryState extends State<AllDischargeSummary> { class _AllDischargeSummaryState extends State<AllDischargeSummary> {
int pageIndex = 1; int pageIndex = 1;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<DischargeSummaryViewModel>( return BaseView<DischargeSummaryViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getPendingDischargeSummary(); model.getAllDischargeSummary(
patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo),
);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: model.pendingDischargeSummaryList.isEmpty body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty
: Column( ? ErrorMessage(
children: [ error: TranslationBase.of(context).noDataAvailable)
Expanded( : Column(
child: Container( children: [
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), Padding(
child: ListView.builder( padding: const EdgeInsets.all(8.0),
scrollDirection: Axis.vertical, child: Column(
itemCount: model.pendingDischargeSummaryList.length, children: [
shrinkWrap: true, Row(
itemBuilder: (BuildContext ctxt, int index) { children: [
return Column( AppText(
children: [ TranslationBase.of(context).discharge,
InkWell( fontSize: 15.0,
child: DischargeSummaryWidget( fontWeight: FontWeight.w600,
dischargeSummary: model fontFamily: 'Poppins',
.pendingDischargeSummaryList[index]), ),
), ],
),
], Row(
); children: [
}), AppText(
), TranslationBase.of(context).summary,
), fontSize: 25.0,
], fontWeight: FontWeight.w700,
), ),
],
),
],
),
),
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: model.allDisChargeSummaryList.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
child: DischargeSummaryWidget(
dischargeSummary: model
.allDisChargeSummaryList[index]),
),
],
);
}),
),
),
],
),
), ),
); );
} }

@ -1,19 +1,17 @@
import 'package:doctor_app_flutter/config/config.dart';
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/project_view_model.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/discharge_summary/GetDischargeSummaryResModel.dart'; import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class DischargeSummaryWidget extends StatefulWidget { class DischargeSummaryWidget extends StatefulWidget {
final GetDischargeSummaryResModel dischargeSummary; final GetDischargeSummaryResModel dischargeSummary;
@ -26,27 +24,55 @@ class DischargeSummaryWidget extends StatefulWidget {
} }
class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> { class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
bool isCardExpanded = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Column(
child: CardWithBgWidget( children: [
bgColor:Colors.transparent, Container(
hasBorder: false, width: double.infinity,
widget: Container( margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
child: InkWell( padding: EdgeInsets.all(8.0),
child: Column( decoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.white,
children: [ borderRadius: BorderRadius.all(
Row( Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Padding(
padding: EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( CustomRow(
AppDateUtils.getDateTimeFromServerFormat( label: TranslationBase.of(context).doctorName + ": ",
value:
widget.dischargeSummary.createdByName.toString() ??
"".toString(),
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).branch + ": ",
value: widget.dischargeSummary.projectName.toString() ??
"".toString(),
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).clinicName + ": ",
value: widget.dischargeSummary.clinicName.toString() ??
"".toString(),
isCopyable: false,
),
CustomRow(
label: TranslationBase.of(context).dischargeDate + ": ",
value: AppDateUtils.getDateTimeFromServerFormat(
widget.dischargeSummary.createdOn) widget.dischargeSummary.createdOn)
.day .day
.toString() + .toString() +
@ -62,61 +88,149 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
widget.dischargeSummary.createdOn) widget.dischargeSummary.createdOn)
.year .year
.toString(), .toString(),
fontFamily: 'Poppins', isCopyable: false,
fontWeight: FontWeight.w600,
), ),
AppText( ],
AppDateUtils.getDateTimeFromServerFormat( ),
widget.dischargeSummary.createdOn) Column(
.hour crossAxisAlignment: CrossAxisAlignment.end,
.toString() + children: [
":" + InkWell(
AppDateUtils.getDateTimeFromServerFormat( onTap: () {
widget.dischargeSummary.createdOn) setState(() {
.minute isCardExpanded = !isCardExpanded;
.toString(), });
fontFamily: 'Poppins', },
fontWeight: FontWeight.w600, child: Icon(isCardExpanded
) ? EvaIcons.arrowUp
: EvaIcons.arrowDown))
], ],
), ),
], ],
), ),
SizedBox( bodyWidget: Row(
height: 20,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(
width: 20,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// SizedBox(height: 10,), SizedBox(
Row( height: 15.0,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
crossAxisAlignment: CrossAxisAlignment.start, AppText("More Details"),
children: [ SizedBox(
Column( height: 15.0,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ Container(
CustomRow( width: MediaQuery.of(context).size.width * 0.5,
label: TranslationBase.of(context).fileNumber, child: RichText(
value: widget.dischargeSummary.patientID.toString(), maxLines: 3,
isCopyable:false, overflow: TextOverflow.ellipsis,
), text: new TextSpan(
SizedBox( style: new TextStyle(
height: 8, fontSize: 1.3 * SizeConfig.textMultiplier,
), color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text: "Past History" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text: Helpers.parseHtmlString(
widget.dischargeSummary.pastHistory),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
)),
], ],
), ),
], ),
),
SizedBox(
height: 5.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: new TextSpan(
style: new TextStyle(
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text: "Investigations" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text: Helpers.parseHtmlString(
widget.dischargeSummary.investigations ??
""),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
)),
],
),
),
),
SizedBox(
height: 5.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: new TextSpan(
style: new TextStyle(
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0xFF575757)),
children: <TextSpan>[
new TextSpan(
text: "Condition On Discharge" + ": ",
style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan(
text: Helpers.parseHtmlString(widget
.dischargeSummary.conditionOnDischarge),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
)),
],
),
),
),
SizedBox(
height: 5.0,
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
child: RichText( child: RichText(
@ -128,9 +242,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
color: Color(0xFF575757)), color: Color(0xFF575757)),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: text: "Planed Procedure" + ": ",
TranslationBase.of(context).requestType +
": ",
style: TextStyle( style: TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
@ -139,8 +251,8 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
//TranslationBase.of(context).doctorResponse + " : ", //TranslationBase.of(context).doctorResponse + " : ",
)), )),
new TextSpan( new TextSpan(
text: text: Helpers.parseHtmlString(
"${widget.dischargeSummary.dischargeInstructions}", widget.dischargeSummary.planedProcedure),
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig
@ -157,15 +269,11 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
) )
], ],
), ),
// Container( isExpand: isCardExpanded,
// alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, ),
// child: Icon(FontAwesomeIcons.arrowRight,
// size: 20, color: Colors.black),)
],
), ),
// onTap: onTap, ),
)), ],
),
); );
} }
} }

@ -1,18 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart';
import 'package:doctor_app_flutter/util/helpers.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/screens/doctor/doctor_replay/doctor_reply_widget.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';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -23,7 +14,8 @@ import 'pending_discharge_summary.dart';
class DischargeSummaryPage extends StatefulWidget { class DischargeSummaryPage extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
const DischargeSummaryPage({Key? key, this.changeCurrentTab}) : super(key: key); const DischargeSummaryPage({Key? key, this.changeCurrentTab})
: super(key: key);
@override @override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState(); _DoctorReplyScreenState createState() => _DoctorReplyScreenState();
@ -57,7 +49,7 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; 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']; PatiantInformtion patient = routeArgs['patient'];
return WillPopScope( return WillPopScope(
@ -125,8 +117,10 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: [ children: [
PendingDischargeSummary(patient:patient ,), PendingDischargeSummary(
AllDischargeSummary(), patient: patient,
),
AllDischargeSummary(patient: patient),
], ],
), ),
), ),

@ -1,16 +1,11 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.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/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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'discharge_Summary_widget.dart'; import 'discharge_Summary_widget.dart';
class PendingDischargeSummary extends StatefulWidget { class PendingDischargeSummary extends StatefulWidget {
@ -33,9 +28,8 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
return BaseView<DischargeSummaryViewModel>( return BaseView<DischargeSummaryViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getPendingDischargeSummary( model.getPendingDischargeSummary(
patientId: widget.patient.patientId, patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo), admissionNo: int.parse(widget.patient.admissionNo),
); );
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -44,9 +38,35 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
body: model.pendingDischargeSummaryList.isEmpty body: model.pendingDischargeSummaryList.isEmpty
? ErrorMessage( ? ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!)
: Column( : Column(
children: [ children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).discharge,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).summary,
fontSize: 25.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

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

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

@ -50,7 +50,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context); authenticationViewModel = Provider.of(context);
projectViewModel = 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']; PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient')) if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient']; isDischargedPatient = routeArgs['isDischargedPatient'];

@ -13,7 +13,7 @@ class PendingOrdersScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { 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']; PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
@ -36,28 +36,60 @@ class PendingOrdersScreen extends StatelessWidget {
model.pendingOrdersList.length == 0 model.pendingOrdersList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).noDataAvailable) error: TranslationBase.of(context).noDataAvailable)
: Container( : Column(
child: ListView.builder( children: [
itemCount: model.pendingOrdersList.length, Padding(
itemBuilder: (BuildContext ctxt, int index) { padding: const EdgeInsets.all(8.0),
return Padding( child: Column(
padding: EdgeInsets.all(8.0), children: [
child: Container( Row(
decoration: BoxDecoration( children: [
borderRadius: BorderRadius.all( AppText(
Radius.circular(10.0), TranslationBase.of(context).pending,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
), ),
border: Border.all( ],
color: Color(0xFF707070), width: 0.30),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child:
AppText(model.pendingOrdersList[index].notes),
),
), ),
); Row(
})), children: [
AppText(
TranslationBase.of(context).orders,
fontSize: 25.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.pendingOrdersList.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Color(0xFF707070), width: 0.30),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: AppText(
model.pendingOrdersList[index].notes),
),
),
);
})),
],
),
), ),
); );
} }

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

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

Loading…
Cancel
Save