Merge branch 'sultan' into 'development'

Sultan

See merge request Cloud_Solution/doctor_app_flutter!358
merge-requests/359/head
Mohammad Aljammal 5 years ago
commit 4eaea955f8

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

@ -221,7 +221,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
? widget.selectedType ? widget.selectedType
: routeArgs['selectedType']; : routeArgs['selectedType'];
if(routeArgs != null && routeArgs.containsKey("isSearch")){ if (routeArgs != null && routeArgs.containsKey("isSearch")) {
isSearch = routeArgs['isSearch']; isSearch = routeArgs['isSearch'];
} }
@ -306,25 +306,27 @@ class _PatientsScreenState extends State<PatientsScreen> {
? DrAppEmbeddedError(error: error) ? DrAppEmbeddedError(error: error)
: 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(
margin: EdgeInsets.only(top: 10),
child: ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
},
),
),
Container( Container(
margin: EdgeInsets.only(top: 70), margin: EdgeInsets.only(
child: ClinicList(clinicId: clinicId,onClinicChange: (newValue) { top: MediaQuery.of(context).size.height * 0.35),
clinicId = newValue; child: DrAppEmbeddedError(
changeClinic(newValue, context, model); 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( : Container(
color: Colors.grey[200], color: Colors.grey[200],
child: ListView( child: ListView(
@ -368,11 +370,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
if(int.parse(patientType)==7) if (int.parse(patientType) == 7)
ClinicList(clinicId: clinicId,onClinicChange: (newValue) { ClinicList(
clinicId = newValue; clinicId: clinicId,
changeClinic(newValue, context, model); onClinicChange: (newValue) {
},), clinicId = newValue;
changeClinic(
newValue, context, model);
},
),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context) top: MediaQuery.of(context)
@ -523,27 +529,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:
doctorID: profileList['DoctorProfileList'][0]['DoctorID'].toString(), 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) {
@ -573,20 +578,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);
@ -685,6 +688,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) {
@ -21,70 +22,70 @@ class ProfileWelcomeWidget extends StatelessWidget {
// color: HexColor('#515B5D'), // color: HexColor('#515B5D'),
width: double.infinity, width: double.infinity,
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Column( this.isClilic == true ? clinicWidget : SizedBox(),
// crossAxisAlignment: CrossAxisAlignment.start, // Column(
// mainAxisAlignment: MainAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[ // mainAxisAlignment: MainAxisAlignment.start,
// Row( // children: <Widget>[
// children: <Widget>[ // Row(
// AppText( // children: <Widget>[
// TranslationBase.of(context).welcome, // AppText(
// fontSize: SizeConfig.textMultiplier * 1.7, // TranslationBase.of(context).welcome,
// color: Colors.black, // fontSize: SizeConfig.textMultiplier * 1.7,
// ) // color: Colors.black,
// ], // )
// ), // ],
// Row( // ),
// mainAxisAlignment: MainAxisAlignment.end, // Row(
// children: <Widget>[ // mainAxisAlignment: MainAxisAlignment.end,
AppText( // children: <Widget>[
// TranslationBase.of(context).dr + // AppText(
' ${authProvider.doctorProfile.doctorName}', // // TranslationBase.of(context).dr +
fontWeight: FontWeight.bold, // ' ${authProvider.doctorProfile.doctorName}',
fontSize: SizeConfig.textMultiplier * 2.5, // fontWeight: FontWeight.bold,
color: Colors.black, // fontSize: SizeConfig.textMultiplier * 2.5,
), // color: Colors.black,
SizedBox( // ),
width: 20, SizedBox(
), width: 20,
CircleAvatar( ),
// radius: (52) CircleAvatar(
child: ClipRRect( // radius: (52)
borderRadius: BorderRadius.circular(10), child: ClipRRect(
child: Image.network( borderRadius: BorderRadius.circular(10),
authProvider.doctorProfile.doctorImageURL, child: Image.network(
fit: BoxFit.fill, authProvider.doctorProfile.doctorImageURL,
width: 75, fit: BoxFit.fill,
height: 75, width: 75,
height: 75,
),
), ),
backgroundColor: Colors.transparent,
), ),
backgroundColor: Colors.transparent, // ],
) // ),
// ], SizedBox(
// ), height: 20,
// SizedBox( ),
// height: 4,
// ), /// ],
// clinicWidget, // ),
/// ], // Expanded(
// ), // child: Column(
// Expanded( // mainAxisAlignment: MainAxisAlignment.start,
// child: Column( // crossAxisAlignment: CrossAxisAlignment.end,
// mainAxisAlignment: MainAxisAlignment.start, // children: <Widget>[
// crossAxisAlignment: CrossAxisAlignment.end,
// children: <Widget>[
// ], // ],
// ), // ),
// ), // ),
], ],
), )),
),
); );
} }
} }

Loading…
Cancel
Save