|
|
|
|
@ -2,14 +2,18 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/header_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
|
|
|
|
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/buttons/defaultButton.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
@ -25,8 +29,9 @@ class AppointmentDetails extends StatefulWidget {
|
|
|
|
|
static bool isLoading = false;
|
|
|
|
|
|
|
|
|
|
static bool showFooterButton = false;
|
|
|
|
|
final int parentIndex;
|
|
|
|
|
|
|
|
|
|
AppointmentDetails({@required this.appo});
|
|
|
|
|
AppointmentDetails({@required this.appo, this.parentIndex});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_AppointmentDetailsState createState() => _AppointmentDetailsState();
|
|
|
|
|
@ -37,6 +42,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
|
|
|
|
|
|
List<DoctorRateDetails> doctorDetailsList = List();
|
|
|
|
|
|
|
|
|
|
ToDoCountProviderModel toDoProvider;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_tabController = new TabController(length: 2, vsync: this);
|
|
|
|
|
@ -55,179 +62,235 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: widget.appo.doctorNameObj,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
backgroundColor: Color(0xffF8F8F8),
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
bottomSheet: AppointmentDetails.showFooterButton
|
|
|
|
|
? Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
height: 50.0,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
|
|
|
|
|
child: 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: goToBookConfirm,
|
|
|
|
|
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
body: Container(
|
|
|
|
|
color: new Color(0xFFf8f8f8),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 20.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: ClipRRect(
|
|
|
|
|
// borderRadius: BorderRadius.circular(100.0),
|
|
|
|
|
// child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child:
|
|
|
|
|
// Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), 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: widget.appo.actualDoctorRate.toDouble(),
|
|
|
|
|
// size: 35.0,
|
|
|
|
|
// filledColor: Colors.yellow[700],
|
|
|
|
|
// emptyColor: Colors.grey[500],
|
|
|
|
|
// isHalfAllowed: true,
|
|
|
|
|
// halfFilledIcon: Icons.star_half,
|
|
|
|
|
// filledIcon: Icons.star,
|
|
|
|
|
// emptyIcon: Icons.star,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// getDoctorRatingsDetails();
|
|
|
|
|
// },
|
|
|
|
|
// child: Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")",
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 14.0,
|
|
|
|
|
// color: Colors.blue[800],
|
|
|
|
|
// letterSpacing: 1.0,
|
|
|
|
|
// decoration: TextDecoration.underline,
|
|
|
|
|
// )),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text(widget.appo.startTime.substring(0, 5)),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
// child: Divider(
|
|
|
|
|
// color: Colors.grey[500],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
DoctorHeader(
|
|
|
|
|
headerModel: HeaderModel(
|
|
|
|
|
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
|
|
|
|
|
widget.appo.doctorImageURL,
|
|
|
|
|
widget.appo.doctorSpeciality,
|
|
|
|
|
"",
|
|
|
|
|
widget.appo.projectName,
|
|
|
|
|
DateUtil.convertStringToDate(widget.appo.appointmentDate),
|
|
|
|
|
widget.appo.startTime.substring(0, 5),
|
|
|
|
|
null,
|
|
|
|
|
widget.appo.doctorRate,
|
|
|
|
|
widget.appo.actualDoctorRate,
|
|
|
|
|
widget.appo.noOfPatientsRate,
|
|
|
|
|
"",
|
|
|
|
|
//model.user.emailAddress,
|
|
|
|
|
),
|
|
|
|
|
isNeedToShowButton: _tabController.index == 1,
|
|
|
|
|
buttonTitle: TranslationBase.of(context).schedule,
|
|
|
|
|
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
|
|
|
|
|
showConfirmMessageDialog: false,
|
|
|
|
|
onRatingAndReviewTap: getDoctorRatingsDetails,
|
|
|
|
|
onTap: () {},
|
|
|
|
|
bottomSheet: _bottomButtons(),
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 20.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: ClipRRect(
|
|
|
|
|
// borderRadius: BorderRadius.circular(100.0),
|
|
|
|
|
// child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child:
|
|
|
|
|
// Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), 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: widget.appo.actualDoctorRate.toDouble(),
|
|
|
|
|
// size: 35.0,
|
|
|
|
|
// filledColor: Colors.yellow[700],
|
|
|
|
|
// emptyColor: Colors.grey[500],
|
|
|
|
|
// isHalfAllowed: true,
|
|
|
|
|
// halfFilledIcon: Icons.star_half,
|
|
|
|
|
// filledIcon: Icons.star,
|
|
|
|
|
// emptyIcon: Icons.star,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// getDoctorRatingsDetails();
|
|
|
|
|
// },
|
|
|
|
|
// child: Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")",
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 14.0,
|
|
|
|
|
// color: Colors.blue[800],
|
|
|
|
|
// letterSpacing: 1.0,
|
|
|
|
|
// decoration: TextDecoration.underline,
|
|
|
|
|
// )),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
// child: Text(widget.appo.startTime.substring(0, 5)),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
// child: Divider(
|
|
|
|
|
// color: Colors.grey[500],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
DoctorHeader(
|
|
|
|
|
headerModel: HeaderModel(
|
|
|
|
|
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
|
|
|
|
|
widget.appo.doctorImageURL,
|
|
|
|
|
widget.appo.doctorSpeciality,
|
|
|
|
|
"",
|
|
|
|
|
widget.appo.projectName,
|
|
|
|
|
DateUtil.convertStringToDate(widget.appo.appointmentDate),
|
|
|
|
|
widget.appo.startTime.substring(0, 5),
|
|
|
|
|
null,
|
|
|
|
|
widget.appo.doctorRate,
|
|
|
|
|
widget.appo.actualDoctorRate,
|
|
|
|
|
widget.appo.noOfPatientsRate,
|
|
|
|
|
"",
|
|
|
|
|
//model.user.emailAddress,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
TabBar(
|
|
|
|
|
onTap: (index) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) {
|
|
|
|
|
_tabController.index = _tabController.previousIndex;
|
|
|
|
|
AppointmentDetails.showFooterButton = false;
|
|
|
|
|
} else {
|
|
|
|
|
AppointmentDetails.showFooterButton = true;
|
|
|
|
|
}
|
|
|
|
|
isNeedToShowButton: _tabController.index == 1,
|
|
|
|
|
buttonTitle: TranslationBase.of(context).schedule,
|
|
|
|
|
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
|
|
|
|
|
showConfirmMessageDialog: false,
|
|
|
|
|
onRatingAndReviewTap: getDoctorRatingsDetails,
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
TabBar(
|
|
|
|
|
onTap: (index) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) {
|
|
|
|
|
_tabController.index = _tabController.previousIndex;
|
|
|
|
|
AppointmentDetails.showFooterButton = false;
|
|
|
|
|
} else {
|
|
|
|
|
AppointmentDetails.showFooterButton = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
tabs: [
|
|
|
|
|
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
|
|
|
|
|
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor
|
|
|
|
|
? Tab(
|
|
|
|
|
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
|
|
|
|
|
)
|
|
|
|
|
: Tab(
|
|
|
|
|
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
tabs: [
|
|
|
|
|
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
|
|
|
|
|
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor
|
|
|
|
|
? Tab(
|
|
|
|
|
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
|
|
|
|
|
)
|
|
|
|
|
: Tab(
|
|
|
|
|
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.87,
|
|
|
|
|
child: TabBarView(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
children: [
|
|
|
|
|
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton),
|
|
|
|
|
DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment)
|
|
|
|
|
],
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.87,
|
|
|
|
|
color: Color(0xffF8F8F8),
|
|
|
|
|
child: TabBarView(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
children: [
|
|
|
|
|
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton),
|
|
|
|
|
DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment)
|
|
|
|
|
],
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _bottomButtons() {
|
|
|
|
|
if (widget.parentIndex == null) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
List<Widget> list = [];
|
|
|
|
|
if (widget.parentIndex == 0 && _tabController.index == 0) {
|
|
|
|
|
list.add(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).cancel,
|
|
|
|
|
() {
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: cancelAppointment,
|
|
|
|
|
cancelFunction: () => {});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
},
|
|
|
|
|
color: Color(0xffEAEAEA),
|
|
|
|
|
textColor: Color(0xff000000),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
list.add(
|
|
|
|
|
SizedBox(width: 8),
|
|
|
|
|
);
|
|
|
|
|
list.add(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).confirm,
|
|
|
|
|
confirmAppointment,
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else if (widget.parentIndex == 1 && _tabController.index == 0) {
|
|
|
|
|
list.add(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).cancel,
|
|
|
|
|
() => {
|
|
|
|
|
// Navigator.of(context).push(FadePage(page: Register())),
|
|
|
|
|
},
|
|
|
|
|
color: Color(0xffEAEAEA),
|
|
|
|
|
textColor: Color(0xff000000),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else if (_tabController.index == 1) {
|
|
|
|
|
list.add(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).bookNow,
|
|
|
|
|
DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null,
|
|
|
|
|
color: Color(0xFFD02127),
|
|
|
|
|
disabledColor: Color(0xff28323A).withOpacity(0.3),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if (list.isEmpty) {
|
|
|
|
|
return null;
|
|
|
|
|
} else
|
|
|
|
|
return Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: list,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void enableFooterButton() {
|
|
|
|
|
setState(() {
|
|
|
|
|
AppointmentDetails.showFooterButton = true;
|
|
|
|
|
@ -498,4 +561,54 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
|
void openSchedule() {
|
|
|
|
|
Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
confirmAppointment() {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelAppointment() {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.cancelAppointment(widget.appo, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(res);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
getToDoCount();
|
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getToDoCount() {
|
|
|
|
|
toDoProvider.setState(0, true);
|
|
|
|
|
ClinicListService service = new ClinicListService();
|
|
|
|
|
service.getActiveAppointmentNo(context).then((res) {
|
|
|
|
|
print(res['AppointmentActiveNumber']);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
toDoProvider.setState(res['AppointmentActiveNumber'], true);
|
|
|
|
|
} else {}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|