fix DoctorView.dart UI issues

find_us
Mohammad Aljammal 5 years ago
parent 91e5a20fd0
commit ef4a57223c

@ -373,5 +373,9 @@ const Map<String, Map<String, String>> localizedValues = {
"building":{"en":"Building:","ar":"المبنى"},
"branch":{"en":"Branch:","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'] != null ? body['SetupID'] : SETUP_ID
: SETUP_ID;
body['VersionID'] = body.containsKey('VersionID')
? body['VersionID'] != null ? body['VersionID'] : VERSION_ID
: VERSION_ID;
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
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_rating.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
class MyDoctorService extends BaseService {
List<PatientDoctorAppointment> patientDoctorAppointmentList = List();
DoctorProfile doctorProfile;
DoctorList doctorList;
DoctorRating doctorRating = DoctorRating();
RequestPatientDoctorAppointment patientDoctorAppointmentRequest =
@ -58,7 +60,6 @@ class MyDoctorService extends BaseService {
}
RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile(
doctorID: 2477,
license: true,
isRegistered: true,
projectID: 12,
@ -79,11 +80,18 @@ class MyDoctorService extends BaseService {
///GET DOCTOR PROFILE
_requestDoctorProfile.doctorID = doctorId;
_requestDoctorProfile.clinicID = clinicID;
_requestDoctorProfile.patientID = projectID;
_requestDoctorProfile.projectID = projectID;
hasError = false;
await baseAppClient.post(GET_DOCTOR_PROFILE,
onSuccess: (dynamic response, int statusCode) {
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) {
hasError = true;
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/patient_doctor_appointment.dart';
import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
@ -22,6 +23,9 @@ class MyDoctorViewModel extends BaseViewModel {
? _patientDoctorAppointmentListClinic
: _patientDoctorAppointmentListHospital;
DoctorList get doctorList=> _myDoctorService.doctorList;
DoctorProfile get doctorProfile => _myDoctorService.doctorProfile;
DoctorRating get doctorRating => _myDoctorService.doctorRating;
@ -83,7 +87,7 @@ class MyDoctorViewModel extends BaseViewModel {
notifyListeners();
}
void getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async {
Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async {
setState(ViewState.Busy);
await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID);
if (_myDoctorService.hasError) {

@ -1,3 +1,5 @@
import 'package:intl/intl.dart';
class DoctorList {
int clinicID;
String clinicName;
@ -41,44 +43,44 @@ class DoctorList {
DoctorList(
{this.clinicID,
this.clinicName,
this.doctorTitle,
this.iD,
this.name,
this.projectID,
this.projectName,
this.actualDoctorRate,
this.clinicRoomNo,
this.date,
this.dayName,
this.doctorID,
this.doctorImageURL,
this.doctorProfile,
this.doctorProfileInfo,
this.doctorRate,
this.gender,
this.genderDescription,
this.isAppointmentAllowed,
this.isDoctorAllowVedioCall,
this.isDoctorDummy,
this.isLiveCare,
this.latitude,
this.longitude,
this.nationalityFlagURL,
this.nationalityID,
this.nationalityName,
this.nearestFreeSlot,
this.noOfPatientsRate,
this.originalClinicID,
this.personRate,
this.projectDistanceInKiloMeters,
this.qR,
this.qRString,
this.rateNumber,
this.serviceID,
this.setupID,
this.speciality,
this.workingHours});
this.clinicName,
this.doctorTitle,
this.iD,
this.name,
this.projectID,
this.projectName,
this.actualDoctorRate,
this.clinicRoomNo,
this.date,
this.dayName,
this.doctorID,
this.doctorImageURL,
this.doctorProfile,
this.doctorProfileInfo,
this.doctorRate,
this.gender,
this.genderDescription,
this.isAppointmentAllowed,
this.isDoctorAllowVedioCall,
this.isDoctorDummy,
this.isLiveCare,
this.latitude,
this.longitude,
this.nationalityFlagURL,
this.nationalityID,
this.nationalityName,
this.nearestFreeSlot,
this.noOfPatientsRate,
this.originalClinicID,
this.personRate,
this.projectDistanceInKiloMeters,
this.qR,
this.qRString,
this.rateNumber,
this.serviceID,
this.setupID,
this.speciality,
this.workingHours});
DoctorList.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
@ -118,7 +120,8 @@ class DoctorList {
rateNumber = json['RateNumber'];
serviceID = json['ServiceID'];
setupID = json['SetupID'];
speciality = json['Speciality'].cast<String>();
if (json.containsKey('Speciality'))
speciality = json['Speciality'].cast<String>();
workingHours = json['WorkingHours'];
}
@ -166,3 +169,13 @@ class DoctorList {
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';
class DoctorView extends StatelessWidget {
DoctorList doctor;
final DoctorList doctor;
DoctorView({@required this.doctor});
@ -33,69 +33,77 @@ class DoctorView extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(this.doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
Expanded(
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(this.doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(this.doctor.doctorTitle + " " + this.doctor.name,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(this.doctor.speciality).trim(),
Expanded(
flex: 4,
child: Container(
width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if(doctor.doctorTitle!=null)
Text(this.doctor.doctorTitle + " " + this.doctor.name,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating:
this.doctor.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
child: Image.network(this.doctor.nationalityFlagURL,
width: 25.0, height: 25.0),
),
],
),
],
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
if(doctor.speciality!=null)
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating:
this.doctor.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
child: Image.network(this.doctor.nationalityFlagURL,
width: 25.0, height: 25.0),
),
],
),
],
),
),
),
],

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

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

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.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/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
@ -75,16 +77,40 @@ class DoctorHomePage extends StatelessWidget {
children: model.patientDoctorAppointmentList[index]
.patientDoctorAppointmentList
.map((doctor) {
return InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: DoctorProfilePage(
patientDoctorAppointment: doctor,
),
),
);
DoctorList doctorList = DoctorList(
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(
context,
FadePage(
page: DoctorView(doctor: model.doctorList,),
),
);
}).catchError((e){
var asd="";
});
},
child: DoctorCard(
name: doctor.doctorName,
@ -93,7 +119,7 @@ class DoctorHomePage extends StatelessWidget {
subName: DateUtil.getMonthDayYearDateFormatted(
doctor.appointmentDate),
),
);
)*/;
}).toList(),
)),
)

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -35,149 +37,147 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
@override
Widget build(BuildContext context) {
return BaseView<MyDoctorViewModel>(
onModelReady: (model) => model.getDoctorProfileAndRating(
doctorId: widget.patientDoctorAppointment.doctorID,
clinicID: widget.patientDoctorAppointment.clinicID,
projectID: widget.patientDoctorAppointment.projectID),
builder: (context, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: 'Doctor Profile',
baseViewModel: model,
body: SingleChildScrollView(
/* onModelReady: (model) => model.getDoctorProfileAndRating(
doctorId: widget.patientDoctorAppointment.doctorID,
clinicID: widget.patientDoctorAppointment.clinicID,
projectID: widget.patientDoctorAppointment.projectID),*/
builder: (context, model, widget) => DoctorView(doctor: model.doctorList,)/*AppScaffold(
isShowAppBar: true,
appBarTitle: 'Doctor Profile',
baseViewModel: model,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only(top: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
margin: EdgeInsets.all(5),
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey),
child: Icon(
Icons.calendar_view_day,
size: 25,
color: Colors.white,
)),
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
patientDoctorAppointment.doctorImageURL,
fit: BoxFit.fill,
height: 120.0,
width: 120.0),
),
Container(
margin: EdgeInsets.all(5),
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey),
child: Icon(
Icons.format_list_bulleted,
size: 25,
color: Colors.white,
)),
],
),
margin: EdgeInsets.all(5),
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.grey),
child: Icon(
Icons.calendar_view_day,
size: 25,
color: Colors.white,
)),
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
patientDoctorAppointment.doctorImageURL,
fit: BoxFit.fill,
height: 120.0,
width: 120.0),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(patientDoctorAppointment.doctorName,
style: TextStyle(
fontSize: 20.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(patientDoctorAppointment.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating:
model.doctorRating.doctorRate?.toDouble() ??
0.0,
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: Text(
"(${model.doctorRating.patientNumber ?? 0} Reviews)",
style: TextStyle(
fontSize: 14.0,
color: Colors.blue[800],
letterSpacing: 1.0,
decoration: TextDecoration.underline,
)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Divider(
color: Colors.grey[500],
),
),
TabBar(
indicatorColor: Colors.red[800],
indicatorWeight: 3.0,
tabs: [
Tab(
child: Text('Doctor Information',
style: TextStyle(color: Colors.black))),
Tab(
child: Text(
TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
Container(
height: MediaQuery.of(context).size.height * 0.8,
child: TabBarView(
physics: BouncingScrollPhysics(),
children: [
DoctorInformation(
doctorProfile: model.doctorProfile,
),
Container()
],
controller: _tabController,
),
margin: EdgeInsets.all(5),
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.grey),
child: Icon(
Icons.format_list_bulleted,
size: 25,
color: Colors.white,
)),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(patientDoctorAppointment.doctorName,
style: TextStyle(
fontSize: 20.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(patientDoctorAppointment.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating:
model.doctorRating.doctorRate?.toDouble() ?? 0.0,
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: Text(
"(${model.doctorRating.patientNumber ?? 0} Reviews)",
style: TextStyle(
fontSize: 14.0,
color: Colors.blue[800],
letterSpacing: 1.0,
decoration: TextDecoration.underline,
)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Divider(
color: Colors.grey[500],
),
),
TabBar(
indicatorColor: Colors.red[800],
indicatorWeight: 3.0,
tabs: [
Tab(
child: Text('Doctor Information',
style: TextStyle(color: Colors.black))),
Tab(
child: Text(TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
Container(
height: MediaQuery.of(context).size.height * 0.8,
child: TabBarView(
physics: BouncingScrollPhysics(),
children: [
DoctorInformation(
doctorProfile: model.doctorProfile,
),
Container(),
// DocAvailableAppointments(doctor: model.doctorList,)
],
controller: _tabController,
),
),
],
),
),
));
],
),
),
)*/,
);
}
}

@ -450,6 +450,12 @@ class TranslationBase {
String get logs => localizedValues['logs'][locale.languageCode];
String get textToSpeech =>
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> {

Loading…
Cancel
Save