Merge branch 'vaccine' into 'master'

edit on vaccine service

See merge request Cloud_Solution/diplomatic-quarter!42
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit fcc3a67ffb

@ -421,7 +421,7 @@ const Map<String, Map<String, String>> localizedValues = {
"MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"},
"MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"},
"Medical": {"en": "Medical", "ar": "التقارير"}, "Medical": {"en": "Medical", "ar": "التقارير"},
"MedicalSubtitle": {"Report": "List", "ar": "الطبية"}, "MedicalSubtitle": {"en": "Report", "ar": "الطبية"},
"Monthly": {"en": "Monthly", "ar": "تقارير"}, "Monthly": {"en": "Monthly", "ar": "تقارير"},
"MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"},
"Sick": {"en": "Sick", "ar": "الإجازات"}, "Sick": {"en": "Sick", "ar": "الإجازات"},

@ -1,91 +1,152 @@
class VaccineModel { class VaccineModel {
String to; String setupID;
String from; int projectID;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
int patientID; int patientID;
String tokenID; int invoiceNo;
int patientTypeID; String procedureID;
int patientType; String vaccineName;
Null vaccineNameN;
String invoiceDate; 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 doctorImageURL;
String doctorName; String doctorName;
int doctorRate;
String doctorTitle; String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
int noOfPatientsRate;
String patientName;
String projectName; String projectName;
String vaccineName; String qR;
List<String> speciality;
String vaccinationDate;
VaccineModel({ VaccineModel(
this.to, {this.setupID,
this.from, this.projectID,
this.versionID, this.patientID,
this.channel, this.invoiceNo,
this.languageID, this.procedureID,
this.iPAdress, this.vaccineName,
this.generalid, this.vaccineNameN,
this.patientOutSA, this.invoiceDate,
this.sessionID, this.doctorID,
this.isDentalAllowedBackend, this.clinicID,
this.deviceTypeID, this.firstName,
this.patientID, this.middleName,
this.tokenID, this.lastName,
this.patientTypeID, this.firstNameN,
this.patientType, this.middleNameN,
this.invoiceDate, this.lastNameN,
this.doctorImageURL, this.dateofBirth,
this.doctorName, this.actualDoctorRate,
this.doctorTitle, this.age,
this.projectName, this.clinicName,
this.vaccineName, 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<String, dynamic> json) { VaccineModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
invoiceNo = json['InvoiceNo'];
procedureID = json['ProcedureID'];
vaccineName = json['VaccineName']; vaccineName = json['VaccineName'];
projectName = json['ProjectName']; vaccineNameN = json['VaccineNameN'];
doctorTitle = json['DoctorTitle'];
doctorName = json['DoctorName'];
doctorImageURL = json['DoctorImageURL'];
invoiceDate = json['InvoiceDate']; invoiceDate = json['InvoiceDate'];
to = json['To']; doctorID = json['DoctorID'];
from = json['From']; clinicID = json['ClinicID'];
versionID = json['VersionID']; firstName = json['FirstName'];
channel = json['Channel']; middleName = json['MiddleName'];
languageID = json['LanguageID']; lastName = json['LastName'];
iPAdress = json['IPAdress']; firstNameN = json['FirstNameN'];
generalid = json['generalid']; middleNameN = json['MiddleNameN'];
patientOutSA = json['PatientOutSA']; lastNameN = json['LastNameN'];
sessionID = json['SessionID']; dateofBirth = json['DateofBirth'];
isDentalAllowedBackend = json['isDentalAllowedBackend']; actualDoctorRate = json['ActualDoctorRate'];
deviceTypeID = json['DeviceTypeID']; age = json['Age'];
patientID = json['PatientID']; clinicName = json['ClinicName'];
tokenID = json['TokenID']; doctorImageURL = json['DoctorImageURL'];
patientTypeID = json['PatientTypeID']; doctorName = json['DoctorName'];
patientType = json['PatientType']; 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<String>();
vaccinationDate = json['VaccinationDate'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['To'] = this.to; data['SetupID'] = this.setupID;
data['From'] = this.from; data['ProjectID'] = this.projectID;
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['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID; data['InvoiceNo'] = this.invoiceNo;
data['PatientTypeID'] = this.patientTypeID; data['ProcedureID'] = this.procedureID;
data['PatientType'] = this.patientType; 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; return data;
} }
} }

@ -7,25 +7,10 @@ class VaccineService extends BaseService {
List<VaccineModel> get vaccineList => _vaccineList; List<VaccineModel> 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 { Future getMyVaccine() async {
Map<String, dynamic> body = Map();
body['To'] = "0";
body['From'] = "0";
hasError = false; hasError = false;
_vaccineList.clear(); _vaccineList.clear();
await baseAppClient.post(GET_VACCINES, await baseAppClient.post(GET_VACCINES,
@ -36,8 +21,28 @@ class VaccineService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _vaccineModel.toJson()); }, body: body);
} }
Future sendEmail() async {} Future sendEmail() async {
Map<String, dynamic> 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);
}
} }

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
@ -22,4 +24,18 @@ class VaccineViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); 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);
}
}
} }

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/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/others/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
@ -39,95 +40,117 @@ class _InsuranceCardState extends State<InsuranceCard> {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return RoundedContainer( return RoundedContainer(
backgroundColor: Colors.white, backgroundColor: Colors.white,
child: Column( child: Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.all(8.0),
children: <Widget>[ child: Column(
ExpansionTile( crossAxisAlignment: CrossAxisAlignment.start,
title: Container( children: <Widget>[
height: 65.0, ExpansionTile(
child: Column( title: Container(
crossAxisAlignment: CrossAxisAlignment.start, height: 65.0,
children: <Widget>[ child: Column(
Padding( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.symmetric(vertical: 15.0), children: <Widget>[
child: Texts( Padding(
model.insurance[index].groupName, padding: EdgeInsets.symmetric(vertical: 15.0),
child: Texts(
model.insurance[index].groupName,
),
), ),
), ],
], ),
),
),
children: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
Container( Container(
child: Button( padding: EdgeInsets.all(14),
label: TranslationBase.of(context).seeDetails, 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: <Widget>[
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: <Widget>[
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,
), ),
],
),
], ],
),
],
),
), ),
); );
}), }),

@ -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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
@ -592,6 +593,10 @@ class _HomePageState extends State<HomePage> {
context, FadePage(page: AllHabibMedicalService())), context, FadePage(page: AllHabibMedicalService())),
), ),
DashboardItem( DashboardItem(
onTap: (){
Navigator.push(context, FadePage(page: FeedbackHomePage()));
},
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),

@ -1,15 +1,12 @@
import 'dart:typed_data';
import 'dart:convert';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/core/viewModels/vaccine_view_model.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.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'; import 'package:popup_box/popup_box.dart';
class MyVaccines extends StatefulWidget { class MyVaccines extends StatefulWidget {
@ -24,297 +21,193 @@ class _MyVaccinesState extends State<MyVaccines> {
onModelReady: (model) => model.getVaccine(), onModelReady: (model) => model.getVaccine(),
builder: (BuildContext context, VaccineViewModel model, Widget child) => builder: (BuildContext context, VaccineViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'My Vaccines', appBarTitle: 'My Vaccines',
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004, left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04, top: SizeConfig.screenWidth * 0.04,
), ),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
RoundedContainer( RoundedContainer(
backgroundColor: Colors.white, backgroundColor: Colors.white,
child: ExpansionTile( child: ExpansionTile(
title: Container( title: Container(
height: 65.0, height: 65.0,
child: Text('2018'), child: Text('2018'),
), ),
children: <Widget>[ children: <Widget>[
Container( Container(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.vaccineList == null itemCount: model.vaccineList == null
? 0 ? 0
: model.vaccineList.length, : model.vaccineList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Column( return Column(
children: <Widget>[ children: <Widget>[
RoundedContainer( RoundedContainer(
child: Column( child: Column(
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Column( Row(
children: <Widget>[ children: <Widget>[
Padding( Expanded(
padding: EdgeInsets.symmetric( child: Column(
horizontal: 20.0, children: <Widget>[
vertical: 20.0), Padding(
child: Image.network( padding: EdgeInsets.symmetric(
model.vaccineList[index] horizontal: 20.0,
.doctorImageURL, vertical: 20.0),
height: SizeConfig child: Image.network(
.imageSizeMultiplier * model.vaccineList[index]
23, .doctorImageURL,
width: SizeConfig height: SizeConfig
.imageSizeMultiplier * .imageSizeMultiplier *
20, 23,
fit: BoxFit.fill, width: SizeConfig
.imageSizeMultiplier *
20,
fit: BoxFit.fill,
),
),
],
), ),
flex: 2,
), ),
], Expanded(
), child: Container(
Container( child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Text(
Text( model.vaccineList[index]
model.vaccineList[index] .doctorTitle +
.doctorTitle + model.vaccineList[index]
model.vaccineList[index] .doctorName,
.doctorName, style: TextStyle(
style: TextStyle( fontWeight: FontWeight.w900,
fontWeight: FontWeight.w900, fontSize: 16.6,
fontSize: 16.6, ),
), ),
), SpaceBetweenTexts(space: 7.0),
SpaceBetweenTexts(space: 7.0), Text(
Text( model.vaccineList[index]
model.vaccineList[index] .projectName,
.projectName, style: TextStyle(
style: TextStyle( fontSize: 17.0,
fontSize: 17.0, letterSpacing: 0.5,
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), flex: 5,
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: 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, bottomSheet: Container(
height: 80.0, color: Theme.of(context).scaffoldBackgroundColor,
child: Button( padding: EdgeInsets.all(12),
label: 'SEND EMAIL', height: MediaQuery.of(context).size.height *0.25,
backgroundColor: Color(0xffF62426), width: double.infinity,
onTap: () async { child: Column(
await PopupBox.showPopupBox( children: [
context: context, Divider(height: 2,thickness: 1,),
button: MaterialButton( SizedBox(height: 6,),
shape: RoundedRectangleBorder( Container(
borderRadius: BorderRadius.circular(20), width: double.infinity,
), // height: 80.0,
color: Colors.white, child: Button(
child: Text( label: 'CHECK VACCINE AVAILABILITY',
'CANCEL', backgroundColor: Color(0xff9EA3A4),
style: TextStyle(fontSize: 16.5), ),
), ),
onPressed: () { Container(
Navigator.of(context).pop(); width: double.infinity,
}, // height: 80.0,
), child: SecondaryButton(
willDisplayWidget: Column( label: 'SEND EMAIL',
children: <Widget>[ color: Color(0xffF62426),
Text( textColor: Colors.white,
'Conform \nSend a copy of this report to the email' + disabled: model.vaccineList.length==0,
model.vaccineList[0].doctorName, onTap: () async {
style: TextStyle( await PopupBox.showPopupBox(
fontSize: 20, context: context,
color: Colors.black26, button: MaterialButton(
fontWeight: FontWeight.w900), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(3),
), ),
SizedBox( color: Colors.white,
height: 30.0, child: Text(
'CANCEL',
style: TextStyle(fontSize: 16.5),
), ),
], onPressed: () {
)); Navigator.of(context).pop();
}, },
),
willDisplayWidget: Column(
children: <Widget>[
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: <Widget>[
// RoundedContainer(
// backgroundColor: Colors.white,
// child: Column(
// children: <Widget>[
// ExpansionTile(
// title: Container(
// height: 60.0,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Texts('2018'),
// ],
// ),
// ),
// children: <Widget>[
// Column(
// children: <Widget>[
// Row(
// children: <Widget>[
// Column(
// children: <Widget>[
// 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: <Widget>[
// 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) { convertDateFormat(String Date) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -333,19 +226,7 @@ class _MyVaccinesState extends State<MyVaccines> {
return newDate.toString(); 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 { class SpaceBetweenTexts extends StatelessWidget {

Loading…
Cancel
Save