Merge branch 'development' into design-changes

merge-requests/629/head
mosazaid 5 years ago
commit 3295143840

@ -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( HomePageCard(
color: Color(0xffD02127), color: Color(0xffD02127),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),

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

@ -25,7 +25,7 @@ class _ReferralDischargedPatientPageState extends State<ReferralDischargedPatien
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: 'Referral Discharged ', appBarTitle: 'Referral Discharged ',
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: true, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargeReferralPatient.isEmpty?Center( body: model.myDischargeReferralPatient.isEmpty?Center(
child: Column( 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../ReferralDischargedPatientPage.dart';
import 'my-referral-inpatient-screen.dart'; import 'my-referral-inpatient-screen.dart';
class PatientReferralScreen extends StatefulWidget { class PatientReferralScreen extends StatefulWidget {
@ -24,7 +25,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection); _tabController.addListener(_handleTabSelection);
} }
@ -74,7 +75,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( 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, height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC), Color(0Xffffffff), Color(0xFFCCCCCC),
@ -101,7 +102,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
), ),
), ),
Container( 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, height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC), 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>[ children: <Widget>[
ReferredPatientScreen(), ReferredPatientScreen(),
MyReferralInPatientScreen(), MyReferralInPatientScreen(),
ReferralDischargedPatientPage()
// MyReferredPatient(), // 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/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/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_bg_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -32,36 +33,22 @@ class PatientCard extends StatelessWidget {
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6), 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( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(10),
color: Colors.white, color: Colors.white,
), ),
child: Stack(children: [ child: CardWithBgWidget(
if (!isInpatient&& !isMyPatient && !isFromSearch) padding: 0,
Container( marginLeft: (!isMyPatient && isInpatient)?0:10,
height: 160, marginSymmetric:isFromSearch ? 10 : 0.0,
width: 5, hasBorder: false,
decoration: BoxDecoration( bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: patientInfo.patientStatusType == 43
? Colors.green[500] ? Colors.green[500]
: Colors.red[800], :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white,
)), widget: Container(
if(isMyPatient && !isFromSearch) color: Colors.white,
Container( // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
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: InkWell( child: InkWell(
child: Column( child: Column(
children: [ children: [
@ -82,7 +69,7 @@ class PatientCard extends StatelessWidget {
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
SizedBox(width: 8,), SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), 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 , color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
], ],
) )
@ -103,7 +90,7 @@ class PatientCard extends StatelessWidget {
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
SizedBox(width: 8,), SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), 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 , color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
], ],
): !isFromSearch && patientInfo.patientStatusType==null ? Row( ): !isFromSearch && patientInfo.patientStatusType==null ? Row(
@ -151,14 +138,15 @@ class PatientCard extends StatelessWidget {
)+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15,
) )
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
AppText( 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', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15,
):SizedBox() ):SizedBox()
], ],
)) ))
@ -181,29 +169,31 @@ class PatientCard extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row(children: [ Expanded(
Container( child: Row(children: [
width: 170, Expanded(
// width: MediaQuery.of(context).size.width*0.51,
child: AppText( child: AppText(
(Helpers.capitalize(patientInfo.firstName) + (Helpers.capitalize(patientInfo.firstName) +
" " + " " +
Helpers.capitalize(patientInfo.lastName)), Helpers.capitalize(patientInfo.lastName)),
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, color: Color(0xff2e303a),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
), ),
patientInfo.gender == 1 if (patientInfo.gender == 1)
? Icon( Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
) ) else Icon(
: Icon(
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
]), ]),
),
Row( Row(
children: [ children: [
AppText( AppText(
@ -280,14 +270,14 @@ class PatientCard extends StatelessWidget {
text: TranslationBase.of(context) text: TranslationBase.of(context)
.fileNumber, .fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 12,
fontFamily: 'Poppins')), fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
text: patientInfo.patientId.toString(), text: patientInfo.patientId.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 15)), fontSize: 13)),
], ],
), ),
), ),
@ -306,13 +296,13 @@ class PatientCard extends StatelessWidget {
text: text:
TranslationBase.of(context).age + TranslationBase.of(context).age +
" : ", " : ",
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 12)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 13)),
], ],
), ),
), ),
@ -334,28 +324,35 @@ class PatientCard extends StatelessWidget {
: TranslationBase.of(context) : TranslationBase.of(context)
.admissionDate + .admissionDate +
" : ", " : ",
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 12)),
new TextSpan( new TextSpan(
text: patientInfo.admissionDate == null text: patientInfo.admissionDate == null
? "" ? ""
: "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 13)),
]))), ]))),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
Row( Container(
children: [ child: RichText(
AppText( text: new TextSpan(
"${TranslationBase.of(context).numOfDays}: ", style: new TextStyle(
fontSize: 15, fontSize:
), 2.0 * SizeConfig.textMultiplier,
AppText( color: Colors.black,
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", fontFamily: 'Poppins',
fontSize: 15,
fontWeight: FontWeight.w700),
],
), ),
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, onTap: onTap,
)), )),
])); ));
} }

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

@ -3,27 +3,23 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.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 { class CardWithBgWidget extends StatelessWidget {
final Widget widget; final Widget widget;
final Color bgColor; final Color bgColor;
final bool hasBorder; final bool hasBorder;
final double padding;
final double marginLeft;
final double marginSymmetric;
CardWithBgWidget( 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10.0), margin: EdgeInsets.symmetric(vertical: marginSymmetric),
// width: double.infinity, // width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -61,15 +57,15 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),), bottomLeft: Radius.circular(10),),),
width: 10, width: 7,
), ),
bottom: 1, bottom: 1,
top: 1, top: 1,
left: 1, left: 1,
), ),
Container( Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(padding),
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: marginLeft),
child: widget) child: widget)
], ],
), ),

Loading…
Cancel
Save