|
|
|
|
@ -20,191 +20,61 @@ class AskDoctorPage extends StatelessWidget {
|
|
|
|
|
onModelReady: (model) => model.getMyDoctor(),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 70,
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientDoctorAppointmentListHospital.length,
|
|
|
|
|
(index) => AppExpandableNotifier(
|
|
|
|
|
title:
|
|
|
|
|
model.patientDoctorAppointmentListHospital[index].filterName,
|
|
|
|
|
bodyWidget: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children:
|
|
|
|
|
model.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
model
|
|
|
|
|
.getCallInfoHoursResult(
|
|
|
|
|
doctorId: doctor.doctorID,
|
|
|
|
|
projectId: doctor.projectID)
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state != ViewState.ErrorLocal &&
|
|
|
|
|
model.state != ViewState.Error) {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: RequestTypePage(doctorList: doctor,),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: model.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
///.showProgressBar(
|
|
|
|
|
// text: "Loading",
|
|
|
|
|
// backgroundColor:
|
|
|
|
|
// Colors.blue.withOpacity(0.6))
|
|
|
|
|
},
|
|
|
|
|
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(
|
|
|
|
|
doctor.doctorImageURL,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
height: 60.0,
|
|
|
|
|
width: 60.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
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(
|
|
|
|
|
doctor.doctorTitle +
|
|
|
|
|
" " +
|
|
|
|
|
doctor.name,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 3.0),
|
|
|
|
|
child: Text(doctor.clinicName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 3.0),
|
|
|
|
|
child: Text(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(
|
|
|
|
|
doctor.speciality)
|
|
|
|
|
.trim(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
doctor.nearestFreeSlot != null
|
|
|
|
|
? Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 3.0, bottom: 3.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getDate(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: 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(
|
|
|
|
|
doctor.nationalityFlagURL,
|
|
|
|
|
width: 25.0,
|
|
|
|
|
height: 25.0),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _appointmentExpandableList(List<PatientDoctorAppointmentList> _patientDoctorAppointmentList) {
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(top: 12),
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: 1,
|
|
|
|
|
margin: EdgeInsets.only(left: 21, right: 21),
|
|
|
|
|
color: Color(0xffD9D9D9),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
List<DoctorList> _doctorList = _patientDoctorAppointmentList[index].patientDoctorAppointmentList;
|
|
|
|
|
return AppExpandableNotifier(
|
|
|
|
|
title: _patientDoctorAppointmentList[index].filterName,
|
|
|
|
|
bodyWidget: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
|
|
|
|
|
itemBuilder: (context, _index) {
|
|
|
|
|
DoctorList _doctor = _doctorList[_index];
|
|
|
|
|
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.name,
|
|
|
|
|
speciality: _doctor.speciality,
|
|
|
|
|
doctorImageURL: _doctor.doctorImageURL,
|
|
|
|
|
nationalityFlagURL: _doctor.nationalityFlagURL);
|
|
|
|
|
return DoctorView(
|
|
|
|
|
doctor: doctorList,
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
itemCount: _doctorList.length),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: _patientDoctorAppointmentList.length,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// todo 'sikander' remove this later
|
|
|
|
|
String getDoctorSpeciality(List<String> docSpecial) {
|
|
|
|
|
String docSpeciality = "";
|
|
|
|
|
docSpecial.forEach((v) {
|
|
|
|
|
@ -236,4 +106,3 @@ class AskDoctorPage extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|