Merge remote-tracking branch 'origin/development_new_design_2.0' into development_new_design_2.0

merge-requests/400/merge
Sikander Saleem 5 years ago
commit aff7b25566

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

@ -12,7 +12,6 @@ class ActiveMedicationsService extends BaseService{
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['PatientID'] = 1298851; body['PatientID'] = 1298851;
body['TokenID'] = "@dm!n";
await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
activePrescriptionReport.clear(); activePrescriptionReport.clear();

@ -102,50 +102,51 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
return mDivider(Colors.grey); return mDivider(Colors.grey);
}, },
itemCount: widget.model.cmcAllServicesList.length), itemCount: widget.model.cmcAllServicesList.length),
Card( Image.asset(projectViewModel.isArabic?"assets/images/cc_ar.png":"assets/images/cc_en.png",width: double.infinity,),
shape: cardRadius(12), // Card(
elevation: 4, // shape: cardRadius(12),
child: Container( // elevation: 4,
width: double.infinity, // child: Container(
child: Column( // width: double.infinity,
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
Padding( // children: [
padding: const EdgeInsets.only(left: 12, right: 12, top: 12), // Padding(
child: Text( // padding: const EdgeInsets.only(left: 12, right: 12, top: 12),
TranslationBase.of(context).coveredService, // child: Text(
style: TextStyle( // TranslationBase.of(context).coveredService,
fontSize: 14, // style: TextStyle(
fontWeight: FontWeight.w600, // fontSize: 14,
letterSpacing: -0.45, // fontWeight: FontWeight.w600,
), // letterSpacing: -0.45,
), // ),
), // ),
ListView.separated( // ),
itemBuilder: (context, index) { // ListView.separated(
return Padding( // itemBuilder: (context, index) {
padding: const EdgeInsets.all(12.0), // return Padding(
child: Text( // padding: const EdgeInsets.all(12.0),
widget.model.checkupItems[index].itemName, // child: Text(
style: TextStyle( // widget.model.checkupItems[index].itemName,
fontSize: 12, // style: TextStyle(
fontWeight: FontWeight.w600, // fontSize: 12,
letterSpacing: -0.45, // fontWeight: FontWeight.w600,
), // letterSpacing: -0.45,
), // ),
); // ),
}, // );
separatorBuilder: (context, index) { // },
return mDivider(Colors.grey); // separatorBuilder: (context, index) {
}, // return mDivider(Colors.grey);
physics: NeverScrollableScrollPhysics(), // },
shrinkWrap: true, // physics: NeverScrollableScrollPhysics(),
itemCount: widget.model.checkupItems.length, // shrinkWrap: true,
), // itemCount: widget.model.checkupItems.length,
], // ),
), // ],
), // ),
), // ),
// ),
], ],
), ),
), ),

@ -480,7 +480,11 @@ class _BookSuccessState extends State<BookSuccess> {
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
setState(() {});
}
))).then((value) {
if (value != null) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
} }

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.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/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -15,7 +17,6 @@ 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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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';
@ -66,7 +67,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
ScrollController _scrollController; ScrollController _scrollController;
ProjectViewModel projectViewModel; ToDoCountProviderModel toDoProvider;
@override @override
void initState() { void initState() {
@ -119,203 +120,211 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGrey2Color,
child: Container( body: Column(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), children: [
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: SingleChildScrollView(
children: <Widget>[ child: Container(
Container( margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
height: 150.0,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill,
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
),
],
),
],
),
),
Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
_buildTableCalendarWithBuilders(projectViewModel),
Padding(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
),
Container( Container(
height: 40, child: Column(
child: ListView.builder( crossAxisAlignment: CrossAxisAlignment.start,
controller: _scrollController, mainAxisSize: MainAxisSize.max,
scrollDirection: Axis.horizontal, children: <Widget>[
itemCount: dayEvents.length, Text(
itemBuilder: (context, index) { TranslationBase.of(context).selectAppo,
return Container( style: TextStyle(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5), color: Colors.black,
child: ButtonTheme( fontSize: 16.0,
shape: RoundedRectangleBorder( letterSpacing: -0.64,
borderRadius: BorderRadius.circular(5.0), fontWeight: FontWeight.w600,
side: BorderSide( ),
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border ),
style: BorderStyle.solid, //Style of the border Card(
width: 1.5, //width of the border shape: cardRadius(12),
), child: _buildTableCalendarWithBuilders(projectViewModel),
), ),
minWidth: MediaQuery.of(context).size.width * 0.18, mHeight(12),
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)), Text(
); selectedDate,
}, style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mHeight(8),
Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
),
],
), ),
), ),
SizedBox(
height: 100.0,
),
], ],
), ),
), ),
SizedBox( ),
height: 10.0, ),
), Card(
if (CovidTimeSlots.areSlotsAvailable) elevation: 20,
Container( margin: EdgeInsets.zero,
color: Colors.grey[100], shape: cardRadius(0),
margin: EdgeInsets.all(10.0), child: Container(
child: DefaultButton( width: double.infinity,
TranslationBase.of(context).bookNow, padding: EdgeInsets.all(12),
() { child: ButtonTheme(
bookCovidTestAppointment(); shape: RoundedRectangleBorder(
}, borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: CustomColors.green,
textColor: Colors.white,
disabledTextColor: Colors.white,
elevation: 0,
disabledColor: Colors.grey[500],
onPressed: () {
bookCovidTestAppointment();
},
child: Text(
TranslationBase.of(context).bookAppo,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
),
), ),
), ),
], ),
), ),
), )
],
), ),
); );
} }
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) { Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return Card( return TableCalendar(
shape: cardRadius(12), locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
margin: EdgeInsets.all(16), calendarController: _calendarController,
clipBehavior: Clip.antiAlias, events: _events,
child: Padding( initialCalendarFormat: CalendarFormat.month,
padding: const EdgeInsets.only(bottom: 12), startDay: DateTime.now(),
child: TableCalendar( formatAnimation: FormatAnimation.slide,
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US', startingDayOfWeek: StartingDayOfWeek.sunday,
calendarController: _calendarController, weekendDays: [DateTime.friday, DateTime.saturday],
events: _events, availableGestures: AvailableGestures.horizontalSwipe,
initialCalendarFormat: CalendarFormat.month, availableCalendarFormats: const {
startDay: DateTime.now(), CalendarFormat.month: '',
formatAnimation: FormatAnimation.slide, CalendarFormat.week: '',
startingDayOfWeek: StartingDayOfWeek.sunday, },
weekendDays: [DateTime.friday, DateTime.saturday], calendarStyle: CalendarStyle(
availableGestures: AvailableGestures.horizontalSwipe, outsideDaysVisible: false,
availableCalendarFormats: const { weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
CalendarFormat.month: '', holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
CalendarFormat.week: '', ),
}, daysOfWeekStyle: DaysOfWeekStyle(
calendarStyle: CalendarStyle( weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
outsideDaysVisible: false, weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), ),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
), builders: CalendarBuilders(
daysOfWeekStyle: DaysOfWeekStyle( selectedDayBuilder: (context, date, _) {
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600), return FadeTransition(
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600), opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
), child: Container(
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)), margin: const EdgeInsets.all(4.0),
builders: CalendarBuilders( padding: const EdgeInsets.only(top: 5.0, left: 6.0),
selectedDayBuilder: (context, date, _) { color: Colors.transparent,
return FadeTransition( width: 0,
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), height: 0,
child: Container( child: Text(
margin: const EdgeInsets.all(4.0), '${date.day}',
padding: const EdgeInsets.only(top: 5.0, left: 5.0), style: TextStyle().copyWith(fontSize: 14.0),
color: Colors.transparent, ),
width: 0, ),
height: 0, );
child: Text( },
'${date.day}', todayDayBuilder: (context, date, _) {
style: TextStyle().copyWith(fontSize: 14.0), return Container(
), decoration: BoxDecoration(
), shape: BoxShape.circle,
); color: _calendarController.isSelected(date)
}, ? Colors.green[400]
todayDayBuilder: (context, date, _) { : _calendarController.isToday(date)
return Container( ? Colors.transparent
decoration: BoxDecoration( : Color(0xff76cfb7),
shape: BoxShape.circle, ),
color: _calendarController.isSelected(date) width: 40.0,
? Colors.green[400] height: 40.0,
: _calendarController.isToday(date) child: Center(
? Colors.transparent child: Text(
: Color(0xff76cfb7), '${date.day}',
), style: TextStyle().copyWith(
width: 40.0, color: Colors.white,
height: 40.0, fontSize: 14.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
), ),
); ),
}, ),
markersBuilder: (context, date, events, holidays) { );
final children = <Widget>[]; },
markersBuilder: (context, date, events, holidays) {
if (events.isNotEmpty) { final children = <Widget>[];
children.add(
Positioned( if (events.isNotEmpty) {
right: 4, children.add(
bottom: 4, Positioned(
child: _buildEventsMarker(date, events), right: 4,
), bottom: 4,
); child: _buildEventsMarker(date, events),
} ),
);
}
return children; return children;
}, },
),
onDaySelected: (date, event, _) {
_onDaySelected(date, event, projectViewModel);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
),
), ),
onDaySelected: (date, event, _) {
_onDaySelected(date, event, projectViewModel);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
); );
} }
@ -353,7 +362,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() { setState(() {
CovidTimeSlots.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); CovidTimeSlots.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']), projectViewModel.isArabic ? "ar" : "en"); selectedDate = DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
}); });
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
@ -363,12 +372,21 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
Widget _buildEventsMarker(DateTime date, List events) { Widget _buildEventsMarker(DateTime date, List events) {
return Container( return Container(
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: _calendarController.isSelected(date)
// ? Colors.green[400]
// : _calendarController.isToday(date)
// ? Colors.brown[300]
// : Colors.blue[400],
// ),
decoration: containerColorRadiusBorderWidth( decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date) _calendarController.isSelected(date)
? CustomColors.green ? CustomColors.green
: _calendarController.isToday(date) : _calendarController.isToday(date)
? CustomColors.green.withOpacity(0.5) ? CustomColors.green.withOpacity(0.5)
: Colors.white, : Colors.white,
200, 200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black, _calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2), 2),
@ -379,7 +397,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
'${date.day}', '${date.day}',
style: TextStyle().copyWith( style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black, color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 14.0, fontSize: 13.0,
), ),
), ),
), ),
@ -395,53 +413,35 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime; CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
print(CovidTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)), child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)),
); );
} }
Widget getSelectedButton(int index) { Widget getSelectedButton(int index) {
return RaisedButton( return RaisedButton(
color: CustomColors.green, color: CustomColors.green, //Color of the border
//Color of the border
textColor: Colors.white, textColor: Colors.white,
elevation: 0,
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime; CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
print(CovidTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)), child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)),
); );
} }
bookCovidTestAppointment() { bookCovidTestAppointment() {
var messageEn = "This Appointment is being booked for patient " + GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.user.firstName + DoctorList docObject = new DoctorList();
" " + docObject.doctorID = widget.selectedDoctorID;
projectViewModel.user.lastName + docObject.clinicID = widget.selectedClinicID;
", Having file number " + docObject.projectID = widget.projectID;
projectViewModel.user.patientID.toString() + insertAppointmentCovidTest(context, docObject);
". Please confirm!";
var messageAr =
"يتم حجز هذا الموعد المراجع " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName + ", وجود رقم الملف " + projectViewModel.user.patientID.toString() + ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: projectViewModel.isArabic ? messageAr : messageEn,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
} }
insertAppointmentCovidTest(context, DoctorList docObject) { insertAppointmentCovidTest(context, DoctorList docObject) {
@ -452,6 +452,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: "Appointment Booked Successfully");
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -483,13 +484,28 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}); });
} }
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);
});
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
// });
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -522,26 +538,24 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getCovidFreeSlots(BuildContext context, int projectID) { getCovidFreeSlots(BuildContext context, int projectID) {
CovidTimeSlots.areSlotsAvailable = false;
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidFreeSlots(context, projectID).then((res) { service.getCovidFreeSlots(context, projectID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) { if (res['COVID19_FreeTimeSlots'].length != 0) {
CovidTimeSlots.areSlotsAvailable = true;
freeSlotsResponse = res['COVID19_FreeTimeSlots']; freeSlotsResponse = res['COVID19_FreeTimeSlots'];
_getJSONSlots().then((value) => { _getJSONSlots().then((value) => {
setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value}) setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
}); });
} else { } else {}
CovidTimeSlots.areSlotsAvailable = false;
}
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err.toString());
print(err); print(err);
}); });
} }

@ -5,10 +5,11 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoRespo
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils_new.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';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -29,7 +30,6 @@ class CovidDirveThruQuestions extends StatefulWidget {
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> { class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa; List qa;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -37,91 +37,212 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson(); qa = getQuestionsFromJson();
} }
TranslationBase localize;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context);
var isArabic = localize.isArabic();
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var isArabic = projectViewModel.isArabic;
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15.0),
),
margin: EdgeInsets.fromLTRB(18.0, 10.0, 18.0, 10.0),
padding: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationBase.of(context).covidBookAppo, style: TextStyle(fontSize: 18, letterSpacing: 1, fontWeight: FontWeight.bold)),
Text(TranslationBase.of(context).patientName.toString() + ": " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle(fontSize: 14, letterSpacing: 1)),
Text(TranslationBase.of(context).fileNo.toString() + ": " + projectViewModel.user.patientID.toString(), style: TextStyle(fontSize: 14, letterSpacing: 1)),
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).covidQuestionnaire, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)),
),
Expanded( Expanded(
child: ListView.separated( child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 20), child: Padding(
itemCount: qa.length, padding: const EdgeInsets.all(16.0),
itemBuilder: (ctx, idx) {
var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)), Container(
Row( width: double.infinity,
children: [ child: Card(
Radio<int>( shape: cardRadius(12),
value: 1, margin: EdgeInsets.zero,
groupValue: obj["ans"], child: Padding(
onChanged: (newValue) { padding: const EdgeInsets.all(12.0),
setState(() { child: Column(
obj["ans"] = newValue; crossAxisAlignment: CrossAxisAlignment.start,
}); children: [
}), Text(
Text(TranslationBase.of(context).yes), TranslationBase.of(context).covidBookAppo,
], style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: -0.64,
),
),
mHeight(6),
Row(
children: [
Text(
TranslationBase.of(context).patientName + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).fileNo + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
),
),
),
),
mHeight(12),
Text(
TranslationBase.of(context).covidQuestionnaire,
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.bold,
),
),
mHeight(12),
ListView.separated(
itemCount: qa.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, idx) {
var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
qtext,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
Row(
children: [
Expanded(
child: Row(
children: [
Radio<int>(
value: 1,
groupValue: obj["ans"],
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
});
}),
Text(
localize.yes,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
),
Expanded(
child: Row(
children: [
Radio<int>(
value: 0,
groupValue: obj["ans"],
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
});
}),
Text(
localize.no,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
)
],
),
],
),
);
},
separatorBuilder: (ctx, idx) => Container(),
), ),
Row(
children: [
Radio<int>(
value: 0,
groupValue: obj["ans"],
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
});
}),
Text(TranslationBase.of(context).no),
],
)
], ],
), ),
); ),
}, ),
separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), ),
)), Card(
Padding( margin: EdgeInsets.zero,
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), elevation: 20,
child: FractionallySizedBox( child: Container(
widthFactor: 1, padding: EdgeInsets.all(12),
child: DefaultButton(TranslationBase.of(context).next, () { child: FractionallySizedBox(
next(); widthFactor: 1,
}), child: MaterialButton(
height: 50,
elevation: 0,
color: CustomColors.accentColor,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
localize.next,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
letterSpacing: -0.44,
color: Colors.white,
),
),
onPressed: next,
),
),
), ),
), ),
], ],
@ -139,7 +260,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
getPaymentInfo(context, widget.projectId); getPaymentInfo(context, widget.projectId);
} }
else else
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseSelectAllQuestionToContinue); AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
} }
openPassportUpdatePage() { openPassportUpdatePage() {

@ -238,6 +238,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: CustomColors.accentColor, disabledColor: CustomColors.accentColor,
elevation: 0,
onPressed: () { onPressed: () {
next(); next();
}, },

@ -3,10 +3,11 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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/uitl/utils_new.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -30,215 +31,135 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( showNewAppBar: true,
child: Column( backgroundColor: CustomColors.appBackgroudGrey2Color,
crossAxisAlignment: CrossAxisAlignment.start, body: Column(
children: <Widget>[ children: [
Container( Expanded(
height: 180.0, child: SingleChildScrollView(
color: new Color(0xFFc5272d), child: Column(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 50.0), color: new Color(0xFFc5272d),
child: SvgPicture.asset( padding: EdgeInsets.all(20),
'assets/images/new-design/alert_icon.svg', child: Row(
width: 80.0,
height: 80.0),
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Icon(
margin: EdgeInsets.only(left: 30.0, right: 20.0), Icons.warning_outlined,
child: Text(TranslationBase.of(context).covidAlert, color: Colors.white,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
), ),
Container( mWidth(12),
width: MediaQuery.of(context).size.width * 0.55, Expanded(
margin: EdgeInsets.only(
left: 30.0, right: 20.0, top: 5.0),
child: Text( child: Text(
TranslationBase.of(context).covidAlertHeader, TranslationBase.of(context).covidAlertHeader,
// "Pay With-in 15 mins to confirm the appointment", style: TextStyle(
overflow: TextOverflow.clip, color: Colors.white,
style: TextStyle( fontWeight: FontWeight.w600,
color: Colors.white, fontSize: 20.0)), fontSize: 16.0,
), letterSpacing: -0.64,
),
),
)
], ],
), ),
), ),
],
),
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
alignment: Alignment.center,
child: Text(TranslationBase.of(context).covidAlertMins,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
fontSize: 24.0,
fontWeight: FontWeight.bold)),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 5.0),
child: Text(
TranslationBase.of(context).covidAlertInfo,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
fontSize: 18.0,
letterSpacing: 0.8)),
),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0),
top: 20.0, bottom: 10.0, left: 0.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: 0.0, bottom: 20.0),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.grey[200],
boxShadow: [
BoxShadow(color: Colors.grey, spreadRadius: 2),
],
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Text(
margin: EdgeInsets.only( TranslationBase.of(context).covidAlertMins,
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), style: TextStyle(
child: Text(TranslationBase.of(context).covidTest, fontSize: 19.0,
style: TextStyle( letterSpacing: -1.6,
fontSize: 18.0, fontWeight: FontWeight.bold,
color: Colors.black,
fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.local_hospital,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse.projectName !=
null
? widget
.patientShareResponse.projectName
: "NULL",
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.date_range,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[0]
: "NULL",
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700])),
),
],
), ),
), ),
Container( Text(
margin: EdgeInsets.only(bottom: 10.0), TranslationBase.of(context).covidAlertInfo,
child: Row( style: TextStyle(
children: <Widget>[ color: Colors.grey[700],
Container( fontSize: 14.0,
margin: letterSpacing: -0.56,
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.access_time,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[1]
: "NULL",
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700])),
),
],
), ),
), ),
mHeight(20),
Container( Container(
margin: EdgeInsets.only(bottom: 10.0), width: double.infinity,
child: Row( child: Card(
children: <Widget>[ margin: EdgeInsets.zero,
Container( shape: cardRadius(12),
margin: child: Padding(
EdgeInsets.only(left: 20.0, right: 20.0), padding: const EdgeInsets.all(12.0),
child: SvgPicture.asset( child: Column(
"assets/images/new-design/track_icon.svg", crossAxisAlignment: CrossAxisAlignment.start,
width: 20.0, children: [
height: 20.0)), Text(
Container( TranslationBase.of(context).appoInfo,
child: Text(
widget.patientShareResponse.doctorNameObj !=
null
? widget
.patientShareResponse.doctorNameObj
: "NULL",
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 16.0,
color: Colors.grey[700])), letterSpacing: -0.64,
fontWeight: FontWeight.bold,
),
),
mHeight(16),
Row(
children: [
_getNormalText(
TranslationBase.of(context).hospital + ":",
),
mWidth(6),
_getNormalText(
widget.patientShareResponse.projectName != null ? widget.patientShareResponse.projectName : "NULL",
isBold: true,
),
],
),
mHeight(4),
Row(
children: [
_getNormalText(
TranslationBase.of(context).date + ":",
),
mWidth(6),
_getNormalText(
widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL",
isBold: true,
),
],
),
mHeight(4),
Row(
children: [
_getNormalText(
TranslationBase.of(context).time + ":",
),
mWidth(6),
_getNormalText(
widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL",
isBold: true,
),
],
),
mHeight(4),
Row(
children: [
_getNormalText(
TranslationBase.of(context).route + ":",
),
mWidth(6),
_getNormalText(
widget.patientShareResponse.doctorNameObj != null ? widget.patientShareResponse.doctorNameObj : "NULL",
isBold: true,
),
],
),
],
), ),
], ),
), ),
), ),
], ],
@ -247,49 +168,53 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
], ],
), ),
), ),
Container( ),
margin: EdgeInsets.all(20.0), Card(
child: DefaultButton( margin: EdgeInsets.zero,
TranslationBase.of(context).next, elevation: 20,
() { child: Container(
startPaymentProcess(); margin: EdgeInsets.all(12),
}, width: double.infinity,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: CustomColors.accentColor,
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
elevation: 0,
onPressed: () {
startPaymentProcess();
},
child: Text(
TranslationBase.of(context).next,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.48,
),
),
),
), ),
), ),
], ),
), ],
),
);
}
_getNormalText(text, {bool isBold = false}) {
return Text(
text,
style: TextStyle(
fontSize: isBold ? 12 : 10,
letterSpacing: -0.5,
color: isBold ? Colors.black : Colors.grey[700],
fontWeight: FontWeight.w600,
), ),
// bottomSheet: Container(
// margin: EdgeInsets.all(10.0),
// child: Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Container(
// margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500],
// onPressed: () {
// startPaymentProcess();
// },
// child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
// ),
// ),
// ),
// ),
// ],
// ),
// ),
); );
} }
@ -297,31 +222,32 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
navigateToPaymentMethod(context, widget.patientShareResponse); navigateToPaymentMethod(context, widget.patientShareResponse);
} }
Future navigateToPaymentMethod( Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async {
context, PatientShareResponse patientShareResponse) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });
} }
Navigator.push( Navigator.push(
context, FadePage(page: PaymentMethod())) context,
.then((value) { FadePage(
print(value); page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: "MADA"),
if (value != null) { ),
Navigator.push( );
context, // Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
FadePage( // print(value);
page: CovidPaymentSummary( // if (value != null) {
patientShareResponse: widget.patientShareResponse, // Navigator.push(
selectedPaymentMethod: value.toString()), // context,
), // FadePage(
); // page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: value.toString()),
} // ),
}); // );
// }
// });
} }
String getDate(String appoDate) { String getDate(String appoDate) {

@ -1,15 +1,18 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/theme/colors.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class CovidPaymentDetails extends StatefulWidget { class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse; CovidPaymentInfoResponse covidPaymentInfoResponse;
@ -34,60 +37,70 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( showNewAppBar: true,
child: Container( backgroundColor: CustomColors.appBackgroudGrey2Color,
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0), body: Container(
child: Column( // margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ child: Column(
Container( children: [
height: 150.0, Expanded(
decoration: BoxDecoration( child: Padding(
image: DecorationImage( padding: EdgeInsets.all(16),
image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill,
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
),
],
),
],
),
),
Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( // Container(
alignment: Alignment.center, // height: 150.0,
margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), // decoration: BoxDecoration(
child: Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 20.0, fontWeight: FontWeight.bold)), // image: DecorationImage(
), // image: AssetImage(
// "assets/images/new-design/covid-19-big-banner-bg.png"),
// fit: BoxFit.fill,
// ),
// color: Colors.white.withOpacity(0.3),
// borderRadius: BorderRadius.all(Radius.circular(10))),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// margin:
// EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
// child: SvgPicture.asset(
// 'assets/images/new-design/covid-19-car.svg',
// width: 90.0,
// height: 90.0),
// ),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// margin: EdgeInsets.only(
// left: 20.0, right: 20.0, top: 20.0),
// child: Text(TranslationBase.of(context).covidTest,
// style: TextStyle(
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 24.0)),
// ),
// Container(
// margin: EdgeInsets.only(
// left: 20.0, right: 20.0, top: 10.0),
// child: Text(TranslationBase.of(context).driveThru,
// style: TextStyle(
// color: Colors.white, fontSize: 24.0)),
// ),
// ],
// ),
// ],
// ),
// ),
Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)),
...List.generate( ...List.generate(
widget.proceduresList.length, widget.proceduresList.length,
(index) => Column( (index) => Column(
@ -107,7 +120,14 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.proceduresList[index].procedureName, style: TextStyle(fontSize: 14.0)), title: Text(
projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
leading: Radio( leading: Radio(
value: widget.proceduresList[index], value: widget.proceduresList[index],
groupValue: widget.selectedProcedure, groupValue: widget.selectedProcedure,
@ -116,6 +136,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedProcedure = value; widget.selectedProcedure = value;
print(widget.selectedProcedure.procedureName);
getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
}); });
}, },
@ -128,111 +149,200 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
], ],
), ),
), ),
Divider(),
Card(
shape: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationBase.of(context).testFee,
style: TextStyle(
color: Colors.black,
fontSize: 16.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
)),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 3),
child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientShareToDo),
),
Expanded(
child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString(), isBold: true),
)
],
),
),
mDivider(Colors.grey[200]),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
),
Expanded(
child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString(), isBold: true),
)
],
),
),
mDivider(Colors.grey[200]),
Container(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
),
Expanded(
child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString(), isBold: true),
)
],
),
),
],
),
),
),
Container( Container(
alignment: Alignment.center, margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 0.0), child: Row(
child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)), crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Checkbox(
value: isAgree,
onChanged: (value) {
setState(() {
isAgree = !isAgree;
});
},
activeColor: Color(0xffB8382C),
),
Text(
TranslationBase.of(context).agreeTo,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
mWidth(3),
Text(
TranslationBase.of(context).termsConditoins,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: CustomColors.accentColor,
fontWeight: FontWeight.w600,
decoration: TextDecoration.underline,
),
),
],
),
), ),
Table( mFlex(1),
children: [
TableRow(children: [ Text(
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), TranslationBase.of(context).payOptions,
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString())), textAlign: TextAlign.center,
]), style: TextStyle(
TableRow(children: [ fontSize: 12.0,
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), fontWeight: FontWeight.w600,
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString())), letterSpacing: -0.46,
]), ),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString())),
]),
],
), ),
], Container(
), margin: EdgeInsets.only(top: 12, bottom: 12),
), child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Checkbox(
value: isAgree,
onChanged: (value) {
setState(() {
isAgree = !isAgree;
});
},
activeColor: Color(0xffB8382C),
), ),
Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions),
], ],
), ),
), ),
Divider(
color: Colors.grey,
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0),
child: Text(TranslationBase.of(context).payOptions, textAlign: TextAlign.center, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, fontFamily: "Open-Sans")),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
),
],
),
),
),
bottomSheet: Container(
color: Colors.grey[100],
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: DefaultButton(TranslationBase.of(context).cancel, () {
cancel();
}, color: Color(0xffEAEAEA), textColor: Color(0xff000000)),
),
),
), ),
Expanded( Container(
flex: 1, width: double.infinity,
child: Container( child: Card(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), elevation: 20,
child: ButtonTheme( margin: EdgeInsets.zero,
shape: RoundedRectangleBorder( child: Padding(
borderRadius: BorderRadius.circular(10.0), padding: const EdgeInsets.only(top: 12, bottom: 12, left: 12, right: 12),
), child: Row(
minWidth: MediaQuery.of(context).size.width * 0.7, children: [
height: 45.0, Expanded(
child: DefaultButton( flex: 1,
TranslationBase.of(context).next, child: Container(
isAgree child: ButtonTheme(
? () { shape: RoundedRectangleBorder(
next(); borderRadius: BorderRadius.circular(10.0),
} ),
: null, minWidth: MediaQuery.of(context).size.width * 0.7,
disabledColor: Color(0x8ac5272d), height: 45.0,
child: RaisedButton(
color: CustomColors.darkGreyColor,
textColor: Colors.white,
elevation: 0,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
cancel();
},
child: Text(
TranslationBase.of(context).cancel,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
),
),
),
),
mWidth(12),
Expanded(
flex: 1,
child: Container(
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: CustomColors.accentColor,
textColor: Colors.white,
elevation: 0,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: isAgree ? next : null,
child: Text(
TranslationBase.of(context).next,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
),
),
),
],
), ),
), ),
), ),
), )
], ],
), ),
), ),
@ -268,10 +378,15 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
}); });
} }
_getNormalText(text) { _getNormalText(text, {bool isBold = false}) {
return Container( return Text(
margin: EdgeInsets.only(top: 20.0, right: 10.0), text,
child: Text(text, textAlign: TextAlign.end, style: TextStyle(fontSize: 15, fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])), style: TextStyle(
fontSize: isBold ? 12 : 10,
letterSpacing: -0.5,
color: isBold ? Colors.black : Colors.grey[700],
fontWeight: FontWeight.w600,
),
); );
} }
} }

@ -2,16 +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/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.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';
@ -22,7 +24,7 @@ import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget { class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
final String selectedPaymentMethod; String selectedPaymentMethod;
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@ -41,8 +43,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -50,28 +53,65 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).confirmThePayment, TranslationBase.of(context).confirmThePayment,
textAlign: TextAlign.center, style: TextStyle(
fontWeight: FontWeight.w500, fontSize: 19,
fontSize: 24, fontWeight: FontWeight.bold,
letterSpacing: -1.46,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text(
TranslationBase.of(context).totalBalance + ": ",
style: TextStyle(
fontSize: 12,
letterSpacing: -0.60,
),
),
Text(
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.60,
),
)
],
),
SizedBox(
height: 12,
),
Row(
children: [
Container(
width: 20,
height: 20,
decoration: containerColorRadiusBorderWidth(CustomColors.accentColor, 200, Colors.white, 4),
),
Container( Container(
height: 100.0, height: 60.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)), child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)),
), ),
Texts( mFlex(1),
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar, InkWell(
fontSize: 26, onTap: () {
bold: true, showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String metohd) {
widget.selectedPaymentMethod = metohd;
setState(() {});
},
));
},
child: Text(
TranslationBase.of(context).changePayment,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.48, decoration: TextDecoration.underline, color: CustomColors.accentColor),
),
) )
], ],
), ),
@ -81,53 +121,47 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: Container( flex: 1,
margin: EdgeInsets.all(3), child: showDetail(
child: NewTextFields( TranslationBase.of(context).fileNumber,
hintText: TranslationBase.of(context).fileNumber, projectViewModel.user.patientID.toString(),
initialValue: projectViewModel.user.patientID.toString(),
isEnabled: false,
),
), ),
), ),
mWidth(6),
Expanded( Expanded(
child: Container( flex: 1,
margin: EdgeInsets.all(3), child: showDetail(
child: NewTextFields( TranslationBase.of(context).name,
hintText: TranslationBase.of(context).name, projectViewModel.user.firstName.toString(),
initialValue: projectViewModel.user.firstName,
isEnabled: false,
),
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
height: 12, height: 6,
),
NewTextFields(
hintText: TranslationBase.of(context).mobileNumber,
initialValue: projectViewModel.user.mobileNumber,
isEnabled: false,
), ),
showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user.mobileNumber),
SizedBox( SizedBox(
height: 12, height: 6,
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
isEnabled: false,
), ),
showDetail(
TranslationBase.of(context).depositorName,
projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
)
], ],
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
color: Colors.grey[100], color: Colors.white,
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).confirm.toUpperCase(), textColor: Colors.white,
() { color: CustomColors.green,
label: TranslationBase.of(context).confirm.toUpperCase(),
onTap: () {
startPaymentProcess(projectViewModel.user); startPaymentProcess(projectViewModel.user);
}, },
), ),
@ -135,6 +169,32 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
); );
} }
Widget showDetail(String title, String value) {
return Container(
width: double.infinity,
child: Card(
shape: cardRadius(12),
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.64),
),
Text(
value,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Colors.grey),
),
],
),
),
),
);
}
startPaymentProcess(AuthenticatedUser authenticatedUser) { startPaymentProcess(AuthenticatedUser authenticatedUser) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID; appo.projectID = widget.patientShareResponse.projectID;

@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"", "",
//model.user.emailAddress, //model.user.emailAddress,
), ),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule, buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
onTap: (index) { onTap: (index) {
setState(() { setState(() {
if (index == 1) { if (index == 1) {
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex; _tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
} else { } else {
@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}, },
tabs: [ tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment
? Tab( ? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
) )

@ -121,7 +121,8 @@ class _ToDoState extends State<ToDo> {
DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
" " + " " +
widget.appoList[index].startTime.substring(0, 5), overflow: TextOverflow.clip, widget.appoList[index].startTime.substring(0, 5),
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 10.0)), style: TextStyle(fontSize: 10.0)),
), ),
!widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(), !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
@ -743,7 +744,10 @@ class _ToDoState extends State<ToDo> {
}); });
} }
Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
setState(() {});
}))).then((value) {
print(value); print(value);
getPatientAppointmentHistory(); getPatientAppointmentHistory();

@ -8,6 +8,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod;
PaymentMethod({this.onSelectedMethod});
@override @override
_PaymentMethodState createState() => _PaymentMethodState(); _PaymentMethodState createState() => _PaymentMethodState();
} }
@ -22,7 +26,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView( child: SingleChildScrollView(
@ -54,13 +58,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
children: [ children: [
Container( Container(
height: 60.0, height: 60.0,
width:60, width: 60,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: Image.asset("assets/images/new-design/mada.png"), child: Image.asset("assets/images/new-design/mada.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(
"MADA", "Mada",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,
@ -94,7 +98,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new-design/visa.png"), child: Image.asset("assets/images/new-design/visa.png"),
), ),
mWidth(12),Text( mWidth(12),
Text(
"VISA", "VISA",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
@ -131,7 +136,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
mWidth(12), mWidth(12),
Text( Text(
"MATER CARD", "MasterCard",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,
@ -167,7 +172,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
mWidth(12), mWidth(12),
Text( Text(
"INSTALLMENT", "Installments",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,
@ -181,39 +186,75 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
Platform.isIOS Platform.isIOS
? Container( ? Container(
margin: EdgeInsets.only(top: 25.0), width: double.infinity,
child: Flex( child: InkWell(
direction: Axis.horizontal, onTap: () {
children: <Widget>[ updateSelectedPaymentMethod("ApplePay");
Expanded( },
child: Container( child: Card(
child: InkWell( elevation: 3.0,
onTap: () { margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
updateSelectedPaymentMethod("ApplePay"); color: Colors.white,
}, shape: RoundedRectangleBorder(
child: Card( borderRadius: BorderRadius.circular(10),
elevation: 3.0, side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(20.0),
child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
),
),
),
),
), ),
Expanded( child: Row(
child: Container(), children: [
Container(
height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
),
mWidth(12),
Text(
"Apple Pay",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
),
)
],
), ),
], ),
), ),
) )
// Container(
// margin: EdgeInsets.only(top: 25.0),
// child: Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("ApplePay");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(20.0),
// child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
// ),
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// )
: Container(), : Container(),
SizedBox( SizedBox(
height: 150.0, height: 150.0,
@ -224,7 +265,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), padding: EdgeInsets.all(16),
color: Colors.white, color: Colors.white,
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -242,7 +283,9 @@ class _PaymentMethodState extends State<PaymentMethod> {
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
elevation: 0,
onPressed: () { onPressed: () {
widget.onSelectedMethod(selectedPaymentMethod);
Navigator.pop(context, selectedPaymentMethod); Navigator.pop(context, selectedPaymentMethod);
}, },
child: Text(TranslationBase.of(context).confirm.toUpperCase(), child: Text(TranslationBase.of(context).confirm.toUpperCase(),

@ -57,7 +57,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Booking appointment for:", TranslationBase.of(context).covidBookAppo,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
@ -146,6 +146,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
color: new Color(0xFFc5272d), color: new Color(0xFFc5272d),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
elevation: 0,
disabledColor: Colors.red[300], disabledColor: Colors.red[300],
onPressed: () { onPressed: () {
if (_isButtonDisabled == false) if (_isButtonDisabled == false)

File diff suppressed because it is too large Load Diff

@ -84,7 +84,9 @@ class CovidDriveThruService extends BaseService {
authUser = data; authUser = data;
} }
request = {}; request = {
"ProjectID": projectID,
};
dynamic localRes; dynamic localRes;

Loading…
Cancel
Save