added terms & conditions for Blood Donation appointment

dev_3.3_blood_donation_CR
haroon amjad 2 years ago
parent 3df39cf18a
commit 274d215291

File diff suppressed because one or more lines are too long

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.d
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -16,6 +17,7 @@ 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/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -61,6 +63,8 @@ class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointm
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
ScrollController _scrollController; ScrollController _scrollController;
var checkedValue = false;
@override @override
void initState() { void initState() {
final _selectedDay = DateTime.now(); final _selectedDay = DateTime.now();
@ -165,6 +169,43 @@ class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointm
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)), child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
), ),
), ),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).viewTermsConditions + ":",
style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
),
InkWell(
onTap: () {
Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions()));
},
child: Text(
TranslationBase.of(context).clickHere,
style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56),
),
)
],
),
SizedBox(height: 12),
Row(
children: [
Checkbox(
onChanged: (bool value) {
setState(() {
checkedValue = value;
});
},
value: checkedValue,
activeColor: Color(0xFFc5272d),
),
Text(
TranslationBase.of(context).iAgreeToTheTermsAndConditions,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
),
],
),
], ],
), ),
), ),
@ -182,7 +223,11 @@ class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointm
TranslationBase.of(context).bookAppo, TranslationBase.of(context).bookAppo,
() async { () async {
if (BloodDonationBookAppointment.areSlotsAvailable) { if (BloodDonationBookAppointment.areSlotsAvailable) {
insertBloodDonationAppointment(); if(checkedValue) {
insertBloodDonationAppointment();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
}
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot); AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
} }

Loading…
Cancel
Save