|
|
|
@ -4,6 +4,9 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
@ -21,109 +24,82 @@ class DoctorView extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if(isShowFlag)
|
|
|
|
|
getDoctorsProfile(context, doctor);
|
|
|
|
|
if (isShowFlag) getDoctorsProfile(context, doctor);
|
|
|
|
|
},
|
|
|
|
|
child: Card(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(),
|
|
|
|
|
padding: EdgeInsets.all(7.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
|
//spreadRadius: 5,
|
|
|
|
|
blurRadius: 27,
|
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.55,
|
|
|
|
|
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: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 3.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
this.doctor.clinicName != null
|
|
|
|
|
? 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)),
|
|
|
|
|
),
|
|
|
|
|
this.doctor.nearestFreeSlot != null
|
|
|
|
|
? Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
|
|
|
|
|
child: Text(getDate(this.doctor.nearestFreeSlot),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.green[600],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
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,
|
|
|
|
|
],
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
if (doctor.doctorTitle != null)
|
|
|
|
|
Text(
|
|
|
|
|
doctor.doctorTitle + " " + doctor.name,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
),
|
|
|
|
|
if (doctor.doctorTitle != null) SizedBox(height: 6),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LargeAvatar(
|
|
|
|
|
name: doctor.name,
|
|
|
|
|
url: doctor.doctorImageURL,
|
|
|
|
|
width: 48,
|
|
|
|
|
height: 48,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 11),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName),
|
|
|
|
|
if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName),
|
|
|
|
|
if (doctor.speciality != null)
|
|
|
|
|
Text(
|
|
|
|
|
getDoctorSpeciality(this.doctor.speciality).trim(),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
|
|
|
|
|
),
|
|
|
|
|
if (doctor.nearestFreeSlot != null)
|
|
|
|
|
Text(
|
|
|
|
|
getDate(doctor.nearestFreeSlot),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff359846), letterSpacing: -0.48, height: 18 / 12),
|
|
|
|
|
),
|
|
|
|
|
isShowFlag ? Container(
|
|
|
|
|
child: Image.network(this.doctor.nationalityFlagURL,
|
|
|
|
|
width: 25.0, height: 25.0),
|
|
|
|
|
) : Container(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RatingBar.readOnly(
|
|
|
|
|
initialRating: this.doctor.actualDoctorRate.toDouble(),
|
|
|
|
|
size: 15.0,
|
|
|
|
|
filledColor: Color(0XFFD02127),
|
|
|
|
|
emptyColor: Color(0XFFD02127),
|
|
|
|
|
isHalfAllowed: true,
|
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
|
emptyIcon: Icons.star_border,
|
|
|
|
|
),
|
|
|
|
|
if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -144,10 +120,7 @@ class DoctorView extends StatelessWidget {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
List<DoctorProfileList> docProfileList = [];
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.getDoctorsProfile(docObject.doctorID, docObject.clinicID,
|
|
|
|
|
docObject.projectID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
service.getDoctorsProfile(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
if (res['DoctorProfileList'].length != 0) {
|
|
|
|
@ -155,8 +128,7 @@ class DoctorView extends StatelessWidget {
|
|
|
|
|
docProfileList.add(new DoctorProfileList.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
} else {}
|
|
|
|
|
navigateToDoctorProfile(context, docObject, docProfileList[0],
|
|
|
|
|
isAppo: isAppo);
|
|
|
|
|
navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
@ -188,8 +160,7 @@ class DoctorView extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToDoctorProfile(context, docObject, docProfile,
|
|
|
|
|
{isAppo}) async {
|
|
|
|
|
Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|