Merge branch 'referral_in_patient' into 'development'

Referral in patient

See merge request Cloud_Solution/doctor_app_flutter!628
merge-requests/629/merge
Mohammad Aljammal 5 years ago
commit 155662b184

@ -655,84 +655,6 @@ class _HomeScreenState extends State<HomeScreen> {
);
},
),
// HomePageCard(
// color: Colors.red[800],
// margin: EdgeInsets.all(5),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.center,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Padding(
// padding: EdgeInsets.only(
// top: 10, left: 10, right: 0),
// child: Icon(
// DoctorApp.discharge_patients,
// size: 35,
// color: Colors.white,
// )),
// Container(
// padding: EdgeInsets.all(10),
// child: AppText(
// 'Discharged Patients',
// color: Colors.white,
// textAlign: TextAlign.start,
// fontSize: 15,
// ))
// ],
// ),
// hasBorder: false,
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// DischargedPatient(),
// // MyReferredPatient(),
// ),
// );
// },
// ),
// HomePageCard(
// color: Colors.grey[300],
// margin: EdgeInsets.all(5),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.center,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Padding(
// padding: EdgeInsets.only(
// top: 10, left: 10, right: 0),
// child: Icon(
// DoctorApp.referral_discharge,
// size: 35,
// color: Colors.black,
// )),
// Container(
// padding: EdgeInsets.all(10),
// child: AppText(
// 'Referral Discharged',
// color: Colors.black,
// textAlign: TextAlign.start,
// fontSize: 15,
// ))
// ],
// ),
// hasBorder: false,
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// ReferralDischargedPatientPage(),
// // MyReferredPatient(),
// ),
// );
// },
// ),
HomePageCard(
color: Color(0xffD02127),
margin: EdgeInsets.all(5),

@ -26,8 +26,8 @@ class _DischargedPatientState extends State<DischargedPatient> {
return BaseView<DischargedPatientViewModel>(
onModelReady: (model) => model.getDischargedPatient(),
builder: (_, model, w) => AppScaffold(
appBarTitle: 'Discharged Patient',
subtitle: "Last Three Months",
//appBarTitle: 'Discharged Patient',
//subtitle: "Last Three Months",
backgroundColor: Colors.grey[200],
isShowAppBar: false,
baseViewModel: model,
@ -103,10 +103,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
}),
])),
SizedBox(height: 5,),
Expanded(
child: ListView.builder(
itemCount: model.filterData.length,
itemBuilder: (context,index)=>InkWell(
Expanded(child: SingleChildScrollView(
child: Column(
children: [
...List.generate(model.filterData.length, (index) => InkWell(
onTap: () {
Navigator.of(context)
.pushNamed(
@ -330,8 +330,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
),
),
)),
),
],
),
))
],
),
),

@ -25,7 +25,7 @@ class _ReferralDischargedPatientPageState extends State<ReferralDischargedPatien
builder: (_, model, w) => AppScaffold(
appBarTitle: 'Referral Discharged ',
backgroundColor: Colors.grey[200],
isShowAppBar: true,
isShowAppBar: false,
baseViewModel: model,
body: model.myDischargeReferralPatient.isEmpty?Center(
child: Column(

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../ReferralDischargedPatientPage.dart';
import 'my-referral-inpatient-screen.dart';
class PatientReferralScreen extends StatefulWidget {
@ -24,7 +25,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@ -74,7 +75,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.50,
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
@ -101,7 +102,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
),
),
Container(
width: MediaQuery.of(context).size.width * 0.50,
width: MediaQuery.of(context).size.width * 0.34,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
@ -127,6 +128,33 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 2
? Color(0xFFD02127 )
: Color(0xFFEAEAEA),
index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
'Discharged',
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 2 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
],
),
@ -143,6 +171,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
children: <Widget>[
ReferredPatientScreen(),
MyReferralInPatientScreen(),
ReferralDischargedPatientPage()
// MyReferredPatient(),
],
),

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/util/date-utils.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/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@ -32,36 +33,22 @@ class PatientCard extends StatelessWidget {
return Container(
width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
child: Stack(children: [
if (!isInpatient&& !isMyPatient && !isFromSearch)
Container(
height: 160,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: patientInfo.patientStatusType == 43
? Colors.green[500]
: Colors.red[800],
)),
if(isMyPatient && !isFromSearch)
Container(
height: 180,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: Colors.green[500]
)),
Container(
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: CardWithBgWidget(
padding: 0,
marginLeft: (!isMyPatient && isInpatient)?0:10,
marginSymmetric:isFromSearch ? 10 : 0.0,
hasBorder: false,
bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43
? Colors.green[500]
:isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white,
widget: Container(
color: Colors.white,
// padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell(
child: Column(
children: [
@ -82,7 +69,7 @@ class PatientCard extends StatelessWidget {
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
fontSize: 10,
),
SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
@ -92,7 +79,7 @@ class PatientCard extends StatelessWidget {
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
fontSize: 10,
),
],
)
@ -103,7 +90,7 @@ class PatientCard extends StatelessWidget {
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
fontSize: 10,
),
SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
@ -113,7 +100,7 @@ class PatientCard extends StatelessWidget {
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
fontSize: 10,
),
],
): !isFromSearch && patientInfo.patientStatusType==null ? Row(
@ -151,14 +138,15 @@ class PatientCard extends StatelessWidget {
)+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
)
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
AppText(
//
// )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)),
" ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
"${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
):SizedBox()
],
))
@ -181,29 +169,31 @@ class PatientCard extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(children: [
Container(
width: 170,
child: AppText(
(Helpers.capitalize(patientInfo.firstName) +
" " +
Helpers.capitalize(patientInfo.lastName)),
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
Expanded(
child: Row(children: [
Expanded(
// width: MediaQuery.of(context).size.width*0.51,
child: AppText(
(Helpers.capitalize(patientInfo.firstName) +
" " +
Helpers.capitalize(patientInfo.lastName)),
fontSize: 16,
color: Color(0xff2e303a),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
),
),
),
patientInfo.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
if (patientInfo.gender == 1)
Icon(
DoctorApp.male_2,
color: Colors.blue,
) else Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
),
Row(
children: [
AppText(
@ -280,14 +270,14 @@ class PatientCard extends StatelessWidget {
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize: 14,
fontSize: 12,
fontFamily: 'Poppins')),
new TextSpan(
text: patientInfo.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
fontSize: 13)),
],
),
),
@ -306,13 +296,13 @@ class PatientCard extends StatelessWidget {
text:
TranslationBase.of(context).age +
" : ",
style: TextStyle(fontSize: 14)),
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
fontSize: 13)),
],
),
),
@ -334,28 +324,35 @@ class PatientCard extends StatelessWidget {
: TranslationBase.of(context)
.admissionDate +
" : ",
style: TextStyle(fontSize: 14)),
style: TextStyle(fontSize: 12)),
new TextSpan(
text: patientInfo.admissionDate == null
? ""
: "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
fontSize: 13)),
]))),
if (patientInfo.admissionDate != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 15,
),
AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).numOfDays + " : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text: "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
]))
]),
@ -395,7 +392,7 @@ class PatientCard extends StatelessWidget {
),
onTap: onTap,
)),
]));
));
}

@ -49,7 +49,7 @@ class _AppButtonState extends State<AppButton> {
@override
Widget build(BuildContext context) {
return Container(
// height: 60,//MediaQuery.of(context).size.height * 0.075,
// height: MediaQuery.of(context).size.height * 0.075,
child: IgnorePointer(
ignoring: widget.loading ||widget.disabled,
child: RawMaterialButton(

@ -3,27 +3,23 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
/*
*@author: Mohammad Aljammal
*@Date:27/4/2020
*@param: Widget
*@return:
*@desc: Card With Bg Widget
*/
class CardWithBgWidget extends StatelessWidget {
final Widget widget;
final Color bgColor;
final bool hasBorder;
final double padding;
final double marginLeft;
final double marginSymmetric;
CardWithBgWidget(
{@required this.widget, this.bgColor, this.hasBorder = true});
{@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0});
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return Container(
margin: EdgeInsets.symmetric(vertical: 10.0),
margin: EdgeInsets.symmetric(vertical: marginSymmetric),
// width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
@ -61,15 +57,15 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),),
width: 10,
width: 7,
),
bottom: 1,
top: 1,
left: 1,
),
Container(
padding: EdgeInsets.all(15.0),
margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(padding),
margin: EdgeInsets.only(left: marginLeft),
child: widget)
],
),

Loading…
Cancel
Save