design fixes

merge-requests/631/head
mosazaid 4 years ago
parent 3295143840
commit 6fba03ed69

@ -151,12 +151,19 @@ class PatientSearchViewModel extends BaseViewModel {
error = _inPatientService.error;
setState(ViewState.Error);
} else {
// setDefaultInPatientList();
setState(ViewState.Idle);
}
}
Future setDefaultInPatientList() async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
filteredInPatientItems.clear();
if (inPatientList.length > 0)
filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle);
}
}
void clearPatientList(){
_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/screens/base/base_view.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/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:flutter/material.dart';
import '../../routes.dart';
class InPatientPage extends StatefulWidget {
final bool isMyInPatient;
InPatientPage(this.isMyInPatient);
@ -22,7 +21,6 @@ class InPatientPage extends StatefulWidget {
class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController();
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
@override
void dispose() {
@ -33,7 +31,9 @@ class _InPatientPageState extends State<InPatientPage> {
@override
Widget build(BuildContext context) {
return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel),
onModelReady: (model) async {
await model.setDefaultInPatientList();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,

@ -1,20 +1,13 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.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/util/helpers.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_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:flutter/material.dart';
import '../../routes.dart';
import 'DischargedPatientPage.dart';
import 'InPatientPage.dart';
@ -50,9 +43,13 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.clearPatientList(),
onModelReady: (model) async {
model.clearPatientList();
model.getInPatientList(requestModel);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
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/screens/patients/profile/profile_screen/PatientProfileCardModel.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import '../../../../routes.dart';
@ -23,246 +25,129 @@ class ProfileGridForInPatient extends StatelessWidget {
this.patientType,
this.arrivalType,
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);
@override
Widget build(BuildContext context) {
return Padding(
padding:
const EdgeInsets.symmetric(
vertical: 15.0,
horizontal: 15),
child: GridView.count(
shrinkWrap: true,
physics:
NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.02,
crossAxisCount: 3,
children: [
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1:
TranslationBase
.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:
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).result,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
isSelectInpatient: true,
nameLine1:
TranslationBase
.of(
context)
.patient,
nameLine2:
TranslationBase
.of(
context)
.prescription,
icon:
'patient/order_prescription.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).progress,
TranslationBase.of(context).note,
PROGRESS_NOTE,
'patient/Progress_notes.png',
isInPatient: isInpatient,
isDischargedPatient:
isDischargedPatient,
nameLine1:
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:
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).order,
TranslationBase.of(context).sheet,
icon:
'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
ORDER_NOTE,
'patient/Progress_notes.png',
isInPatient: isInpatient,
nameLine1:
TranslationBase
.of(
context)
.orders,
nameLine2:
TranslationBase
.of(
context)
.procedures,
icon:
'patient/Order_Procedures.png'),
PatientProfileButton(
patient: patient,
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:
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).medical,
nameLine2:
TranslationBase.of(context).report,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
isDisable: true),
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true,
isDisable:
isDischargedPatient ||
isFromSearch,
nameLine1:
TranslationBase
.of(
context)
.referral,
nameLine2:
TranslationBase
.of(
context)
.patient,
icon:
'patient/refer_patient.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch,
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).approvals,
PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1:
TranslationBase
.of(
context)
.insurance,
nameLine2:
TranslationBase
.of(
context)
.approvals,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).discharge,
TranslationBase.of(context).report,
null,
'patient/patient_sick_leave.png',
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: TranslationBase.of(context).discharge,
nameLine2: TranslationBase.of(context).report,
icon:
'patient/patient_sick_leave.png'),
PatientProfileButton(
isDisable: true),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
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,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1:
TranslationBase
.of(
context)
.patientSick,
nameLine2:
TranslationBase
.of(
context)
.leave,
icon:
'patient/patient_sick_leave.png'),
],
from: from,
to: to,
nameLine1: cardsList[index].nameLine1,
nameLine2: cardsList[index].nameLine2,
route: cardsList[index].route,
icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading,
),
),
);
}

@ -24,8 +24,9 @@ class PatientProfileButton extends StatelessWidget {
final Function onTap;
final bool isDischargedPatient;
final bool isSelectInpatient;
PatientProfileButton(
{Key key,
PatientProfileButton({
Key key,
this.patient,
this.patientType,
this.arrivalType,
@ -38,17 +39,18 @@ class PatientProfileButton extends StatelessWidget {
this.isLoading = false,
this.from,
this.to,
this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false,
})
: super(key: key);
this.isInPatient = false,
this.isDischargedPatient = false,
this.isSelectInpatient = false,
}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return new Container(
return Container(
margin: EdgeInsets.symmetric(horizontal: 0.0),
padding: EdgeInsets.symmetric(horizontal: 4),
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: InkWell(
onTap: isDisable
? null
@ -59,19 +61,24 @@ class PatientProfileButton extends StatelessWidget {
},
child: Column(children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(8, 0, 8, 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
child: new Image.asset(
url + icon,
width: 50,
height: 50,
),)
width: 30,
height: 30,
fit: BoxFit.contain,
),
)
],
)),
Container(
alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft,
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -118,8 +125,7 @@ class PatientProfileButton extends StatelessWidget {
}
void navigator(BuildContext context, route) {
if(route == null)
return;
if (route == null) return;
if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');

@ -445,6 +445,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:

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

Loading…
Cancel
Save