changes updated

merge-requests/358/head
Sultan Khan 4 years ago
parent 94f0a7a448
commit 27bbb9ac59

@ -148,87 +148,90 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column(
children: <Widget>[
ProfileWelcomeWidget(
Container(
width: MediaQuery.of(context).size.width * .6,
// // height: 100,
// child: projectsProvider.doctorClinicsList.length > 0
// ? Stack(
// children: [
// DropdownButtonHideUnderline(
// child: DropdownButton(
// dropdownColor: Colors.white,
// iconEnabledColor: Colors.white,
// isExpanded: true,
// value: clinicId == null
// ? projectsProvider
// .doctorClinicsList[0].clinicID
// : clinicId,
// iconSize: 25,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext context) {
// return projectsProvider.doctorClinicsList
// .map((item) {
// return Row(
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// AppText(
// item.clinicName,
// fontSize:
// SizeConfig.textMultiplier *
// 2.1,
// color: Colors.white,
// ),
// ],
// );
// }).toList();
// },
// onChanged: (newValue) {
// clinicId = newValue;
// changeClinic(newValue, context, model);
// },
// items: projectsProvider.doctorClinicsList
// .map((item) {
// return DropdownMenuItem(
// child: Text(
// item.clinicName,
// textAlign: TextAlign.end,
// ),
// value: item.clinicID,
// );
// }).toList(),
// )),
// Positioned(
// right: projectsProvider.isArabic ? 35 : 0,
// top: 0,
// child: new Container(
// padding: EdgeInsets.all(4),
// decoration: new BoxDecoration(
// color: Colors.red[800],
// borderRadius: BorderRadius.circular(20),
// ),
// constraints: BoxConstraints(
// minWidth: 20,
// minHeight: 20,
// ),
// child: new Text(
// projectsProvider
// .doctorClinicsList.length
// .toString(),
// style: new TextStyle(
// color: Colors.white,
// fontSize: projectsProvider.isArabic
// ? 10
// : 11,
// ),
// textAlign: TextAlign.center,
// ),
// ),
// )
// ],
// )
// : AppText(TranslationBase.of(context).noClinic),
Row(
children: [
Container(
padding: EdgeInsets.all(4),
margin: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
projectsProvider.doctorClinicsList.length
.toString(),
style: new TextStyle(
color: Colors.white,
fontSize: projectsProvider.isArabic ? 10 : 11,
),
textAlign: TextAlign.center,
),
),
Container(
width: MediaQuery.of(context).size.width * .6,
// // height: 100,
child: projectsProvider.doctorClinicsList.length > 0
? Stack(
children: [
DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: clinicId == null
? projectsProvider
.doctorClinicsList[0].clinicID
: clinicId,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return projectsProvider
.doctorClinicsList
.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
AppText(
item.clinicName,
fontSize: SizeConfig
.textMultiplier *
2.1,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
);
}).toList();
},
onChanged: (newValue) {
clinicId = newValue;
changeClinic(
newValue, context, model);
},
items: projectsProvider
.doctorClinicsList
.map((item) {
return DropdownMenuItem(
child: Text(
item.clinicName,
textAlign: TextAlign.end,
),
value: item.clinicID,
);
}).toList(),
)),
],
)
: AppText(TranslationBase.of(context).noClinic),
),
],
),
isClilic: true,
),
Container(
height: MediaQuery.of(context).size.height * 0.20,

@ -221,7 +221,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
? widget.selectedType
: routeArgs['selectedType'];
if(routeArgs != null && routeArgs.containsKey("isSearch")){
if (routeArgs != null && routeArgs.containsKey("isSearch")) {
isSearch = routeArgs['isSearch'];
}
@ -306,25 +306,27 @@ class _PatientsScreenState extends State<PatientsScreen> {
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0
? Column(
children: [
if(int.parse(patientType)==7)
children: [
if (int.parse(patientType) == 7)
Container(
margin: EdgeInsets.only(top: 10),
child: ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
},
),
),
Container(
margin: EdgeInsets.only(top: 70),
child: ClinicList(clinicId: clinicId,onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
},),
margin: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.35),
child: DrAppEmbeddedError(
error: TranslationBase.of(context)
.youDontHaveAnyPatient),
),
Container(
margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.35),
child: DrAppEmbeddedError(
error:
TranslationBase.of(context).youDontHaveAnyPatient),
),
],
)
],
)
: Container(
color: Colors.grey[200],
child: ListView(
@ -368,11 +370,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
SizedBox(
height: 10.0,
),
if(int.parse(patientType)==7)
ClinicList(clinicId: clinicId,onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
},),
if (int.parse(patientType) == 7)
ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(
newValue, context, model);
},
),
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context)
@ -522,27 +528,26 @@ class _PatientsScreenState extends State<PatientsScreen> {
tokenID: '',
languageID: 2);
authProvider.getDocProfiles(docInfo.toJson(), allowChangeProfile: false)
authProvider
.getDocProfiles(docInfo.toJson(), allowChangeProfile: false)
.then((profileList) async {
print(profileList['DoctorProfileList'][0]);
int val2 = int.parse(patientType);
GetPatientArrivalListRequestModel
getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel(
from: patient.From,
to: patient.To,
clinicID: profileList['DoctorProfileList'][0]['ClinicID'],
doctorID: profileList['DoctorProfileList'][0]['DoctorID'].toString(),
patientMRN: patient.getPatientID,
pageIndex: 0,
pageSize: 0);
GetPatientArrivalListRequestModel getPatientArrivalListRequestModel =
GetPatientArrivalListRequestModel(
from: patient.From,
to: patient.To,
clinicID: profileList['DoctorProfileList'][0]['ClinicID'],
doctorID:
profileList['DoctorProfileList'][0]['DoctorID'].toString(),
patientMRN: patient.getPatientID,
pageIndex: 0,
pageSize: 0);
model
.getPatientList(
getPatientArrivalListRequestModel.toJson(),
patientType)
getPatientArrivalListRequestModel.toJson(), patientType)
.then((res) {
setState(() {
if (res != null && res['MessageStatus'] == 1) {
@ -572,20 +577,18 @@ class _PatientsScreenState extends State<PatientsScreen> {
_isError = false;
} else {
_isError = true;
error = model.error ?? res['ErrorEndUserMessage'] ??
error = model.error ??
res['ErrorEndUserMessage'] ??
res['ErrorMessage'];
}
_isLoading = false;
});
GifLoaderDialogUtils.hideDialog(context);
}).catchError((error) {
helpers.showErrorToast(error.toString());
GifLoaderDialogUtils.hideDialog(context);
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
helpers.showErrorToast(err);
@ -684,6 +687,3 @@ class _PatientsScreenState extends State<PatientsScreen> {
);
}
}

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo;
@ -42,7 +43,11 @@ class PatientCard extends StatelessWidget {
color: Colors.green[800],
fontWeight: FontWeight.bold,
),
AppText(patientInfo.arrivedOn)
isToday(patientInfo.arrivedOn) == false
? AppText(DateUtils.convertStringToDateFormat(
patientInfo.arrivedOn, 'mm-dd-yyyy hh:mm'))
: AppText(DateUtils.convertStringToDateFormat(
patientInfo.arrivedOn, 'hh:mm'))
],
)
: SizedBox(),
@ -293,6 +298,12 @@ class PatientCard extends StatelessWidget {
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(

@ -9,8 +9,9 @@ import 'package:provider/provider.dart';
class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget;
final double height;
ProfileWelcomeWidget(this.clinicWidget, {this.height = 140});
final bool isClilic;
ProfileWelcomeWidget(this.clinicWidget,
{this.height = 150, this.isClilic = false});
@override
Widget build(BuildContext context) {
@ -21,70 +22,70 @@ class ProfileWelcomeWidget extends StatelessWidget {
// color: HexColor('#515B5D'),
width: double.infinity,
child: FractionallySizedBox(
widthFactor: 0.9,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// Row(
// children: <Widget>[
// AppText(
// TranslationBase.of(context).welcome,
// fontSize: SizeConfig.textMultiplier * 1.7,
// color: Colors.black,
// )
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
AppText(
// TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black,
),
SizedBox(
width: 20,
),
CircleAvatar(
// radius: (52)
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
authProvider.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 75,
height: 75,
widthFactor: 0.9,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
this.isClilic == true ? clinicWidget : SizedBox(),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// Row(
// children: <Widget>[
// AppText(
// TranslationBase.of(context).welcome,
// fontSize: SizeConfig.textMultiplier * 1.7,
// color: Colors.black,
// )
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// AppText(
// // TranslationBase.of(context).dr +
// ' ${authProvider.doctorProfile.doctorName}',
// fontWeight: FontWeight.bold,
// fontSize: SizeConfig.textMultiplier * 2.5,
// color: Colors.black,
// ),
SizedBox(
width: 20,
),
CircleAvatar(
// radius: (52)
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.network(
authProvider.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 75,
height: 75,
),
),
backgroundColor: Colors.transparent,
),
backgroundColor: Colors.transparent,
)
// ],
// ),
// SizedBox(
// height: 4,
// ),
// clinicWidget,
/// ],
// ),
// Expanded(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: <Widget>[
// ],
// ),
SizedBox(
height: 20,
),
/// ],
// ),
// Expanded(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: <Widget>[
// ],
// ),
// ),
],
),
),
// ],
// ),
// ),
],
)),
);
}
}

Loading…
Cancel
Save