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( Column(
children: <Widget>[ children: <Widget>[
ProfileWelcomeWidget( ProfileWelcomeWidget(
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( Container(
width: MediaQuery.of(context).size.width * .6, width: MediaQuery.of(context).size.width * .6,
// // height: 100, // // height: 100,
// child: projectsProvider.doctorClinicsList.length > 0 child: projectsProvider.doctorClinicsList.length > 0
// ? Stack( ? Stack(
// children: [ children: [
// DropdownButtonHideUnderline( DropdownButtonHideUnderline(
// child: DropdownButton( child: DropdownButton(
// dropdownColor: Colors.white, dropdownColor: Colors.white,
// iconEnabledColor: Colors.white, iconEnabledColor: Colors.black,
// isExpanded: true, isExpanded: true,
// value: clinicId == null value: clinicId == null
// ? projectsProvider ? projectsProvider
// .doctorClinicsList[0].clinicID .doctorClinicsList[0].clinicID
// : clinicId, : clinicId,
// iconSize: 25, iconSize: 25,
// elevation: 16, elevation: 16,
// selectedItemBuilder: selectedItemBuilder:
// (BuildContext context) { (BuildContext context) {
// return projectsProvider.doctorClinicsList return projectsProvider
// .map((item) { .doctorClinicsList
// return Row( .map((item) {
// mainAxisSize: MainAxisSize.max, return Row(
// children: <Widget>[ mainAxisSize: MainAxisSize.max,
// AppText( children: <Widget>[
// item.clinicName, AppText(
// fontSize: item.clinicName,
// SizeConfig.textMultiplier * fontSize: SizeConfig
// 2.1, .textMultiplier *
// color: Colors.white, 2.1,
// ), color: Colors.black,
// ], fontWeight: FontWeight.bold,
// ); ),
// }).toList(); ],
// }, );
// onChanged: (newValue) { }).toList();
// clinicId = newValue; },
// changeClinic(newValue, context, model); onChanged: (newValue) {
// }, clinicId = newValue;
// items: projectsProvider.doctorClinicsList changeClinic(
// .map((item) { newValue, context, model);
// return DropdownMenuItem( },
// child: Text( items: projectsProvider
// item.clinicName, .doctorClinicsList
// textAlign: TextAlign.end, .map((item) {
// ), return DropdownMenuItem(
// value: item.clinicID, child: Text(
// ); item.clinicName,
// }).toList(), textAlign: TextAlign.end,
// )), ),
// Positioned( value: item.clinicID,
// right: projectsProvider.isArabic ? 35 : 0, );
// top: 0, }).toList(),
// child: new Container( )),
// padding: EdgeInsets.all(4), ],
// decoration: new BoxDecoration( )
// color: Colors.red[800], : AppText(TranslationBase.of(context).noClinic),
// 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),
), ),
isClilic: true,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.20, height: MediaQuery.of(context).size.height * 0.20,

@ -307,21 +307,23 @@ class _PatientsScreenState extends State<PatientsScreen> {
: lItems == null || lItems.length == 0 : lItems == null || lItems.length == 0
? Column( ? Column(
children: [ children: [
if (int.parse(patientType) == 7) if (int.parse(patientType) == 7)
Container( Container(
margin: EdgeInsets.only(top: 70), margin: EdgeInsets.only(top: 10),
child: ClinicList(clinicId: clinicId,onClinicChange: (newValue) { child: ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue; clinicId = newValue;
changeClinic(newValue, context, model); changeClinic(newValue, context, model);
},), },
),
), ),
Container( Container(
margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.35), margin: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.35),
child: DrAppEmbeddedError( child: DrAppEmbeddedError(
error: error: TranslationBase.of(context)
TranslationBase.of(context).youDontHaveAnyPatient), .youDontHaveAnyPatient),
), ),
], ],
) )
@ -369,10 +371,14 @@ class _PatientsScreenState extends State<PatientsScreen> {
height: 10.0, height: 10.0,
), ),
if (int.parse(patientType) == 7) if (int.parse(patientType) == 7)
ClinicList(clinicId: clinicId,onClinicChange: (newValue) { ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue; clinicId = newValue;
changeClinic(newValue, context, model); changeClinic(
},), newValue, context, model);
},
),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context) top: MediaQuery.of(context)
@ -522,27 +528,26 @@ class _PatientsScreenState extends State<PatientsScreen> {
tokenID: '', tokenID: '',
languageID: 2); languageID: 2);
authProvider.getDocProfiles(docInfo.toJson(), allowChangeProfile: false) authProvider
.getDocProfiles(docInfo.toJson(), allowChangeProfile: false)
.then((profileList) async { .then((profileList) async {
print(profileList['DoctorProfileList'][0]); print(profileList['DoctorProfileList'][0]);
int val2 = int.parse(patientType); int val2 = int.parse(patientType);
GetPatientArrivalListRequestModel GetPatientArrivalListRequestModel getPatientArrivalListRequestModel =
GetPatientArrivalListRequestModel(
getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel(
from: patient.From, from: patient.From,
to: patient.To, to: patient.To,
clinicID: profileList['DoctorProfileList'][0]['ClinicID'], clinicID: profileList['DoctorProfileList'][0]['ClinicID'],
doctorID: profileList['DoctorProfileList'][0]['DoctorID'].toString(), doctorID:
profileList['DoctorProfileList'][0]['DoctorID'].toString(),
patientMRN: patient.getPatientID, patientMRN: patient.getPatientID,
pageIndex: 0, pageIndex: 0,
pageSize: 0); pageSize: 0);
model model
.getPatientList( .getPatientList(
getPatientArrivalListRequestModel.toJson(), getPatientArrivalListRequestModel.toJson(), patientType)
patientType)
.then((res) { .then((res) {
setState(() { setState(() {
if (res != null && res['MessageStatus'] == 1) { if (res != null && res['MessageStatus'] == 1) {
@ -572,20 +577,18 @@ class _PatientsScreenState extends State<PatientsScreen> {
_isError = false; _isError = false;
} else { } else {
_isError = true; _isError = true;
error = model.error ?? res['ErrorEndUserMessage'] ?? error = model.error ??
res['ErrorEndUserMessage'] ??
res['ErrorMessage']; res['ErrorMessage'];
} }
_isLoading = false; _isLoading = false;
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}).catchError((error) { }).catchError((error) {
helpers.showErrorToast(error.toString()); helpers.showErrorToast(error.toString());
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
helpers.showErrorToast(err); 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
class PatientCard extends StatelessWidget { class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
@ -42,7 +43,11 @@ class PatientCard extends StatelessWidget {
color: Colors.green[800], color: Colors.green[800],
fontWeight: FontWeight.bold, 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(), : SizedBox(),
@ -293,6 +298,12 @@ class PatientCard extends StatelessWidget {
return newDate.toString(); 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() { myBoxDecoration() {
return BoxDecoration( return BoxDecoration(
border: Border( border: Border(

@ -9,8 +9,9 @@ import 'package:provider/provider.dart';
class ProfileWelcomeWidget extends StatelessWidget { class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget; final Widget clinicWidget;
final double height; final double height;
final bool isClilic;
ProfileWelcomeWidget(this.clinicWidget, {this.height = 140}); ProfileWelcomeWidget(this.clinicWidget,
{this.height = 150, this.isClilic = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -26,6 +27,7 @@ class ProfileWelcomeWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
this.isClilic == true ? clinicWidget : SizedBox(),
// Column( // Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
@ -42,13 +44,13 @@ class ProfileWelcomeWidget extends StatelessWidget {
// Row( // Row(
// mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[ // children: <Widget>[
AppText( // AppText(
// TranslationBase.of(context).dr + // // TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}', // ' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, // fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.black, // color: Colors.black,
), // ),
SizedBox( SizedBox(
width: 20, width: 20,
), ),
@ -64,13 +66,13 @@ class ProfileWelcomeWidget extends StatelessWidget {
), ),
), ),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
) ),
// ], // ],
// ), // ),
// SizedBox( SizedBox(
// height: 4, height: 20,
// ), ),
// clinicWidget,
/// ], /// ],
// ), // ),
// Expanded( // Expanded(
@ -83,8 +85,7 @@ class ProfileWelcomeWidget extends StatelessWidget {
// ), // ),
// ), // ),
], ],
), )),
),
); );
} }
} }

Loading…
Cancel
Save