|
|
|
|
@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
|
|
|
|
|
|
|
|
|
|
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
|
|
|
|
|
@ -10,14 +11,14 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_mod
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisDialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
@ -26,8 +27,6 @@ import 'package:giffy_dialog/giffy_dialog.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import 'dialogs/SelectBeneficiaryDialog.dart';
|
|
|
|
|
import 'dialogs/SelectBloodDialog.dart';
|
|
|
|
|
import 'dialogs/SelectGenderDialog.dart';
|
|
|
|
|
import 'dialogs/SelectPatientFamilyDialog.dart';
|
|
|
|
|
import 'dialogs/SelectPatientInfoDialog.dart';
|
|
|
|
|
|
|
|
|
|
@ -44,11 +43,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
|
|
|
|
|
TextEditingController _fileTextController = TextEditingController();
|
|
|
|
|
TextEditingController _notesTextController = TextEditingController();
|
|
|
|
|
BeneficiaryType beneficiaryType = BeneficiaryType.NON;
|
|
|
|
|
Gender gender = Gender.Male; //Gender.NON;
|
|
|
|
|
Blood blood = Blood.Aminus; //Blood.NON;
|
|
|
|
|
|
|
|
|
|
// Gender gender = Gender.Male; //Gender.NON;
|
|
|
|
|
// Blood blood = Blood.Aminus; //Blood.NON;
|
|
|
|
|
//HospitalsModel _selectedHospital;
|
|
|
|
|
CitiesModel _selectedHospital;
|
|
|
|
|
|
|
|
|
|
int _selectedHospitalIndex = 0;
|
|
|
|
|
int _selectedGenderIndex = 1;
|
|
|
|
|
int _selectedBloodTypeIndex = 0;
|
|
|
|
|
|
|
|
|
|
String amount = "";
|
|
|
|
|
String email;
|
|
|
|
|
PatientInfo _selectedPatientInfo;
|
|
|
|
|
@ -81,182 +85,193 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
|
|
|
|
|
return BaseView<MyBalanceViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getCities(), //model.getHospitals(),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
description: TranslationBase.of(context).bloodDonationInfo,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).bloodD,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).bloodDEnterDesc
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),
|
|
|
|
|
//model.hospitals
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: 65,
|
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [Texts(getHospitalName(projectProvider, context), color: Colors.black), Icon(Icons.arrow_drop_down)],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
//======Gender========
|
|
|
|
|
onTap: () => confirmSelectGenderDialog(),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: 65,
|
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(getGender(context), color: Colors.black),
|
|
|
|
|
Icon(Icons.arrow_drop_down)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
backgroundColor: Color(0xffF7F7F7),
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
description: TranslationBase.of(context).bloodDonationInfo,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).bloodD,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.all(21),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).bloodDEnterDesc,
|
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
//======Gender========
|
|
|
|
|
onTap: () => confirmSelectBloodDialog(),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: 65,
|
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [Texts(getBlood(), color: Colors.black), Icon(Icons.arrow_drop_down)],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
CommonDropDownView(
|
|
|
|
|
TranslationBase.of(context).city,
|
|
|
|
|
model.CitiesModelList.isNotEmpty
|
|
|
|
|
? projectProvider.isArabic
|
|
|
|
|
? model.CitiesModelList[_selectedHospitalIndex].descriptionN
|
|
|
|
|
: model.CitiesModelList[_selectedHospitalIndex].description
|
|
|
|
|
: "", () {
|
|
|
|
|
List<RadioSelectionDialogModel> list = [
|
|
|
|
|
for (int i = 0; i < model.CitiesModelList.length; i++)
|
|
|
|
|
RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: RadioSelectionDialog(
|
|
|
|
|
listData: list,
|
|
|
|
|
selectedIndex: _selectedHospitalIndex,
|
|
|
|
|
isScrollable: true,
|
|
|
|
|
onValueSelected: (index) {
|
|
|
|
|
_selectedHospitalIndex = index;
|
|
|
|
|
_selectedHospital = model.CitiesModelList[index];
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).withBorderedContainer,
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () {
|
|
|
|
|
List<RadioSelectionDialogModel> list = [
|
|
|
|
|
RadioSelectionDialogModel(TranslationBase.of(context).male, 1),
|
|
|
|
|
RadioSelectionDialogModel(TranslationBase.of(context).female, 2),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: RadioSelectionDialog(
|
|
|
|
|
listData: list,
|
|
|
|
|
selectedIndex: _selectedGenderIndex,
|
|
|
|
|
onValueSelected: (index) {
|
|
|
|
|
_selectedGenderIndex = index;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).withBorderedContainer,
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
CommonDropDownView(TranslationBase.of(context).bloodType, getBlood(_selectedBloodTypeIndex), () {
|
|
|
|
|
List<RadioSelectionDialogModel> list = [
|
|
|
|
|
RadioSelectionDialogModel("O+", 0),
|
|
|
|
|
RadioSelectionDialogModel("O-", 1),
|
|
|
|
|
RadioSelectionDialogModel("AB+", 2),
|
|
|
|
|
RadioSelectionDialogModel("AB-", 3),
|
|
|
|
|
RadioSelectionDialogModel("A+", 4),
|
|
|
|
|
RadioSelectionDialogModel("A-", 5),
|
|
|
|
|
RadioSelectionDialogModel("B+", 6),
|
|
|
|
|
RadioSelectionDialogModel("B-", 7),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: RadioSelectionDialog(
|
|
|
|
|
listData: list,
|
|
|
|
|
selectedIndex: _selectedBloodTypeIndex,
|
|
|
|
|
isScrollable: true,
|
|
|
|
|
onValueSelected: (index) {
|
|
|
|
|
_selectedBloodTypeIndex = index;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).withBorderedContainer,
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).viewTermsConditions + ":",
|
|
|
|
|
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
|
|
|
|
|
style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).push(FadePage(page: UserAgreementPage()));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Texts(
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).push(FadePage(page: UserAgreementPage()));
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).clickHere,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
width: 350,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (_) => AssetGiffyDialog(
|
|
|
|
|
title: Text(
|
|
|
|
|
"",
|
|
|
|
|
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
image: Image.asset('assets/images/BloodChrt_EN.png'),
|
|
|
|
|
buttonCancelText: Text(TranslationBase.of(context).cancel),
|
|
|
|
|
buttonCancelColor: Colors.grey,
|
|
|
|
|
onlyCancelButton: true,
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
width: 350,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (_) => AssetGiffyDialog(
|
|
|
|
|
title: Text(
|
|
|
|
|
"",
|
|
|
|
|
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
image: Image.asset('assets/images/BloodChrt_EN.png'),
|
|
|
|
|
buttonCancelText: Text(TranslationBase.of(context).cancel),
|
|
|
|
|
buttonCancelColor: Colors.grey,
|
|
|
|
|
onlyCancelButton: true,
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.15,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.15,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
|
child: DefaultButton(TranslationBase.of(context).save, () async {
|
|
|
|
|
DefaultButton(TranslationBase.of(context).save, () async {
|
|
|
|
|
if (_selectedHospital == null) {
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
|
|
|
|
|
bloodDetails.cityCode = _selectedHospital.iD.toString();
|
|
|
|
|
bloodDetails.gender = gender == Gender.Male ? 1 : 2;
|
|
|
|
|
bloodDetails.gender = _selectedGenderIndex;
|
|
|
|
|
bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
|
|
|
|
|
await model.updateBloodGroup(bloodDetails);
|
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
|
AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: model.error);
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
)),
|
|
|
|
|
}).insideContainer
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -280,106 +295,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void confirmSelectBloodDialog() {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: SelectBloodDialog(
|
|
|
|
|
bloodType: blood,
|
|
|
|
|
onValueSelected: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (value == Blood.Oplus) {
|
|
|
|
|
bloodDetails.bloodGroup = "O+";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.Ominus) {
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
bloodDetails.bloodGroup = "O-";
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.ABplus) {
|
|
|
|
|
bloodDetails.bloodGroup = "AB+";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.ABminus) {
|
|
|
|
|
bloodDetails.bloodGroup = "AB-";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.Aplus) {
|
|
|
|
|
bloodDetails.bloodGroup = "A+";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.Aminus) {
|
|
|
|
|
bloodDetails.bloodGroup = "A-";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.Bplus) {
|
|
|
|
|
bloodDetails.bloodGroup = "B+";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else if (value == Blood.Bminus) {
|
|
|
|
|
bloodDetails.bloodGroup = "B-";
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else
|
|
|
|
|
_fileTextController.text = "";
|
|
|
|
|
|
|
|
|
|
// beneficiaryType = value;
|
|
|
|
|
blood = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void confirmSelectGenderDialog() {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: SelectGenderDialog(
|
|
|
|
|
beneficiaryType: gender,
|
|
|
|
|
onValueSelected: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (value == Gender.Male) {
|
|
|
|
|
// _fileTextController.text = model.user.patientID.toString();
|
|
|
|
|
bloodDetails.patientType = 1;
|
|
|
|
|
// advanceModel.depositorName =
|
|
|
|
|
// model.user.firstName + " " + model.user.lastName;
|
|
|
|
|
} else
|
|
|
|
|
// _fileTextController.text = "";
|
|
|
|
|
{
|
|
|
|
|
bloodDetails.gender = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// beneficiaryType = value;
|
|
|
|
|
gender = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
|
|
|
|
|
void confirmSelectHospitalDialog(List<CitiesModel> hospitals) {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: SelectCiteisDialog(
|
|
|
|
|
hospitals: hospitals,
|
|
|
|
|
selectedHospital: _selectedHospital,
|
|
|
|
|
onValueSelected: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedHospital = value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
@ -429,54 +344,39 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
|
|
|
|
|
return TranslationBase.of(context).selectBeneficiary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getGender(BuildContext context) {
|
|
|
|
|
switch (gender) {
|
|
|
|
|
case Gender.Male:
|
|
|
|
|
return TranslationBase.of(context).male;
|
|
|
|
|
case Gender.Female:
|
|
|
|
|
return TranslationBase.of(context).female;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Gender.NON:
|
|
|
|
|
return TranslationBase.of(context).selectGender;
|
|
|
|
|
}
|
|
|
|
|
return TranslationBase.of(context).selectGender;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getBlood() {
|
|
|
|
|
switch (blood) {
|
|
|
|
|
case Blood.Oplus:
|
|
|
|
|
String getBlood(int index) {
|
|
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
return "O+";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.Ominus:
|
|
|
|
|
case 1:
|
|
|
|
|
return "O-";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.ABplus:
|
|
|
|
|
case 2:
|
|
|
|
|
return "AB+";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.ABminus:
|
|
|
|
|
case 3:
|
|
|
|
|
return "AB-";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.Aplus:
|
|
|
|
|
case 4:
|
|
|
|
|
return "A+";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.Aminus:
|
|
|
|
|
case 5:
|
|
|
|
|
return "A-";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.Bplus:
|
|
|
|
|
case 6:
|
|
|
|
|
return "B-";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.Bminus:
|
|
|
|
|
case 7:
|
|
|
|
|
return "B-";
|
|
|
|
|
break;
|
|
|
|
|
case Blood.Bplus:
|
|
|
|
|
case 8:
|
|
|
|
|
return "B+";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Blood.NON:
|
|
|
|
|
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
|
|
|
|
|
default:
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
|
|
|
|
|
|