fix DoctorView.dart UI issues

merge-update-with-lab-changes
Mohammad Aljammal 6 years ago
parent 91e5a20fd0
commit ef4a57223c

@ -373,5 +373,9 @@ const Map<String, Map<String, String>> localizedValues = {
"building":{"en":"Building:","ar":"المبنى"}, "building":{"en":"Building:","ar":"المبنى"},
"branch":{"en":"Branch:","ar":"الفرع"}, "branch":{"en":"Branch:","ar":"الفرع"},
"emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"},
"textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"},
"MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"},
"NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"},
"NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"},
"noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"},
}; };

@ -36,9 +36,7 @@ class BaseAppClient {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
: SETUP_ID; : SETUP_ID;
body['VersionID'] = body.containsKey('VersionID') body['VersionID'] = VERSION_ID;
? body['VersionID'] != null ? body['VersionID'] : VERSION_ID
: VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;

@ -6,10 +6,12 @@ import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_app
import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart';
import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
class MyDoctorService extends BaseService { class MyDoctorService extends BaseService {
List<PatientDoctorAppointment> patientDoctorAppointmentList = List(); List<PatientDoctorAppointment> patientDoctorAppointmentList = List();
DoctorProfile doctorProfile; DoctorProfile doctorProfile;
DoctorList doctorList;
DoctorRating doctorRating = DoctorRating(); DoctorRating doctorRating = DoctorRating();
RequestPatientDoctorAppointment patientDoctorAppointmentRequest = RequestPatientDoctorAppointment patientDoctorAppointmentRequest =
@ -58,7 +60,6 @@ class MyDoctorService extends BaseService {
} }
RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile( RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile(
doctorID: 2477,
license: true, license: true,
isRegistered: true, isRegistered: true,
projectID: 12, projectID: 12,
@ -79,11 +80,18 @@ class MyDoctorService extends BaseService {
///GET DOCTOR PROFILE ///GET DOCTOR PROFILE
_requestDoctorProfile.doctorID = doctorId; _requestDoctorProfile.doctorID = doctorId;
_requestDoctorProfile.clinicID = clinicID; _requestDoctorProfile.clinicID = clinicID;
_requestDoctorProfile.patientID = projectID; _requestDoctorProfile.projectID = projectID;
hasError = false; hasError = false;
await baseAppClient.post(GET_DOCTOR_PROFILE, await baseAppClient.post(GET_DOCTOR_PROFILE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
doctorProfile = DoctorProfile.fromJson(response['DoctorProfileList'][0]); doctorProfile = DoctorProfile.fromJson(response['DoctorProfileList'][0]);
doctorList = DoctorList.fromJson(response['DoctorProfileList'][0]);
doctorList.clinicName = doctorProfile.clinicDescription;
doctorList.doctorTitle = doctorProfile.doctorTitleForProfile;
doctorList.name = doctorProfile.doctorName;
doctorList.projectName = doctorProfile.projectName;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart';
import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart';
import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart';
import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -22,6 +23,9 @@ class MyDoctorViewModel extends BaseViewModel {
? _patientDoctorAppointmentListClinic ? _patientDoctorAppointmentListClinic
: _patientDoctorAppointmentListHospital; : _patientDoctorAppointmentListHospital;
DoctorList get doctorList=> _myDoctorService.doctorList;
DoctorProfile get doctorProfile => _myDoctorService.doctorProfile; DoctorProfile get doctorProfile => _myDoctorService.doctorProfile;
DoctorRating get doctorRating => _myDoctorService.doctorRating; DoctorRating get doctorRating => _myDoctorService.doctorRating;
@ -83,7 +87,7 @@ class MyDoctorViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
void getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID); await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID);
if (_myDoctorService.hasError) { if (_myDoctorService.hasError) {

@ -1,3 +1,5 @@
import 'package:intl/intl.dart';
class DoctorList { class DoctorList {
int clinicID; int clinicID;
String clinicName; String clinicName;
@ -118,6 +120,7 @@ class DoctorList {
rateNumber = json['RateNumber']; rateNumber = json['RateNumber'];
serviceID = json['ServiceID']; serviceID = json['ServiceID'];
setupID = json['SetupID']; setupID = json['SetupID'];
if (json.containsKey('Speciality'))
speciality = json['Speciality'].cast<String>(); speciality = json['Speciality'].cast<String>();
workingHours = json['WorkingHours']; workingHours = json['WorkingHours'];
} }
@ -166,3 +169,13 @@ class DoctorList {
return data; return data;
} }
} }
class DoctorListAppointmentList {
String filterName = "";
List<DoctorList> patientDoctorAppointmentList = List();
DoctorListAppointmentList(
{this.filterName, DoctorList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment);
}
}

@ -9,7 +9,7 @@ import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../DoctorProfile.dart'; import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget { class DoctorView extends StatelessWidget {
DoctorList doctor; final DoctorList doctor;
DoctorView({@required this.doctor}); DoctorView({@required this.doctor});
@ -33,17 +33,23 @@ class DoctorView extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
ClipRRect( Expanded(
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0), borderRadius: BorderRadius.circular(100.0),
child: Image.network(this.doctor.doctorImageURL, child: Image.network(this.doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0), fit: BoxFit.fill, height: 60.0, width: 60.0),
), ),
Container( ),
Expanded(
flex: 4,
child: Container(
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if(doctor.doctorTitle!=null)
Text(this.doctor.doctorTitle + " " + this.doctor.name, Text(this.doctor.doctorTitle + " " + this.doctor.name,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
@ -65,6 +71,7 @@ class DoctorView extends StatelessWidget {
color: Colors.grey[600], color: Colors.grey[600],
letterSpacing: 1.0)), letterSpacing: 1.0)),
), ),
if(doctor.speciality!=null)
Container( Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0), margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text( child: Text(
@ -98,6 +105,7 @@ class DoctorView extends StatelessWidget {
], ],
), ),
), ),
),
], ],
), ),
), ),

@ -36,7 +36,7 @@ class _MyAppointmentsState extends State<MyAppointments>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "My Appointments", appBarTitle: TranslationBase.of(context).myAppointments,
isShowAppBar: true, isShowAppBar: true,
body: Container( body: Container(
child: Column(children: [ child: Column(children: [
@ -158,7 +158,7 @@ class _MyAppointmentsState extends State<MyAppointments>
"assets/images/new-design/noAppointmentIcon.png"), "assets/images/new-design/noAppointmentIcon.png"),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments", child: Text(TranslationBase.of(context).noBookedAppointments,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
)), )),
@ -192,7 +192,7 @@ class _MyAppointmentsState extends State<MyAppointments>
Image.asset("assets/images/new-design/noAppointmentIcon.png"), Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text("No Confirmed Appointments", child: Text(TranslationBase.of(context).noConfirmedAppointments ,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
)), )),
@ -225,7 +225,7 @@ class _MyAppointmentsState extends State<MyAppointments>
Image.asset("assets/images/new-design/noAppointmentIcon.png"), Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text("No Arrived Appointments", child: Text(TranslationBase.of(context).noArrivedAppointments,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
)), )),

@ -154,8 +154,8 @@ class _HomePageState extends State<HomePage> {
), ),
Align( Align(
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic
? Alignment.bottomLeft ? Alignment.bottomRight
: Alignment.bottomRight, : Alignment.bottomLeft,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.goToMyProfile(); widget.goToMyProfile();

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
@ -75,16 +77,40 @@ class DoctorHomePage extends StatelessWidget {
children: model.patientDoctorAppointmentList[index] children: model.patientDoctorAppointmentList[index]
.patientDoctorAppointmentList .patientDoctorAppointmentList
.map((doctor) { .map((doctor) {
return InkWell( DoctorList doctorList = DoctorList(
onTap: () { projectID: doctor.projectID,
setupID: doctor.setupID,
clinicID: doctor.clinicID,
projectName: doctor.projectName,
clinicName: doctor.clinicName,
actualDoctorRate: doctor.actualDoctorRate,
doctorID: doctor.doctorID,
doctorRate: doctor.doctorRate,
gender: doctor.gender,
doctorTitle: doctor.doctorTitle,
name: doctor.doctorName,
doctorImageURL: doctor.doctorImageURL,
nationalityFlagURL:doctor.nationalityFlagURL
);
return DoctorView(doctor: doctorList,);/* InkWell(
onTap: () async {
model
.getDoctorProfileAndRating(
doctorId: doctor.doctorID,
clinicID: doctor.clinicID,
projectID: doctor.projectID)
.then((value) {
var asd="";
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: DoctorProfilePage( page: DoctorView(doctor: model.doctorList,),
patientDoctorAppointment: doctor,
),
), ),
); );
}).catchError((e){
var asd="";
});
}, },
child: DoctorCard( child: DoctorCard(
name: doctor.doctorName, name: doctor.doctorName,
@ -93,7 +119,7 @@ class DoctorHomePage extends StatelessWidget {
subName: DateUtil.getMonthDayYearDateFormatted( subName: DateUtil.getMonthDayYearDateFormatted(
doctor.appointmentDate), doctor.appointmentDate),
), ),
); )*/;
}).toList(), }).toList(),
)), )),
) )

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -35,11 +37,11 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MyDoctorViewModel>( return BaseView<MyDoctorViewModel>(
onModelReady: (model) => model.getDoctorProfileAndRating( /* onModelReady: (model) => model.getDoctorProfileAndRating(
doctorId: widget.patientDoctorAppointment.doctorID, doctorId: widget.patientDoctorAppointment.doctorID,
clinicID: widget.patientDoctorAppointment.clinicID, clinicID: widget.patientDoctorAppointment.clinicID,
projectID: widget.patientDoctorAppointment.projectID), projectID: widget.patientDoctorAppointment.projectID),*/
builder: (context, model, widget) => AppScaffold( builder: (context, model, widget) => DoctorView(doctor: model.doctorList,)/*AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Doctor Profile', appBarTitle: 'Doctor Profile',
baseViewModel: model, baseViewModel: model,
@ -62,8 +64,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
width: 50, width: 50,
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle, color: Colors.grey),
color: Colors.grey),
child: Icon( child: Icon(
Icons.calendar_view_day, Icons.calendar_view_day,
size: 25, size: 25,
@ -82,8 +83,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
width: 50, width: 50,
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle, color: Colors.grey),
color: Colors.grey),
child: Icon( child: Icon(
Icons.format_list_bulleted, Icons.format_list_bulleted,
size: 25, size: 25,
@ -115,8 +115,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
alignment: Alignment.center, alignment: Alignment.center,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: initialRating:
model.doctorRating.doctorRate?.toDouble() ?? model.doctorRating.doctorRate?.toDouble() ?? 0.0,
0.0,
size: 35.0, size: 35.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
@ -152,8 +151,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
child: Text('Doctor Information', child: Text('Doctor Information',
style: TextStyle(color: Colors.black))), style: TextStyle(color: Colors.black))),
Tab( Tab(
child: Text( child: Text(TranslationBase.of(context).availableAppo,
TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.black)), style: TextStyle(color: Colors.black)),
) )
], ],
@ -167,7 +165,8 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
DoctorInformation( DoctorInformation(
doctorProfile: model.doctorProfile, doctorProfile: model.doctorProfile,
), ),
Container() Container(),
// DocAvailableAppointments(doctor: model.doctorList,)
], ],
controller: _tabController, controller: _tabController,
), ),
@ -178,6 +177,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
], ],
), ),
), ),
)); )*/,
);
} }
} }

@ -450,6 +450,12 @@ class TranslationBase {
String get logs => localizedValues['logs'][locale.languageCode]; String get logs => localizedValues['logs'][locale.languageCode];
String get textToSpeech => String get textToSpeech =>
localizedValues['textToSpeech'][locale.languageCode]; localizedValues['textToSpeech'][locale.languageCode];
String get myAppointments => localizedValues['MyAppointments'][locale.languageCode];
String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode];
String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode];
String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save