My Appointments implemented, Appointment Details functionality updated, Logged In User details added in APIs & other updates
parent
1c3e088515
commit
28fde5c500
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,297 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class QRCode extends StatefulWidget {
|
||||
PatientShareResponse patientShareResponse;
|
||||
String appoQR;
|
||||
AuthenticatedUser authUser;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
QRCode({@required this.patientShareResponse, @required this.appoQR});
|
||||
|
||||
@override
|
||||
_QRCodeState createState() => _QRCodeState();
|
||||
}
|
||||
|
||||
class _QRCodeState extends State<QRCode> {
|
||||
Uint8List _bytes;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
_bytes = base64.decode(widget.appoQR.split(',').last);
|
||||
widget.authUser = new AuthenticatedUser();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).attendRegisterCode,
|
||||
isShowAppBar: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 30.0),
|
||||
alignment: Alignment.center,
|
||||
child: Image.memory(_bytes, scale: 0.5),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Colors.red[700],
|
||||
thickness: 0.8,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/device_icon.png",
|
||||
width: 120.0,
|
||||
height: 120.0),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.5,
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(TranslationBase.of(context).scanQRHospital,
|
||||
style: TextStyle(
|
||||
color: Colors.red[700],
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Colors.red[700],
|
||||
thickness: 0.8,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(TranslationBase.of(context).appoInfo,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
color: Colors.grey[700],
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0, bottom: 20.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.grey[200],
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.grey, spreadRadius: 2),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(widget.patientShareResponse.doctorNameObj,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
color: Colors.grey[700],
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(
|
||||
getDoctorSpeciality(
|
||||
widget.patientShareResponse.doctorSpeciality),
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(widget.patientShareResponse.projectName,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(
|
||||
getDate(widget.patientShareResponse.appointmentDate),
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
ButtonTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
minWidth: MediaQuery.of(context).size.width * 0.7,
|
||||
height: 45.0,
|
||||
child: RaisedButton(
|
||||
color: new Color(0xFF60686b),
|
||||
textColor: Colors.white,
|
||||
disabledTextColor: Colors.white,
|
||||
disabledColor: new Color(0xFFbcc2c4),
|
||||
onPressed: () {
|
||||
// navigateToQR(context);
|
||||
// getAppoQR(context);
|
||||
sendEmail();
|
||||
},
|
||||
child: Text(
|
||||
TranslationBase.of(context).sendEmail.toUpperCase(),
|
||||
style: TextStyle(fontSize: 18.0)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
height: MediaQuery.of(context).size.height * 0.1,
|
||||
margin: EdgeInsets.only(bottom: 20.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
ButtonTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
minWidth: MediaQuery.of(context).size.width * 0.7,
|
||||
height: 45.0,
|
||||
child: RaisedButton(
|
||||
color: new Color(0xFF60686b),
|
||||
textColor: Colors.white,
|
||||
disabledTextColor: Colors.white,
|
||||
disabledColor: new Color(0xFFbcc2c4),
|
||||
onPressed: () {
|
||||
navigateToHome(context);
|
||||
},
|
||||
child: Text(
|
||||
TranslationBase.of(context).close.toUpperCase(),
|
||||
style: TextStyle(fontSize: 18.0)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
sendEmail() async {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
|
||||
if (await widget.sharedPref.getObject(USER_PROFILE) != null) {
|
||||
var data = AuthenticatedUser.fromJson(
|
||||
await widget.sharedPref.getObject(USER_PROFILE));
|
||||
setState(() {
|
||||
widget.authUser = data;
|
||||
});
|
||||
}
|
||||
|
||||
ConfirmDialog dialog = new ConfirmDialog(
|
||||
context: context,
|
||||
confirmMessage: "Send a copy of this QR to the email " +
|
||||
widget.authUser.emailAddress +
|
||||
"?",
|
||||
okText: TranslationBase.of(context).confirm,
|
||||
cancelText: TranslationBase.of(context).cancel_nocaps,
|
||||
okFunction: () {
|
||||
service
|
||||
.sendAppointmentQREmail(
|
||||
widget.authUser.emailAddress,
|
||||
widget.patientShareResponse.appointmentDate,
|
||||
widget.patientShareResponse.appointmentNo.toString(),
|
||||
widget.patientShareResponse.doctorNameObj,
|
||||
widget.patientShareResponse.projectName,
|
||||
widget.appoQR,
|
||||
getDoctorSpeciality(
|
||||
widget.patientShareResponse.doctorSpeciality),
|
||||
context)
|
||||
.then((res) {
|
||||
print(res);
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
}).catchError((err) {
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
AppToast.showErrorToast(message: err);
|
||||
print(err);
|
||||
});
|
||||
},
|
||||
cancelFunction: () => {});
|
||||
dialog.showAlertDialog(context);
|
||||
}
|
||||
|
||||
Future navigateToHome(context) async {
|
||||
Navigator.of(context).pushNamed(HOME);
|
||||
}
|
||||
|
||||
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
|
||||
DoctorList docObject) {}
|
||||
|
||||
String getDate(String appoDate) {
|
||||
var appoDateFormatted = "";
|
||||
|
||||
var dateObj = DateUtil.convertStringToDate(appoDate);
|
||||
|
||||
setState(() {
|
||||
appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString() +
|
||||
", " +
|
||||
dateObj.hour.toString() +
|
||||
":" +
|
||||
dateObj.minute.toString() +
|
||||
":00";
|
||||
});
|
||||
|
||||
return appoDateFormatted;
|
||||
}
|
||||
|
||||
String getDoctorSpeciality(List<String> docSpecial) {
|
||||
String docSpeciality = "";
|
||||
docSpecial.forEach((v) {
|
||||
docSpeciality = docSpeciality + v + "\n";
|
||||
});
|
||||
return docSpeciality;
|
||||
}
|
||||
}
|
@ -0,0 +1,243 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyAppointments extends StatefulWidget {
|
||||
List<AppoitmentAllHistoryResultList> appoList = [];
|
||||
|
||||
List<AppoitmentAllHistoryResultList> bookedAppoList = [];
|
||||
List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
|
||||
List<AppoitmentAllHistoryResultList> arrivedAppoList = [];
|
||||
|
||||
@override
|
||||
_MyAppointmentsState createState() => _MyAppointmentsState();
|
||||
}
|
||||
|
||||
class _MyAppointmentsState extends State<MyAppointments>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
bool isDataLoaded = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_tabController = new TabController(length: 3, vsync: this);
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) => getPatientAppointmentHistory());
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "My Appointments",
|
||||
isShowAppBar: true,
|
||||
body: Container(
|
||||
child: Column(children: [
|
||||
/// this is will not colored with theme data
|
||||
TabBar(
|
||||
tabs: [
|
||||
Tab(text: TranslationBase.of(context).booked),
|
||||
Tab(text: TranslationBase.of(context).confirmed),
|
||||
Tab(text: TranslationBase.of(context).arrived),
|
||||
],
|
||||
controller: _tabController,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey[600],
|
||||
thickness: 0.5,
|
||||
),
|
||||
Expanded(
|
||||
child: new TabBarView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
isDataLoaded ? getBookedAppointments() : Container(),
|
||||
isDataLoaded ? getConfirmedAppointments() : Container(),
|
||||
isDataLoaded ? getArrivedAppointments() : Container()
|
||||
],
|
||||
controller: _tabController,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getPatientAppointmentHistory() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
widget.appoList.clear();
|
||||
widget.bookedAppoList.clear();
|
||||
widget.confirmedAppoList.clear();
|
||||
widget.arrivedAppoList.clear();
|
||||
service.getPatientAppointmentHistory(false, context).then((res) {
|
||||
print(res['AppoimentAllHistoryResultList'].length);
|
||||
if (res['MessageStatus'] == 1) {
|
||||
setState(() {
|
||||
if (res['AppoimentAllHistoryResultList'].length != 0) {
|
||||
res['AppoimentAllHistoryResultList'].forEach((v) {
|
||||
widget.appoList
|
||||
.add(new AppoitmentAllHistoryResultList.fromJson(v));
|
||||
});
|
||||
sortAppointmentList();
|
||||
openAppointmentsTab();
|
||||
isDataLoaded = true;
|
||||
} else {}
|
||||
});
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
bool isConfirmed(AppoitmentAllHistoryResultList appo) {
|
||||
return AppointmentType.isConfirmed(appo);
|
||||
}
|
||||
|
||||
bool isArrived(AppoitmentAllHistoryResultList appo) {
|
||||
return AppointmentType.isArrived(appo);
|
||||
}
|
||||
|
||||
bool isBooked(AppoitmentAllHistoryResultList appo) {
|
||||
return AppointmentType.isBooked(appo);
|
||||
}
|
||||
|
||||
sortAppointmentList() {
|
||||
widget.appoList.forEach((v) {
|
||||
if (isBooked(v)) {
|
||||
widget.bookedAppoList.add(v);
|
||||
}
|
||||
|
||||
if (isConfirmed(v)) {
|
||||
widget.confirmedAppoList.add(v);
|
||||
}
|
||||
|
||||
if (isArrived(v)) {
|
||||
widget.arrivedAppoList.add(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openAppointmentsTab() {
|
||||
if (widget.bookedAppoList.length != 0) {
|
||||
_tabController.animateTo((_tabController.index + 1) % 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (widget.confirmedAppoList.length != 0) {
|
||||
_tabController.animateTo((_tabController.index + 1) % 2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (widget.arrivedAppoList.length != 0) {
|
||||
_tabController.animateTo((_tabController.index + 1) % 3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Widget getBookedAppointments() {
|
||||
return Container(
|
||||
child: widget.bookedAppoList.length != 0
|
||||
? new ListView.builder(
|
||||
itemCount: widget.bookedAppoList.length,
|
||||
itemBuilder: (context, i) {
|
||||
return AppointmentCard(
|
||||
appo: widget.bookedAppoList[i],
|
||||
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
||||
);
|
||||
},
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
"assets/images/new-design/noAppointmentIcon.png"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
child: Text("No Booked Appointments",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getConfirmedAppointments() {
|
||||
return widget.confirmedAppoList.length != 0
|
||||
? Container(
|
||||
child: new ListView.builder(
|
||||
itemCount: widget.confirmedAppoList.length,
|
||||
itemBuilder: (context, i) {
|
||||
return AppointmentCard(
|
||||
appo: widget.confirmedAppoList[i],
|
||||
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
child: Text("No Confirmed Appointments",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getArrivedAppointments() {
|
||||
return widget.arrivedAppoList.length != 0
|
||||
? Container(
|
||||
child: new ListView.builder(
|
||||
itemCount: widget.arrivedAppoList.length,
|
||||
itemBuilder: (context, i) {
|
||||
return AppointmentCard(
|
||||
appo: widget.arrivedAppoList[i],
|
||||
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
child: Text("No Arrived Appointments",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rating_bar/rating_bar.dart';
|
||||
|
||||
import '../AppointmentDetails.dart';
|
||||
|
||||
class AppointmentCard extends StatefulWidget {
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
final Function onReloadAppointmentHistory;
|
||||
|
||||
AppointmentCard(
|
||||
{@required this.appo, @required this.onReloadAppointmentHistory});
|
||||
|
||||
@override
|
||||
_ApointmentCardState createState() => _ApointmentCardState();
|
||||
}
|
||||
|
||||
class _ApointmentCardState extends State<AppointmentCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
navigateToAppointmentDetails(context, widget.appo);
|
||||
},
|
||||
child: Card(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.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>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
child: Image.network(widget.appo.doctorImageURL,
|
||||
fit: BoxFit.fill, height: 60.0, width: 60.0),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.666,
|
||||
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.appo.doctorTitle +
|
||||
" " +
|
||||
widget.appo.doctorNameObj,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.grey[700],
|
||||
letterSpacing: 1.0)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 3.0),
|
||||
child: Text(widget.appo.clinicName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey[600],
|
||||
letterSpacing: 1.0)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 3.0),
|
||||
child: Text(widget.appo.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(getDate(widget.appo.appointmentDate).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:
|
||||
widget.appo.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(
|
||||
transform: Matrix4.translationValues(0.0, -40.0, 0.0),
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/arrow.png",
|
||||
width: 25.0,
|
||||
height: 25.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getDate(String date) {
|
||||
DateTime dateObj = DateUtil.convertStringToDate(date);
|
||||
return DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString();
|
||||
}
|
||||
|
||||
String getDoctorSpeciality(List<String> docSpecial) {
|
||||
String docSpeciality = "";
|
||||
docSpecial.forEach((v) {
|
||||
docSpeciality = docSpeciality + v + "\n";
|
||||
});
|
||||
return docSpeciality;
|
||||
}
|
||||
|
||||
Future navigateToAppointmentDetails(context, appo) async {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AppointmentDetails(appo: appo)))
|
||||
.then((value) {
|
||||
widget.onReloadAppointmentHistory();
|
||||
});
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Loading…
Reference in New Issue