|
|
|
@ -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/AppoimentAllHistoryResultList.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.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/models/header_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/new_design/doctor_header.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
@ -25,8 +29,9 @@ class AppointmentDetails extends StatefulWidget {
|
|
|
|
static bool isLoading = false;
|
|
|
|
static bool isLoading = false;
|
|
|
|
|
|
|
|
|
|
|
|
static bool showFooterButton = false;
|
|
|
|
static bool showFooterButton = false;
|
|
|
|
|
|
|
|
final int parentIndex;
|
|
|
|
|
|
|
|
|
|
|
|
AppointmentDetails({@required this.appo});
|
|
|
|
AppointmentDetails({@required this.appo, this.parentIndex});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_AppointmentDetailsState createState() => _AppointmentDetailsState();
|
|
|
|
_AppointmentDetailsState createState() => _AppointmentDetailsState();
|
|
|
|
@ -37,6 +42,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
|
|
|
|
|
|
|
|
List<DoctorRateDetails> doctorDetailsList = List();
|
|
|
|
List<DoctorRateDetails> doctorDetailsList = List();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ToDoCountProviderModel toDoProvider;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
_tabController = new TabController(length: 2, vsync: this);
|
|
|
|
_tabController = new TabController(length: 2, vsync: this);
|
|
|
|
@ -55,37 +62,17 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
appBarTitle: widget.appo.doctorNameObj,
|
|
|
|
appBarTitle: widget.appo.doctorNameObj,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
showNewAppBar: true,
|
|
|
|
showNewAppBar: true,
|
|
|
|
backgroundColor: Color(0xffF8F8F8),
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
bottomSheet: AppointmentDetails.showFooterButton
|
|
|
|
bottomSheet: _bottomButtons(),
|
|
|
|
? Container(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
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(),
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -212,6 +199,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.87,
|
|
|
|
height: MediaQuery.of(context).size.height * 0.87,
|
|
|
|
|
|
|
|
color: Color(0xffF8F8F8),
|
|
|
|
child: TabBarView(
|
|
|
|
child: TabBarView(
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -224,9 +212,84 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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() {
|
|
|
|
void enableFooterButton() {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -498,4 +561,54 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
void openSchedule() {
|
|
|
|
void openSchedule() {
|
|
|
|
Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject())));
|
|
|
|
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);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|