fix design

merge-requests/832/head
mosazaid 5 years ago
parent d70ad7f2c3
commit 702bb5b8da

@ -42,6 +42,7 @@ const Map<String, Map<String, String>> localizedValues = {
"referral": {"en": "Referral", "ar": "الإحالة"}, "referral": {"en": "Referral", "ar": "الإحالة"},
"inPatient": {"en": "InPatients", "ar": "مرضاي"}, "inPatient": {"en": "InPatients", "ar": "مرضاي"},
"myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"}, "myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"},
"myInPatientTitle": {"en": "My InPatients", "ar": "مرضاي المنومين"},
"inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"},
"inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"},
"operations": {"en": "Operations", "ar": "عمليات"}, "operations": {"en": "Operations", "ar": "عمليات"},

@ -0,0 +1,42 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class InPatientHeader extends StatelessWidget with PreferredSizeWidget{
const InPatientHeader() : super();
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
TranslationBase
.of(context)
.inPatient,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
),
),
]),
),
);
}
@override
Size get preferredSize => Size(double.maxFinite,85);
}

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_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/screens/patients/In_patient/InPatientHeader.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/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -33,7 +34,6 @@ class _InPatientScreenState extends State<InPatientScreen>
int selectedMapId; int selectedMapId;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -55,56 +55,29 @@ class _InPatientScreenState extends State<InPatientScreen>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context)
.size;
PatientSearchRequestModel requestModel = PatientSearchRequestModel(); PatientSearchRequestModel requestModel = PatientSearchRequestModel();
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.clearPatientList(); model.clearPatientList();
if (widget.specialClinic != null) { if (widget.specialClinic != null) {
await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); await model
.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
requestModel.nursingStationID = requestModel.nursingStationID =
model.specialClinicalCareMappingList[0].nursingStationID; model.specialClinicalCareMappingList[0].nursingStationID;
} }
requestModel.clinicID = 0; requestModel.clinicID = 0;
await model.getInPatientList(requestModel); await model.getInPatientList(requestModel);
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: InPatientHeader(),
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
TranslationBase
.of(context)
.inPatient,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
),
),
if (model.specialClinicalCareMappingList.isNotEmpty && if (model.specialClinicalCareMappingList.isNotEmpty &&
widget.specialClinic != null && widget.specialClinic != null &&
_activeTab != 2) _activeTab != 2)
@ -115,61 +88,40 @@ class _InPatientScreenState extends State<InPatientScreen>
dropdownColor: Colors.white, dropdownColor: Colors.white,
iconEnabledColor: Colors.black, iconEnabledColor: Colors.black,
isExpanded: true, isExpanded: true,
value: selectedMapId == null ? model value: selectedMapId == null
.specialClinicalCareMappingList[0] ? model.specialClinicalCareMappingList[0].nursingStationID
.nursingStationID : selectedMapId, : selectedMapId,
iconSize: 25, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext context) { return model.specialClinicalCareMappingList.map((item) {
return model
.specialClinicalCareMappingList
.map((item) {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Column( Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment
.center,
children: [ children: [
Container( Container(
padding: padding: EdgeInsets.all(2),
EdgeInsets.all(2), margin: EdgeInsets.all(2),
margin: decoration: new BoxDecoration(
EdgeInsets.all(2), color: Colors.red[800],
decoration: borderRadius: BorderRadius.circular(20),
new BoxDecoration(
color:
Colors.red[800],
borderRadius:
BorderRadius
.circular(
20),
), ),
constraints: constraints: BoxConstraints(
BoxConstraints(
minWidth: 20, minWidth: 20,
minHeight: 20, minHeight: 20,
), ),
child: Center( child: Center(
child: AppText( child: AppText(
model model
.specialClinicalCareMappingList .specialClinicalCareMappingList.length
.length
.toString(), .toString(),
color: color: Colors.white,
Colors.white,
fontSize: fontSize:
projectsProvider projectsProvider.isArabic ? 10 : 11,
.isArabic textAlign: TextAlign.center,
? 10
: 11,
textAlign:
TextAlign
.center,
), ),
)), )),
], ],
@ -177,8 +129,7 @@ class _InPatientScreenState extends State<InPatientScreen>
AppText(item.description, AppText(item.description,
fontSize: 12, fontSize: 12,
color: Colors.black, color: Colors.black,
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
textAlign: TextAlign.end), textAlign: TextAlign.end),
], ],
); );
@ -189,23 +140,19 @@ class _InPatientScreenState extends State<InPatientScreen>
selectedMapId = newValue; selectedMapId = newValue;
}); });
model.clearPatientList(); model.clearPatientList();
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
PatientSearchRequestModel requestModel = PatientSearchRequestModel( PatientSearchRequestModel requestModel =
PatientSearchRequestModel(
nursingStationID: selectedMapId, clinicID: 0); nursingStationID: selectedMapId, clinicID: 0);
await model.getInPatientList(requestModel, isLocalBusy: true); await model.getInPatientList(requestModel,
GifLoaderDialogUtils.hideDialog( isLocalBusy: true);
context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} }
}, },
items: model items: model.specialClinicalCareMappingList.map((item) {
.specialClinicalCareMappingList
.map((item) {
return DropdownMenuItem( return DropdownMenuItem(
child: AppText( child: AppText(
item.description, item.description,
@ -215,9 +162,6 @@ class _InPatientScreenState extends State<InPatientScreen>
); );
}).toList(), }).toList(),
)), )),
)
]),
),
), ),
Expanded( Expanded(
child: Scaffold( child: Scaffold(
@ -249,8 +193,8 @@ class _InPatientScreenState extends State<InPatientScreen>
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( tabWidget(screenSize, _activeTab == 1,
screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, 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),
@ -267,7 +211,7 @@ class _InPatientScreenState extends State<InPatientScreen>
controller: _tabController, controller: _tabController,
children: [ children: [
InPatientListPage(false, model), InPatientListPage(false, model),
InPatientListPage(true,model), InPatientListPage(true, model),
DischargedPatient(), DischargedPatient(),
], ],
), ),

@ -38,6 +38,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
} }
@override @override
Size get preferredSize => Size(double.maxFinite,65); Size get preferredSize => Size(double.maxFinite,65);
} }

@ -91,6 +91,7 @@ class TranslationBase {
String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode];
String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; String get myInPatient => localizedValues['myInPatient'][locale.languageCode];
String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode];
String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode];
String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode];

@ -352,9 +352,8 @@ class PatientCard extends StatelessWidget {
), ),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
// TODO Elham* add translation
label: label:
"Clinic Name" + TranslationBase.of(context).clinicName +
" : ", " : ",
value: "${patientInfo.clinicDescription}", value: "${patientInfo.clinicDescription}",
), ),

Loading…
Cancel
Save