Fix patient card and add the discharged in Patient referral page

merge-requests/628/head
Mohammad Aljammal 4 years ago
parent 2978aeecb2
commit 989774a0b3

@ -147,7 +147,7 @@ class BaseAppClient {
: SETUP_ID;
}
body['VersionID'] = 5.8;
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;

@ -336,7 +336,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 5.8;
const VERSION_ID = 5.9;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -26,10 +26,10 @@ 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: true,
isShowAppBar: false,
baseViewModel: model,
body: model.myDischargedPatient.isEmpty?Center(
child: Column(
@ -53,17 +53,12 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 12,),
SizedBox(height: 65,),
Container(
width: double.maxFinite,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Color(0xffCCCCCC),
),
borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: Color(0xffCCCCCC),),
color: Colors.white),
child: Column(
crossAxisAlignment:
@ -88,19 +83,17 @@ class _DischargedPatientState extends State<DischargedPatient> {
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
padding: EdgeInsets.only(bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
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(
@ -324,8 +317,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
),
),
)),
),
],
),
))
],
),
),

@ -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 '../../DischargedPatientPage.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(),
DischargedPatient()
// 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