From 9159928e27480404d6e91a7c83667da71f8dcebd Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 15:08:13 +0300 Subject: [PATCH] edit on vaccine service --- lib/config/localized_values.dart | 2 +- lib/core/model/vaccine/my_vaccine.dart | 203 +++++--- lib/core/service/vaccine_service.dart | 45 +- lib/core/viewModels/vaccine_view_model.dart | 16 + .../insurance/insurance_card_screen.dart | 191 ++++---- lib/pages/landing/home_page.dart | 5 + lib/pages/vaccine/my_vaccines_screen.dart | 459 +++++++----------- 7 files changed, 456 insertions(+), 465 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f50ea02c..c0693161 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -421,7 +421,7 @@ const Map> localizedValues = { "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, "Medical": {"en": "Medical", "ar": "التقارير"}, - "MedicalSubtitle": {"Report": "List", "ar": "الطبية"}, + "MedicalSubtitle": {"en": "Report", "ar": "الطبية"}, "Monthly": {"en": "Monthly", "ar": "تقارير"}, "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, "Sick": {"en": "Sick", "ar": "الإجازات"}, diff --git a/lib/core/model/vaccine/my_vaccine.dart b/lib/core/model/vaccine/my_vaccine.dart index ac6e2e19..dc921c12 100644 --- a/lib/core/model/vaccine/my_vaccine.dart +++ b/lib/core/model/vaccine/my_vaccine.dart @@ -1,91 +1,152 @@ class VaccineModel { - String to; - String from; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; + String setupID; + int projectID; int patientID; - String tokenID; - int patientTypeID; - int patientType; + int invoiceNo; + String procedureID; + String vaccineName; + Null vaccineNameN; String invoiceDate; + int doctorID; + int clinicID; + String firstName; + String middleName; + String lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + String dateofBirth; + int actualDoctorRate; + String age; + String clinicName; String doctorImageURL; String doctorName; + int doctorRate; String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int noOfPatientsRate; + String patientName; String projectName; - String vaccineName; + String qR; + List speciality; + String vaccinationDate; - VaccineModel({ - this.to, - this.from, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.invoiceDate, - this.doctorImageURL, - this.doctorName, - this.doctorTitle, - this.projectName, - this.vaccineName, - }); + VaccineModel( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceNo, + this.procedureID, + this.vaccineName, + this.vaccineNameN, + this.invoiceDate, + this.doctorID, + this.clinicID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.dateofBirth, + this.actualDoctorRate, + this.age, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality, + this.vaccinationDate}); VaccineModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceNo = json['InvoiceNo']; + procedureID = json['ProcedureID']; vaccineName = json['VaccineName']; - projectName = json['ProjectName']; - doctorTitle = json['DoctorTitle']; - doctorName = json['DoctorName']; - doctorImageURL = json['DoctorImageURL']; + vaccineNameN = json['VaccineNameN']; invoiceDate = json['InvoiceDate']; - to = json['To']; - from = json['From']; - versionID = json['VersionID']; - channel = json['Channel']; - languageID = json['LanguageID']; - iPAdress = json['IPAdress']; - generalid = json['generalid']; - patientOutSA = json['PatientOutSA']; - sessionID = json['SessionID']; - isDentalAllowedBackend = json['isDentalAllowedBackend']; - deviceTypeID = json['DeviceTypeID']; - patientID = json['PatientID']; - tokenID = json['TokenID']; - patientTypeID = json['PatientTypeID']; - patientType = json['PatientType']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + dateofBirth = json['DateofBirth']; + actualDoctorRate = json['ActualDoctorRate']; + age = json['Age']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + vaccinationDate = json['VaccinationDate']; } Map toJson() { final Map data = new Map(); - data['To'] = this.to; - data['From'] = this.from; - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; - data['IPAdress'] = this.iPAdress; - data['generalid'] = this.generalid; - data['PatientOutSA'] = this.patientOutSA; - data['SessionID'] = this.sessionID; - data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; - data['DeviceTypeID'] = this.deviceTypeID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; - data['TokenID'] = this.tokenID; - data['PatientTypeID'] = this.patientTypeID; - data['PatientType'] = this.patientType; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureID'] = this.procedureID; + data['VaccineName'] = this.vaccineName; + data['VaccineNameN'] = this.vaccineNameN; + data['InvoiceDate'] = this.invoiceDate; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['DateofBirth'] = this.dateofBirth; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Age'] = this.age; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['VaccinationDate'] = this.vaccinationDate; return data; } } diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart index 189e26d8..9904b838 100644 --- a/lib/core/service/vaccine_service.dart +++ b/lib/core/service/vaccine_service.dart @@ -7,25 +7,10 @@ class VaccineService extends BaseService { List get vaccineList => _vaccineList; - VaccineModel _vaccineModel = VaccineModel( - to: "0", - from: "0", - channel: 3, - deviceTypeID: 2, - generalid: "Cs2020@2016\$2958", - iPAdress: "10.20.10.20", - isDentalAllowedBackend: false, - languageID: 2, - patientID: 1231755, - patientOutSA: 0, - patientType: 1, - patientTypeID: 1, - sessionID: "uoKFXSLUwEaHYPwKZNA", - tokenID: "@dm!n", - versionID: 5.5, - ); - Future getMyVaccine() async { + Map body = Map(); + body['To'] = "0"; + body['From'] = "0"; hasError = false; _vaccineList.clear(); await baseAppClient.post(GET_VACCINES, @@ -36,8 +21,28 @@ class VaccineService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _vaccineModel.toJson()); + }, body: body); } - Future sendEmail() async {} + Future sendEmail() async { + + Map body = Map(); + body['ListVaccines'] = vaccineList.map((v) => v.toJson()).toList(); + body['ListVaccines'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " "+ user.lastName; + + hasError = false; + + await baseAppClient.post(GET_VACCINES, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + + } } diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart index a3b6c057..233a945f 100644 --- a/lib/core/viewModels/vaccine_view_model.dart +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + import 'base_view_model.dart'; import '../../locator.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; @@ -22,4 +24,18 @@ class VaccineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future sendEmail({String message}) async { + hasError = false; + setState(ViewState.BusyLocal); + await _vaccineService.sendEmail(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } } diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 70d164ff..6483b6b2 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; @@ -39,95 +40,117 @@ class _InsuranceCardState extends State { itemBuilder: (BuildContext context, int index) { return RoundedContainer( backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - height: 65.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 15.0), - child: Texts( - model.insurance[index].groupName, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + height: 65.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Texts( + model.insurance[index].groupName, + ), ), - ), - ], - ), - ), - children: [ - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Texts( - TranslationBase.of(context).companyName + - model.insurance[index].companyName, - fontSize: 20.0, - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - TranslationBase.of(context).category + - model.insurance[index].subCategoryDesc, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).expirationDate + - convertDateFormat( - model.insurance[index].cardValidTo), - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).patientCard + - model.insurance[index].patientCardID, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).policyNumber + - model - .insurance[index].insurancePolicyNumber, - style: TextStyle(fontSize: 18.5), - ), - ], - ), - Column( - children: [ - model.insurance[index].isActive == true - ? Text('Active', - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - : Text('Not Active', - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - ], - ), - SizedBox( - height: 14.5, + ], + ), ), - if (model.insurance[index].isActive == true) + children: [ Container( - child: Button( - label: TranslationBase.of(context).seeDetails, + padding: EdgeInsets.all(14), + width: double.infinity, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.grey,width: 0.2), + borderRadius: BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + + ] + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).companyName + + model.insurance[index].companyName, + fontSize: 20.0, + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 0.5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + TranslationBase.of(context).category + + model.insurance[index].subCategoryDesc, + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).expirationDate + + convertDateFormat( + model.insurance[index].cardValidTo), + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).patientCard + + model.insurance[index].patientCardID, + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).policyNumber + + model + .insurance[index].insurancePolicyNumber, + style: TextStyle(fontSize: 18.5), + ), + ], + ), + Column( + children: [ + model.insurance[index].isActive == true + ? Text('Active', + style: TextStyle( + color: Colors.green, + fontWeight: FontWeight.w900, + fontSize: 17.9)) + : Text('Not Active', + style: TextStyle( + color: Colors.red, + fontWeight: FontWeight.w900, + fontSize: 17.9)) + ], + ), + SizedBox( + height: 14.5, + ), + if (model.insurance[index].isActive == true) + Container( + color: Colors.transparent, + child: SecondaryButton( + label: TranslationBase.of(context).seeDetails, + textColor: Colors.white, + ), + width: double.infinity, + ), + ], ), - width: 400.0, ), - ], - ), - ], + + + ], + ), + ], + ), ), ); }), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index d0c8d382..d7afab94 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -592,6 +593,10 @@ class _HomePageState extends State { context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( + onTap: (){ + Navigator.push(context, FadePage(page: FeedbackHomePage())); + + }, child: Container( width: double.infinity, padding: EdgeInsets.all(10), diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index cfb0415f..c825884c 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,15 +1,12 @@ -import 'dart:typed_data'; -import 'dart:convert'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:flutter_email_sender/flutter_email_sender.dart'; import 'package:popup_box/popup_box.dart'; class MyVaccines extends StatefulWidget { @@ -24,297 +21,193 @@ class _MyVaccinesState extends State { onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'My Vaccines', - baseViewModel: model, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( - children: [ - Row( + isShowAppBar: true, + appBarTitle: 'My Vaccines', + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( children: [ - Column( + Row( children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, - vertical: 20.0), - child: Image.network( - model.vaccineList[index] - .doctorImageURL, - height: SizeConfig - .imageSizeMultiplier * - 23, - width: SizeConfig - .imageSizeMultiplier * - 20, - fit: BoxFit.fill, + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig + .imageSizeMultiplier * + 23, + width: SizeConfig + .imageSizeMultiplier * + 20, + fit: BoxFit.fill, + ), + ), + ], ), + flex: 2, ), - ], - ), - Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.vaccineList[index] - .doctorTitle + - model.vaccineList[index] - .doctorName, - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 16.6, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index] + .doctorTitle + + model.vaccineList[index] + .doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: + TextStyle(fontSize: 17.0), + ), + ], ), ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[index] - .invoiceDate), - style: - TextStyle(fontSize: 17.0), - ), - ], - ), + flex: 5, + ), + ], ), ], ), - ], - ), - ), - ], - ); - }), - ) - ], - ), - ), - SpaceBetweenTexts(space: 165.0), - Flexible( - child: Container( - width: 350.0, - height: 80.0, - child: Button( - label: 'CHECK VACCINE AVAILABILITY', - backgroundColor: Color(0xff9EA3A4), + ), + ], + ); + }), + ) + ], + ), ), - ), + // SpaceBetweenTexts(space: 165.0), + + ], ), - Flexible( - child: Container( - width: 350.0, - height: 80.0, - child: Button( - label: 'SEND EMAIL', - backgroundColor: Color(0xffF62426), - onTap: () async { - await PopupBox.showPopupBox( - context: context, - button: MaterialButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20), - ), - color: Colors.white, - child: Text( - 'CANCEL', - style: TextStyle(fontSize: 16.5), - ), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - willDisplayWidget: Column( - children: [ - Text( - 'Conform \nSend a copy of this report to the email' + - model.vaccineList[0].doctorName, - style: TextStyle( - fontSize: 20, - color: Colors.black26, - fontWeight: FontWeight.w900), + + ), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height *0.25, + width: double.infinity, + child: Column( + children: [ + Divider(height: 2,thickness: 1,), + SizedBox(height: 6,), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + label: 'CHECK VACCINE AVAILABILITY', + backgroundColor: Color(0xff9EA3A4), + ), + ), + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: 'SEND EMAIL', + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length==0, + onTap: () async { + await PopupBox.showPopupBox( + context: context, + button: MaterialButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(3), ), - SizedBox( - height: 30.0, + color: Colors.white, + child: Text( + 'CANCEL', + style: TextStyle(fontSize: 16.5), ), - ], - )); - }, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + willDisplayWidget: Column( + children: [ + Text( + 'Conform \nSend a copy of this report to the email' + + model.vaccineList[0].doctorName, + style: TextStyle( + fontSize: 20, + color: Colors.black26, + fontWeight: FontWeight.w900), + ), + SizedBox( + height: 30.0, + ), + ], + )); + }, + ), ), - ), + ], ), - ], + ), ), - -// child: ListView.builder( -// itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, -// itemBuilder: (BuildContext context, int index) { -// return Column( -// children: [ -// RoundedContainer( -// backgroundColor: Colors.white, -// child: Column( -// children: [ -// ExpansionTile( -// title: Container( -// height: 60.0, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Texts('2018'), -// ], -// ), -// ), -// children: [ -// Column( -// children: [ -// Row( -// children: [ -// Column( -// children: [ -// Padding( -// padding: EdgeInsets.symmetric( -// horizontal: 20.0, vertical: 20.0), -// child: Container( -// child: Image.network( -// model.vaccineList[index] -// .doctorImageURL, -// height: SizeConfig -// .imageSizeMultiplier * -// 23, -// width: SizeConfig -// .imageSizeMultiplier * -// 20, -// fit: BoxFit.fill, -// colorBlendMode: -// BlendMode.hardLight, -// ), -// ), -// ) -// ], -// ), -// Container( -// child: Column( -// mainAxisAlignment: -// MainAxisAlignment.start, -// crossAxisAlignment: -// CrossAxisAlignment.start, -// children: [ -// Text( -// model.vaccineList[index] -// .doctorTitle + -// model.vaccineList[index] -// .doctorName, -// style: TextStyle( -// fontWeight: FontWeight.w900, -// fontSize: 17.5), -// ), -// Text( -// model -// .vaccineList[index].projectName, -// style: TextStyle( -// fontSize: 19.0, -// letterSpacing: 0.3, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// Text( -// model -// .vaccineList[index].vaccineName, -// style: TextStyle( -// fontSize: 19.0, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// Text( -// 'Date Taken ' + -// convertDateFormat(model -// .vaccineList[index] -// .invoiceDate), -// style: TextStyle( -// fontSize: 19.0, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// ], -// ), -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ), -// Container( -// width: 300, -// child: Button( -// label: 'CHECK VACCINE AVAILABILITY', -// backgroundColor: Color(0xff9EA3A4), -// ), -// ), -// Container( -// width: 300, -// child: Button( -// label: 'SEND EMAIL', -// backgroundColor: Color(0xff9EA3A4), -// ), -// ), -// ], -// ); -// }, -// ), - ), - ), ); } - convertDateFormat(String Date) { const start = "/Date("; const end = "+0300)"; @@ -333,19 +226,7 @@ class _MyVaccinesState extends State { return newDate.toString(); } - emailSender() async { - final Email email = Email( - body: 'Email body', - subject: 'Email subject', - recipients: ['example@example.com'], - cc: ['cc@example.com'], - bcc: ['bcc@example.com'], - attachmentPaths: ['/path/to/attachment.zip'], - isHTML: false, - ); - await FlutterEmailSender.send(email); - } } class SpaceBetweenTexts extends StatelessWidget {