Merge branch 'soap_refactor' into 'development'

Soap refactor

See merge request Cloud_Solution/doctor_app_flutter!528
merge-requests/529/merge
Mohammad Aljammal 5 years ago
commit 0260b92f24

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.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/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -91,62 +92,16 @@ class LabsHomePage extends StatelessWidget {
), ),
), ),
if (patientType != null && patientType == '7' && patient.patientStatusType == 43) if (patientType != null && patientType == '7' && patient.patientStatusType == 43)
InkWell( AddNewOrder( onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder: (context) => AddSelectedLabOrder(
builder: (context) => AddSelectedLabOrder( patient: patient,
patient: patient, model: model,
model: model, )),
)), );
); },label: 'Apply for New Lab Order',),
},
// () {
// addSelectedLabOrder(context, model, patient);
// },
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
SizedBox(
height: 10,
),
AppText(
'Apply for New Lab Order',
color: Colors.grey[600],
fontWeight: FontWeight.w600,
)
],
),
),
),
),
),
...List.generate( ...List.generate(
model.patientLabOrdersList.length, model.patientLabOrdersList.length,
(index) => Column( (index) => Column(

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_
import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -88,61 +89,16 @@ class RadiologyHomePage extends StatelessWidget {
if (patientType != null && if (patientType != null &&
patientType == '7' && patientType == '7' &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
InkWell( AddNewOrder( onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder: (context) => AddSelectedRadiologyOrder(
builder: (context) => AddSelectedRadiologyOrder( patient: patient,
patient: patient, model: model,
model: model, )),
)), );
); },label: 'Apply for Radiology Order',),
},
// () {
// addSelectedRadiologyOrder(context, model, patient);
// },
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
SizedBox(
height: 10,
),
AppText(
'Apply for Radiology Order',
color: Colors.grey[600],
fontWeight: FontWeight.w600,
)
],
),
),
),
),
),
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
(index) => InkWell( (index) => InkWell(

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da
import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -86,52 +87,10 @@ class PrescriptionsPage extends StatelessWidget {
if (patientType != null && if (patientType != null &&
patientType == '7' && patientType == '7' &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
InkWell( AddNewOrder( onTap: () {
onTap: () { addPrescriptionForm(
addPrescriptionForm( context, model, patient, model.prescriptionList);
context, model, patient, model.prescriptionList); },label: 'Apply for New Prescriptions Order',),
},
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
SizedBox(
height: 10,
),
AppText(
'Apply for New Prescriptions Order',
color: Colors.grey[600],
fontWeight: FontWeight.w600,
)
],
),
),
),
),
),
...List.generate( ...List.generate(
model.prescriptionsList.length, model.prescriptionsList.length,
(index) => InkWell( (index) => InkWell(
@ -182,3 +141,4 @@ class PrescriptionsPage extends StatelessWidget {
)); ));
} }
} }

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_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/reschedule-leaves/reschedule_leave.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.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/add-order/addNewOrder.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/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
@ -28,47 +29,12 @@ class AddRescheduleLeavScreen extends StatelessWidget {
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
Container( AddNewOrder( onTap: () {
width: MediaQuery.of(context).size.width, openLeave(
margin: EdgeInsets.all(10), context,
padding: false,
EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), );
decoration: BoxDecoration( },label: TranslationBase.of(context).applyForReschedule,),
color: HexColor('#EAEAEA'),
borderRadius: BorderRadius.all(Radius.circular(20))),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
onPressed: () {
openLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).applyForReschedule,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 18,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
),
),
Column( Column(
children: model.getReschduleLeave children: model.getReschduleLeave
.map<Widget>((GetRescheduleLeavesResponse item) { .map<Widget>((GetRescheduleLeavesResponse item) {

@ -0,0 +1,59 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class AddNewOrder extends StatelessWidget {
const AddNewOrder({
Key key,
this.onTap, this.label,
}) : super(key: key);
final Function onTap;
final String label;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
width: double.maxFinite,
height: 140,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Container(
height: 90,
child: Column(
children: [
Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
SizedBox(
height: 10,
),
AppText(
label ??'',
color: Colors.grey[600],
fontWeight: FontWeight.w600,
)
],
),
),
),
),
);
}
}

@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import '../app_texts_widget.dart';
class ErrorMessage extends StatelessWidget {
const ErrorMessage({
Key key,
@required this.error,
}) : super(key: key);
final String error;
@override
Widget build(BuildContext context) {
return Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Center(
child: Center(
child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30),
child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)),
),
),
)
],
),
);
}
}

@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'app_loader_widget.dart'; import 'app_loader_widget.dart';
import 'errors/dr_app_embedded_error.dart'; import 'errors/dr_app_embedded_error.dart';
import 'errors/error_message.dart';
class NetworkBaseView extends StatelessWidget { class NetworkBaseView extends StatelessWidget {
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
@ -32,24 +33,7 @@ class NetworkBaseView extends StatelessWidget {
return AppLoaderWidget(); return AppLoaderWidget();
break; break;
case ViewState.Error: case ViewState.Error:
return Center( return ErrorMessage(error: baseViewModel.error ,);
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Center(
child: Center(
child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30),
child: Center(child: AppText(baseViewModel.error??'' , textAlign: TextAlign.center,)),
),
),
)
],
),
);
break; break;
} }
} }

Loading…
Cancel
Save