|
|
|
@ -4,15 +4,19 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/header_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/theme/colors.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/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.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';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
@ -31,11 +35,7 @@ class BookConfirm extends StatefulWidget {
|
|
|
|
|
String appoTimeFormatted = "";
|
|
|
|
|
bool isLiveCareAppointment;
|
|
|
|
|
|
|
|
|
|
BookConfirm(
|
|
|
|
|
{@required this.doctor,
|
|
|
|
|
@required this.selectedDate,
|
|
|
|
|
@required this.isLiveCareAppointment,
|
|
|
|
|
@required this.selectedTime});
|
|
|
|
|
BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime});
|
|
|
|
|
|
|
|
|
|
DoctorsListService service;
|
|
|
|
|
PatientShareResponse patientShareResponse;
|
|
|
|
@ -61,340 +61,184 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).bookAppo,
|
|
|
|
|
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
backgroundColor: CustomColors.appBackgroudGreyColor,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(20.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 5.0),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(TranslationBase.of(context).confirmAppoHeading,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22.0,
|
|
|
|
|
color: new Color(0xFF60686b),
|
|
|
|
|
letterSpacing: 0.9))),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey[400],
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
DoctorHeader(
|
|
|
|
|
headerModel: HeaderModel(
|
|
|
|
|
widget.doctor.name,
|
|
|
|
|
widget.doctor.doctorImageURL,
|
|
|
|
|
widget.doctor.speciality,
|
|
|
|
|
"",
|
|
|
|
|
widget.doctor.projectName,
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
widget.doctor.nationalityFlagURL,
|
|
|
|
|
widget.doctor.doctorRate,
|
|
|
|
|
null,
|
|
|
|
|
widget.doctor.noOfPatientsRate,
|
|
|
|
|
"",
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).docInfo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 0.9))),
|
|
|
|
|
Container(
|
|
|
|
|
child: Card(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
side: BorderSide(color: Colors.grey[400], width: 0.6)),
|
|
|
|
|
child: Container(
|
|
|
|
|
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.doctor.doctorImageURL,
|
|
|
|
|
fit: BoxFit.fill, height: 70.0, width: 70.0),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.58,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
isNeedToShowButton: false,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(20.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).confirmAppoHeading,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(20),
|
|
|
|
|
Card(
|
|
|
|
|
shape: cardRadius(12),
|
|
|
|
|
margin: EdgeInsets.zero,
|
|
|
|
|
elevation: 0,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).appoInfo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: -0.36,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(16),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
widget.doctor.doctorTitle +
|
|
|
|
|
"" +
|
|
|
|
|
widget.doctor.name,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 3.0),
|
|
|
|
|
child: Text(widget.doctor.clinicName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getDoctorSpeciality(
|
|
|
|
|
widget.doctor.speciality)
|
|
|
|
|
.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
|
|
|
|
|
.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,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (!widget.isLiveCareAppointment) showInfo(TranslationBase.of(context).hospital, widget.doctor.projectName),
|
|
|
|
|
showInfo(TranslationBase.of(context).clinic, widget.doctor.clinicName),
|
|
|
|
|
showInfo(TranslationBase.of(context).date, getDate()),
|
|
|
|
|
showInfo(TranslationBase.of(context).time, widget.selectedTime)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).appoInfo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 0.9))),
|
|
|
|
|
Container(
|
|
|
|
|
child: Card(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
side: BorderSide(color: Colors.grey[400], width: 0.6)),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(7.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
!widget.isLiveCareAppointment ? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/icon_hospital.png"),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).hospital +
|
|
|
|
|
": " +
|
|
|
|
|
widget.doctor.projectName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
) : Container(),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/icon_hospital.png"),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).clinic +
|
|
|
|
|
": " +
|
|
|
|
|
widget.doctor.clinicName,
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
mHeight(12),
|
|
|
|
|
Card(
|
|
|
|
|
shape: cardRadius(12),
|
|
|
|
|
elevation: 0,
|
|
|
|
|
margin: EdgeInsets.zero,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).patientInfo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: -0.36,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.today,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).date +
|
|
|
|
|
": " +
|
|
|
|
|
getDate(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.timer,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).time +
|
|
|
|
|
": " +
|
|
|
|
|
widget.selectedTime,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).patientInfo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 0.9))),
|
|
|
|
|
Container(
|
|
|
|
|
child: Card(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
side: BorderSide(color: Colors.grey[400], width: 0.6)),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(7.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/appointment_info.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
height: 60.0,
|
|
|
|
|
width: 60.0),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.58,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
),
|
|
|
|
|
mHeight(16),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
widget.authUser.firstName +
|
|
|
|
|
" " +
|
|
|
|
|
widget.authUser.lastName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.grey[900],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).gender +
|
|
|
|
|
": " +
|
|
|
|
|
widget.authUser.genderDescription,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).age +
|
|
|
|
|
": " +
|
|
|
|
|
widget.authUser.age.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
letterSpacing: 1.0)),
|
|
|
|
|
),
|
|
|
|
|
showInfo(TranslationBase.of(context).name, widget.authUser.firstName + " " + widget.authUser.lastName),
|
|
|
|
|
showInfo(TranslationBase.of(context).gender, widget.authUser.genderDescription),
|
|
|
|
|
showInfo(TranslationBase.of(context).age, widget.authUser.age.toString())
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 120.0,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 120.0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
height: 50.0,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
|
|
|
|
|
child: ButtonTheme(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
color: CustomColors.appBackgroudGreyColor,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: new Color(0xFF60686b),
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
disabledTextColor: Colors.white,
|
|
|
|
|
disabledColor: new Color(0xFFbcc2c4),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (!widget.isLiveCareAppointment) {
|
|
|
|
|
insertAppointment(context, widget.doctor);
|
|
|
|
|
} else {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).bookNow,
|
|
|
|
|
style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
margin: EdgeInsets.all(16),
|
|
|
|
|
child: ButtonTheme(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
height: 40.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color:CustomColors.green,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
disabledTextColor: Colors.white,
|
|
|
|
|
disabledColor: new Color(0xFFbcc2c4),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (!widget.isLiveCareAppointment) {
|
|
|
|
|
insertAppointment(context, widget.doctor);
|
|
|
|
|
} else {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0,letterSpacing: -0.48)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
|
|
|
|
|
BuildContext context) {
|
|
|
|
|
Widget showInfo(String title, String des) {
|
|
|
|
|
return Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
des,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
@ -420,23 +264,13 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
insertAppointment(context, DoctorList docObject) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
|
widget.service
|
|
|
|
|
.insertAppointment(
|
|
|
|
|
docObject.doctorID,
|
|
|
|
|
docObject.clinicID,
|
|
|
|
|
docObject.projectID,
|
|
|
|
|
widget.selectedTime,
|
|
|
|
|
widget.selectedDate,
|
|
|
|
|
context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
|
message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
|
print(res['AppointmentNo']);
|
|
|
|
|
|
|
|
|
|
Future.delayed(new Duration(milliseconds: 500), () {
|
|
|
|
|
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
|
|
|
|
|
docObject.projectID, docObject);
|
|
|
|
|
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
|
|
|
|
|
getToDoCount();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
@ -472,23 +306,13 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
|
widget.service
|
|
|
|
|
.insertLiveCareScheduleAppointment(
|
|
|
|
|
docObject.doctorID,
|
|
|
|
|
docObject.clinicID,
|
|
|
|
|
docObject.projectID,
|
|
|
|
|
docObject.serviceID,
|
|
|
|
|
widget.selectedTime,
|
|
|
|
|
widget.selectedDate,
|
|
|
|
|
context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
|
|
|
|
|
print(res['AppointmentNo']);
|
|
|
|
|
|
|
|
|
|
Future.delayed(new Duration(milliseconds: 500), () {
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'],
|
|
|
|
|
docObject.clinicID, docObject.projectID, docObject);
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
|
|
|
|
|
getToDoCount();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
@ -534,11 +358,8 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
|
|
|
|
|
DoctorList docObject) {
|
|
|
|
|
widget.service
|
|
|
|
|
.getPatientShare(appointmentNo, clinicID, projectID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
|
|
|
|
|
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
|
|
|
|
|
print(res);
|
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
|
|
|
|
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
|
|
|
|
@ -550,12 +371,8 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, String appointmentNo,
|
|
|
|
|
int clinicID, int projectID, DoctorList docObject) {
|
|
|
|
|
widget.service
|
|
|
|
|
.getLiveCareAppointmentPatientShare(
|
|
|
|
|
appointmentNo, clinicID, projectID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
|
|
|
|
|
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
|
|
|
|
|
print(res);
|
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
@ -578,23 +395,10 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getDate() {
|
|
|
|
|
var dateObj = new DateTime(
|
|
|
|
|
int.parse(widget.selectedDate.split("-")[0]),
|
|
|
|
|
int.parse(widget.selectedDate.split("-")[1]),
|
|
|
|
|
int.parse(widget.selectedDate.split("-")[2]),
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
0);
|
|
|
|
|
var dateObj = new DateTime(int.parse(widget.selectedDate.split("-")[0]), int.parse(widget.selectedDate.split("-")[1]), int.parse(widget.selectedDate.split("-")[2]), 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
|
|
|
|
|
", " +
|
|
|
|
|
dateObj.day.toString() +
|
|
|
|
|
" " +
|
|
|
|
|
DateUtil.getMonth(dateObj.month) +
|
|
|
|
|
" " +
|
|
|
|
|
dateObj.year.toString();
|
|
|
|
|
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return widget.appoDateFormatted;
|
|
|
|
@ -611,8 +415,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
getPatientData() async {
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
if (await sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
var data =
|
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
setState(() {
|
|
|
|
|
print(data);
|
|
|
|
|
widget.authUser = data;
|
|
|
|
@ -624,16 +427,9 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
Navigator.of(context).popAndPushNamed(HOME);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToBookSuccess(context, DoctorList docObject,
|
|
|
|
|
PatientShareResponse patientShareResponse) async {
|
|
|
|
|
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: BookSuccess(
|
|
|
|
|
docObject: docObject,
|
|
|
|
|
patientShareResponse: patientShareResponse,
|
|
|
|
|
appoDateFormatted: widget.appoDateFormatted,
|
|
|
|
|
appoTimeFormatted: widget.selectedTime)));
|
|
|
|
|
context, FadePage(page: BookSuccess(docObject: docObject, patientShareResponse: patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.selectedTime)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|