Merge branch 'design-changes' into 'development'

profile Design changes

See merge request Cloud_Solution/doctor_app_flutter!631
merge-requests/632/head
Mohammad Aljammal 5 years ago
commit 53a85ce75e

@ -152,12 +152,19 @@ class PatientSearchViewModel extends BaseViewModel {
error = _inPatientService.error; error = _inPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
// setDefaultInPatientList();
setState(ViewState.Idle);
}
}
Future setDefaultInPatientList() async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
filteredInPatientItems.clear(); filteredInPatientItems.clear();
if (inPatientList.length > 0) if (inPatientList.length > 0)
filteredInPatientItems.addAll(inPatientList); filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
void clearPatientList(){ void clearPatientList(){
_inPatientService.inPatientList = []; _inPatientService.inPatientList = [];

@ -1,17 +1,16 @@
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../routes.dart'; import '../../routes.dart';
class InPatientPage extends StatefulWidget { class InPatientPage extends StatefulWidget {
final bool isMyInPatient; final bool isMyInPatient;
InPatientPage(this.isMyInPatient); InPatientPage(this.isMyInPatient);
@ -22,7 +21,6 @@ class InPatientPage extends StatefulWidget {
class _InPatientPageState extends State<InPatientPage> { class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController(); TextEditingController _searchController = TextEditingController();
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
@override @override
void dispose() { void dispose() {
@ -33,7 +31,9 @@ class _InPatientPageState extends State<InPatientPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel), onModelReady: (model) async {
await model.setDefaultInPatientList();
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,

@ -1,20 +1,13 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/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/patients/PatientCard.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/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.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/material.dart'; import 'package:flutter/material.dart';
import '../../routes.dart';
import 'DischargedPatientPage.dart'; import 'DischargedPatientPage.dart';
import 'InPatientPage.dart'; import 'InPatientPage.dart';
@ -50,9 +43,13 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.clearPatientList(), onModelReady: (model) async {
model.clearPatientList();
model.getInPatientList(requestModel);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,

@ -0,0 +1,25 @@
class PatientProfileCardModel {
final String nameLine1;
final String nameLine2;
final dynamic route;
final String icon;
final bool isInPatient;
final bool isDisable;
final bool isLoading;
final Function onTap;
final bool isDischargedPatient;
final bool isSelectInpatient;
PatientProfileCardModel(
this.nameLine1,
this.nameLine2,
this.route,
this.icon, {
this.isInPatient = false,
this.isDisable = false,
this.isLoading = false,
this.onTap,
this.isDischargedPatient = false,
this.isSelectInpatient = false,
});
}

@ -1,7 +1,9 @@
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/patients/profile/profile_screen/PatientProfileCardModel.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/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -23,246 +25,129 @@ class ProfileGridForInPatient extends StatelessWidget {
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.height, this.height,
this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) this.isInpatient,
this.from,
this.to,
this.isDischargedPatient,
this.isFromSearch})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( final List<PatientProfileCardModel> cardsList = [
padding: PatientProfileCardModel(
const EdgeInsets.symmetric( TranslationBase.of(context).vital,
vertical: 15.0, TranslationBase.of(context).signs,
horizontal: 15), VITAL_SIGN_DETAILS,
child: GridView.count( 'patient/vital_signs.png',
shrinkWrap: true, isInPatient: isInpatient),
physics: PatientProfileCardModel(
NeverScrollableScrollPhysics(), TranslationBase.of(context).lab,
crossAxisSpacing: 10, TranslationBase.of(context).result,
mainAxisSpacing: 10, LAB_RESULT,
childAspectRatio: 1 / 1.02, 'patient/lab_results.png',
crossAxisCount: 3, isInPatient: isInpatient),
children: [ PatientProfileCardModel(
PatientProfileButton( TranslationBase.of(context).radiology,
patient: patient, TranslationBase.of(context).result,
patientType: patientType, RADIOLOGY_PATIENT,
arrivalType: arrivalType, 'patient/health_summary.png',
from: from, isInPatient: isInpatient),
to: to, PatientProfileCardModel(
nameLine1: TranslationBase.of(context).patient,
TranslationBase TranslationBase.of(context).prescription,
.of(
context)
.vital,
nameLine2:
TranslationBase
.of(
context)
.signs,
route: VITAL_SIGN_DETAILS,
isInPatient: true,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
isInPatient: true,
nameLine1:
TranslationBase
.of(
context)
.lab,
nameLine2:
TranslationBase
.of(
context)
.result,
icon:
'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1:
TranslationBase
.of(
context)
.radiology,
nameLine2:
TranslationBase
.of(
context)
.result,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
isInPatient: isInpatient,
patientType: patientType,
arrivalType: arrivalType,
route:
ORDER_PRESCRIPTION_NEW, ORDER_PRESCRIPTION_NEW,
isSelectInpatient: true, 'patient/order_prescription.png',
nameLine1: isInPatient: isInpatient),
TranslationBase PatientProfileCardModel(
.of( TranslationBase.of(context).progress,
context) TranslationBase.of(context).note,
.patient, PROGRESS_NOTE,
nameLine2: 'patient/Progress_notes.png',
TranslationBase
.of(
context)
.prescription,
icon:
'patient/order_prescription.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
isInPatient: isInpatient, isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient: isDischargedPatient),
isDischargedPatient, PatientProfileCardModel(
nameLine1: TranslationBase.of(context).order,
TranslationBase
.of(
context)
.progress,
nameLine2:
TranslationBase
.of(
context)
.note,
icon:
'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
isInPatient: isInpatient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
isDischargedPatient:
isDischargedPatient,
nameLine1:TranslationBase.of(context).order,
nameLine2:
TranslationBase.of(context).sheet, TranslationBase.of(context).sheet,
icon: ORDER_NOTE,
'patient/Progress_notes.png'), 'patient/Progress_notes.png',
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
isInPatient: isInpatient, isInPatient: isInpatient,
nameLine1: isDischargedPatient: isDischargedPatient),
TranslationBase PatientProfileCardModel(
.of( TranslationBase.of(context).orders,
context) TranslationBase.of(context).procedures,
.orders, ORDER_PROCEDURE,
nameLine2: 'patient/Order_Procedures.png',
TranslationBase isInPatient: isInpatient),
.of( PatientProfileCardModel(
context) TranslationBase.of(context).health,
.procedures, TranslationBase.of(context).summary,
icon: HEALTH_SUMMARY,
'patient/Order_Procedures.png'), 'patient/health_summary.png',
PatientProfileButton( isInPatient: isInpatient),
patient: patient, PatientProfileCardModel(
patientType: patientType,
arrivalType: arrivalType,
route: HEALTH_SUMMARY,
nameLine1: TranslationBase.of(context).health,
nameLine2: TranslationBase.of(context).summary,
isInPatient: isInpatient,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: HEALTH_SUMMARY,
nameLine1:
TranslationBase.of(context).medical, TranslationBase.of(context).medical,
nameLine2:
TranslationBase.of(context).report, TranslationBase.of(context).report,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient, isInPatient: isInpatient,
icon: isDisable: true),
'patient/health_summary.png'), PatientProfileCardModel(
PatientProfileButton( TranslationBase.of(context).referral,
patient: patient, TranslationBase.of(context).patient,
patientType: patientType,
arrivalType: arrivalType,
route:
REFER_IN_PATIENT_TO_DOCTOR, REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true, 'patient/refer_patient.png',
isDisable: isInPatient: isInpatient,
isDischargedPatient || isDisable: isDischargedPatient || isFromSearch,
isFromSearch, ),
nameLine1: PatientProfileCardModel(
TranslationBase TranslationBase.of(context).insurance,
.of( TranslationBase.of(context).approvals,
context)
.referral,
nameLine2:
TranslationBase
.of(
context)
.patient,
icon:
'patient/refer_patient.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
PATIENT_INSURANCE_APPROVALS_NEW, PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: 'patient/vital_signs.png',
TranslationBase isInPatient: isInpatient),
.of( PatientProfileCardModel(
context) TranslationBase.of(context).discharge,
.insurance, TranslationBase.of(context).report,
nameLine2: null,
TranslationBase 'patient/patient_sick_leave.png',
.of(
context)
.approvals,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient: isInpatient, isInPatient: isInpatient,
patient: patient, isDisable: true),
patientType: patientType, PatientProfileCardModel(
arrivalType: arrivalType, TranslationBase.of(context).patientSick,
isDisable: true, TranslationBase.of(context).leave,
route: null, ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).discharge, 'patient/patient_sick_leave.png',
nameLine2: TranslationBase.of(context).report,
icon:
'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient: isInpatient, isInPatient: isInpatient,
),
];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: StaggeredGridView.countBuilder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 3,
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ADD_SICKLEAVE, from: from,
nameLine1: to: to,
TranslationBase nameLine1: cardsList[index].nameLine1,
.of( nameLine2: cardsList[index].nameLine2,
context) route: cardsList[index].route,
.patientSick, icon: cardsList[index].icon,
nameLine2: isInPatient: cardsList[index].isInPatient,
TranslationBase isDischargedPatient: cardsList[index].isDischargedPatient,
.of( isDisable: cardsList[index].isDisable,
context) onTap: cardsList[index].onTap,
.leave, isLoading: cardsList[index].isLoading,
icon: ),
'patient/patient_sick_leave.png'),
],
), ),
); );
} }

@ -24,8 +24,9 @@ class PatientProfileButton extends StatelessWidget {
final Function onTap; final Function onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient; final bool isSelectInpatient;
PatientProfileButton(
{Key key, PatientProfileButton({
Key key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
@ -38,17 +39,18 @@ class PatientProfileButton extends StatelessWidget {
this.isLoading = false, this.isLoading = false,
this.from, this.from,
this.to, this.to,
this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, this.isInPatient = false,
}) this.isDischargedPatient = false,
: super(key: key); this.isSelectInpatient = false,
}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return new Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 0.0), margin: EdgeInsets.symmetric(horizontal: 0.0),
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: InkWell( child: InkWell(
onTap: isDisable onTap: isDisable
? null ? null
@ -59,25 +61,30 @@ class PatientProfileButton extends StatelessWidget {
}, },
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
padding: EdgeInsets.fromLTRB(8, 0, 8, 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
child: new Image.asset( child: new Image.asset(
url + icon, url + icon,
width: 50, width: 30,
height: 50, height: 30,
),) fit: BoxFit.contain,
),
)
], ],
)), )),
Container( Container(
alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
!projectsProvider.isArabic?this.nameLine1: nameLine2, !projectsProvider.isArabic ? this.nameLine1 : nameLine2,
color: Colors.black, color: Colors.black,
/*Color(0xFFB9382C),*/ /*Color(0xFFB9382C),*/
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -85,7 +92,7 @@ class PatientProfileButton extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 1.5, fontSize: SizeConfig.textMultiplier * 1.5,
), ),
AppText( AppText(
!projectsProvider.isArabic? this.nameLine2:nameLine1, !projectsProvider.isArabic ? this.nameLine2 : nameLine1,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
textAlign: TextAlign.left, textAlign: TextAlign.left,
@ -118,8 +125,7 @@ class PatientProfileButton extends StatelessWidget {
} }
void navigator(BuildContext context, route) { void navigator(BuildContext context, route) {
if(route == null) if (route == null) return;
return;
if (from == null) { if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
@ -127,7 +133,7 @@ class PatientProfileButton extends StatelessWidget {
if (to == null) { if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
if(arrivalType == null){ if (arrivalType == null) {
arrivalType = "0"; arrivalType = "0";
} }
Navigator.of(context).pushNamed(route, arguments: { Navigator.of(context).pushNamed(route, arguments: {

@ -445,6 +445,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.11" version: "1.0.11"
flutter_staggered_grid_view:
dependency: "direct main"
description:
name: flutter_staggered_grid_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
flutter_svg: flutter_svg:
dependency: transitive dependency: transitive
description: description:

@ -41,6 +41,7 @@ dependencies:
eva_icons_flutter: ^2.0.0 eva_icons_flutter: ^2.0.0
font_awesome_flutter: ^8.11.0 font_awesome_flutter: ^8.11.0
dropdown_search: ^0.4.8 dropdown_search: ^0.4.8
flutter_staggered_grid_view: ^0.3.2
expandable: ^4.1.4 expandable: ^4.1.4

Loading…
Cancel
Save