Merge branch 'development_new_design_2.0' into mirza_home_page

merge-requests/466/head
Mirza.Shafique 4 years ago
commit f56ae8ff5b

@ -396,8 +396,9 @@ const Map localizedValues = {
"PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, "PaymentOnline": {"en": "Service", "ar": "الالكتروني"},
"OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"},
"MyBalances": {"en": "My Balances", "ar": "رصيدي"}, "MyBalances": {"en": "My Balances", "ar": "رصيدي"},
"MyWallet": {"en": "My Wallet", "ar": "محفظتى"},
"BalanceAmount": {"en": "Wallet Amount", "ar": "مبلغ المحفظة"}, "BalanceAmount": {"en": "Wallet Amount", "ar": "مبلغ المحفظة"},
"TotalBalance": {"en": "Total Amount", "ar": "المبلغ الإجمالي"}, "TotalBalance": {"en": "Total Balance", "ar": "إجمالي الرصيد"},
"CreateAdvancedPayment": {"en": "Recharge Wallet", "ar": "شحن المحفظة"}, "CreateAdvancedPayment": {"en": "Recharge Wallet", "ar": "شحن المحفظة"},
"AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"},
"AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, "AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"},

@ -4,6 +4,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
// todo 'sikander' remove this file when usage known
class SelectCountryDialog extends StatefulWidget { class SelectCountryDialog extends StatefulWidget {
final Function(dynamic) onValueSelected; final Function(dynamic) onValueSelected;
dynamic selectedCountry; dynamic selectedCountry;

@ -1,139 +0,0 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class SelectSearchCriteriaDialog extends StatefulWidget {
List<SearchCriteriaModel> searchCriteria = [
SearchCriteriaModel(name: "Identification Number",nameAr:"رقم الهوية",value: 1),
SearchCriteriaModel(name: "Referral Number",nameAr:"رقم الإحالة",value: 2),
];
final Function(SearchCriteriaModel) onValueSelected;
SearchCriteriaModel selectedCriteria;
ProjectViewModel projectViewModel;
SelectSearchCriteriaDialog(
{Key key, this.onValueSelected, this.selectedCriteria, this.projectViewModel});
@override
_SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState();
}
class _SelectSearchCriteriaDialogState extends State<SelectSearchCriteriaDialog> {
@override
void initState() {
super.initState();
widget.selectedCriteria = widget.selectedCriteria ?? widget.searchCriteria[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Text(TranslationBase.of(context).searchCriteria),
Divider(),
...List.generate(
widget.searchCriteria.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedCriteria = widget.searchCriteria[index];
});
},
child: ListTile(
title: Text(widget.projectViewModel.isArabic ? widget.searchCriteria[index].nameAr : widget.searchCriteria[index].name),
leading: Radio(
value: widget.searchCriteria[index],
groupValue: widget.selectedCriteria,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedCriteria = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedCriteria);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -4,17 +4,17 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_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/E-Referral/referral_details.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; 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/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_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/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -23,7 +23,6 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dialogs/select_country_ingo_Dialog.dart'; import 'dialogs/select_country_ingo_Dialog.dart';
import 'dialogs/select_search_criteria_dialog.dart';
class SearchForReferralsPage extends StatefulWidget { class SearchForReferralsPage extends StatefulWidget {
SearchForReferralsPage({Key key}); SearchForReferralsPage({Key key});
@ -79,74 +78,31 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
// InkWell( CommonDropDownView(TranslationBase.of(context).selectSearchCriteria, getSearchCriteriaName(projectViewModel), () {
// onTap: () => selectSearchCriteriaDialog(), List<SearchCriteriaModel> searchCriteria = [
// child: Container( SearchCriteriaModel(name: "Identification Number", nameAr: "رقم الهوية", value: 1),
// padding: EdgeInsets.all(12), SearchCriteriaModel(name: "Referral Number", nameAr: "رقم الإحالة", value: 2),
// width: double.infinity, ];
// height: 65, List<RadioSelectionDialogModel> list = <RadioSelectionDialogModel>[];
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), for (int i = 0; i < searchCriteria.length; i++) {
// child: Row( list.add(RadioSelectionDialogModel(projectViewModel.isArabic ? searchCriteria[i].nameAr : searchCriteria[i].name, searchCriteria[i].value));
// mainAxisAlignment: MainAxisAlignment.spaceBetween, }
// children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], showDialog(
// ), context: context,
// ), child: RadioSelectionDialog(
// ), listData: list,
Container( selectedIndex: selectedCriteria.value,
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), onValueSelected: (index) {
alignment: Alignment.center, selectedCriteria = searchCriteria[index - 1];
decoration: BoxDecoration( setState(() {});
borderRadius: BorderRadius.circular(15), },
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () => selectSearchCriteriaDialog(projectViewModel),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectSearchCriteria,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSearchCriteriaName(projectViewModel),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
],
),
),
),
SizedBox(
height: 12,
),
inputWidget(selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, "", _searchTextController, isInputTypeNum: true),
SizedBox(
height: 12,
), ),
);
}).withBorderedContainer,
SizedBox(height: 12),
inputWidget(selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, "", _searchTextController,
isInputTypeNum: true),
SizedBox(height: 12),
PhoneNumberSelectorWidget(onNumberChange: (value) { PhoneNumberSelectorWidget(onNumberChange: (value) {
setState(() { setState(() {
mobileNo = value; mobileNo = value;
@ -179,9 +135,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
// }, // },
// code: _selectedCountry == null ? "11" : _selectedCountry["code"], // code: _selectedCountry == null ? "11" : _selectedCountry["code"],
// ), // ),
SizedBox( SizedBox(height: 12),
height: 12,
),
if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)), if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error), if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error),
model.allReferral.length > 0 model.allReferral.length > 0
@ -293,35 +247,9 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
return "Country"; return "Country";
} }
void selectSearchCriteriaDialog(ProjectViewModel projectViewModel) {
showDialog(
context: context,
child: SelectSearchCriteriaDialog(
selectedCriteria: selectedCriteria,
projectViewModel: projectViewModel,
onValueSelected: (value) {
setState(() {
selectedCriteria = value;
});
},
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container( return InkWell(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null, onTap: hasSelection ? () {} : null,
child: Row( child: Row(
children: [ children: [
@ -377,8 +305,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
], ],
), ),
), ).withBorderedContainer;
);
} }
String getSearchCriteriaName(ProjectViewModel projectViewModel) { String getSearchCriteriaName(ProjectViewModel projectViewModel) {

@ -237,7 +237,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
buttonCancelText: Text(TranslationBase.of(context).cancel), buttonCancelText: Text(TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey, buttonCancelColor: Colors.grey,
onlyCancelButton: true, onlyCancelButton: true,
)); ),
);
}, },
child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white), child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
), ),

@ -1,328 +0,0 @@
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SelectBloodDialog extends StatefulWidget {
final Blood bloodType;
final Function(Blood) onValueSelected;
SelectBloodDialog({Key key, this.bloodType, this.onValueSelected});
@override
_SelectBloodDialogState createState() => _SelectBloodDialogState(this.bloodType);
}
class _SelectBloodDialogState extends State<SelectBloodDialog> {
_SelectBloodDialogState(this.bloodType);
Blood bloodType;
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Container(
child: Column(
children: [
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Oplus;
});
},
child: ListTile(
title: Text("O+"),
leading: Radio(
value: Blood.Oplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Ominus;
});
},
child: ListTile(
title: Text("O-"),
leading: Radio(
value: Blood.Ominus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.ABminus;
});
},
child: ListTile(
title: Text("AB-"),
leading: Radio(
value: Blood.ABminus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.ABplus;
});
},
child: ListTile(
title: Text("AB+"),
leading: Radio(
value: Blood.ABplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Aplus;
});
},
child: ListTile(
title: Text("A+"),
leading: Radio(
value: Blood.Aplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Aminus;
});
},
child: ListTile(
title: Text("A-"),
leading: Radio(
value: Blood.Aminus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Bplus;
});
},
child: ListTile(
title: Text("B+"),
leading: Radio(
value: Blood.Bplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Bminus;
});
},
child: ListTile(
title: Text("B-"),
leading: Radio(
value: Blood.Bminus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(bloodType);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
)
],
),
)
],
);
}
}

@ -26,6 +26,7 @@ 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/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -666,14 +667,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
deleteFamily(family, context) { deleteFamily(family, context) {
ConfirmDialog dialog = new ConfirmDialog( showDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).removeFamilyMember, child: ConfirmWithMessageDialog(
okText: TranslationBase.of(context).confirm, message: TranslationBase.of(context).removeFamilyMember,
cancelText: TranslationBase.of(context).cancel_nocaps, onTap: () {
okFunction: () => {ConfirmDialog.closeAlertDialog(context), removeFamily(family, context)}, removeFamily(family, context);
cancelFunction: () => {}); },
dialog.showAlertDialog(context); ),
);
} }
removeFamily(GetAllSharedRecordsByStatusList family, context) { removeFamily(GetAllSharedRecordsByStatusList family, context) {

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.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';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -16,7 +15,7 @@ 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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -24,9 +23,6 @@ import 'package:flutter/material.dart';
import '../../../core/model/my_balance/AdvanceModel.dart'; import '../../../core/model/my_balance/AdvanceModel.dart';
import 'confirm_payment_page.dart'; import 'confirm_payment_page.dart';
import 'dialogs/SelectBeneficiaryDialog.dart';
import 'dialogs/SelectPatientFamilyDialog.dart';
import 'dialogs/SelectPatientInfoDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
@ -87,16 +83,48 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
Text( Text(
TranslationBase.of(context).advancePaymentLabel, TranslationBase.of(context).advancePaymentLabel,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.46, letterSpacing: -0.64,
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
InkWell( InkWell(
onTap: () => confirmSelectBeneficiaryDialog(model), onTap: () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).myAccount, 0),
RadioSelectionDialogModel(TranslationBase.of(context).myFamilyFiles, 1),
RadioSelectionDialogModel(TranslationBase.of(context).otherAccount, 2),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex:
beneficiaryType == BeneficiaryType.MyAccount ? 0 : (beneficiaryType == BeneficiaryType.MyFamilyFiles ? 1 : (beneficiaryType == BeneficiaryType.OtherAccount ? 2 : -1)),
onValueSelected: (index) {
var type;
if (index == 0) {
type = BeneficiaryType.MyAccount;
} else if (index == 1) {
type = BeneficiaryType.MyFamilyFiles;
} else {
type = BeneficiaryType.OtherAccount;
}
setState(() {
if (type == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
beneficiaryType = type;
});
},
),
);
},
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
@ -118,10 +146,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) if (beneficiaryType == BeneficiaryType.MyFamilyFiles) SizedBox(height: 12),
SizedBox(
height: 12,
),
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
InkWell( InkWell(
onTap: () { onTap: () {
@ -152,18 +177,13 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).fileNumber, hintText: TranslationBase.of(context).fileNumber,
controller: _fileTextController, controller: _fileTextController,
readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true, readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true,
), ),
if (beneficiaryType == BeneficiaryType.OtherAccount) if (beneficiaryType == BeneficiaryType.OtherAccount) SizedBox(height: 12),
SizedBox(
height: 12,
),
if (beneficiaryType == BeneficiaryType.OtherAccount) if (beneficiaryType == BeneficiaryType.OtherAccount)
InkWell( InkWell(
onTap: () { onTap: () {
@ -197,9 +217,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
InkWell( InkWell(
onTap: () => confirmSelectHospitalDialog(model.hospitals), onTap: () => confirmSelectHospitalDialog(model.hospitals),
child: Container( child: Container(
@ -223,9 +241,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).amount, hintText: TranslationBase.of(context).amount,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
@ -235,9 +251,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
}); });
}, },
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
if (model.user != null) if (model.user != null)
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorEmail, hintText: TranslationBase.of(context).depositorEmail,
@ -246,9 +260,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
email = value; email = value;
}, },
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).notes, hintText: TranslationBase.of(context).notes,
controller: _notesTextController, controller: _notesTextController,
@ -334,74 +346,71 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
); );
} }
void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { int _selectedHospitalIndex = -1;
showDialog(
context: context,
child: SelectBeneficiaryDialog(
beneficiaryType: beneficiaryType,
onValueSelected: (value) {
setState(() {
if (value == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
beneficiaryType = value;
});
},
),
);
}
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectHospitalDialog( child: RadioSelectionDialog(
hospitals: hospitals, listData: list,
selectedHospital: _selectedHospital, selectedIndex: _selectedHospitalIndex,
onValueSelected: (value) { isScrollable: true,
setState(() { onValueSelected: (index) {
_selectedHospital = value; _selectedHospitalIndex = index;
}); _selectedHospital = hospitals[index];
setState(() {});
}, },
), ),
); );
} }
int _selectedPatientIndex = -1;
void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) { void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < patientInfoList.length; i++) RadioSelectionDialogModel(patientInfoList[i].fullName, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectPatientInfoDialog( child: RadioSelectionDialog(
patientInfoList: patientInfoList, listData: list,
selectedPatientInfo: _selectedPatientInfo, isScrollable: true,
onValueSelected: (value) { selectedIndex: _selectedPatientIndex,
setState(() { onValueSelected: (index) {
advanceModel.depositorName = value.fullName; _selectedPatientIndex = index;
_selectedPatientInfo = value; _selectedPatientInfo = patientInfoList[index];
}); advanceModel.depositorName = _selectedPatientInfo.fullName;
setState(() {});
}, },
), ),
); );
} }
int _selectedFamilyMemberIndex = -1;
void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) { void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
if (getAllSharedRecordsByStatusList.isNotEmpty) if (getAllSharedRecordsByStatusList.isNotEmpty) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < getAllSharedRecordsByStatusList.length; i++) RadioSelectionDialogModel(getAllSharedRecordsByStatusList[i].patientName, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectPatientFamilyDialog( child: RadioSelectionDialog(
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, listData: list,
selectedPatientFamily: selectedPatientFamily, isScrollable: true,
onValueSelected: (value) { selectedIndex: _selectedFamilyMemberIndex,
setState(() { onValueSelected: (index) {
selectedPatientFamily = value; _selectedFamilyMemberIndex = index;
_fileTextController.text = selectedPatientFamily.responseID.toString(); selectedPatientFamily = getAllSharedRecordsByStatusList[index];
advanceModel.depositorName = value.patientName; setState(() {});
});
}, },
), ),
); );
} }
}
String getBeneficiaryType() { String getBeneficiaryType() {
switch (beneficiaryType) { switch (beneficiaryType) {

@ -1,204 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
import '../advance_payment_page.dart';
class SelectBeneficiaryDialog extends StatefulWidget {
final BeneficiaryType beneficiaryType;
final Function(BeneficiaryType) onValueSelected;
SelectBeneficiaryDialog({Key key, this.beneficiaryType, this.onValueSelected});
@override
_SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState(this.beneficiaryType);
}
class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
_SelectBeneficiaryDialogState(this.beneficiaryType);
BeneficiaryType beneficiaryType;
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Container(
child: Column(
children: [
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
beneficiaryType = BeneficiaryType.MyAccount;
});
},
child: ListTile(
title: Text(
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType,
activeColor: secondaryColor,
onChanged: (BeneficiaryType value) {
setState(() {
beneficiaryType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
beneficiaryType = BeneficiaryType.MyFamilyFiles;
});
},
child: ListTile(
title: Text(
TranslationBase.of(context).myFamilyFiles,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: BeneficiaryType.MyFamilyFiles,
groupValue: beneficiaryType,
activeColor: Color(0xffC5272D),
onChanged: (BeneficiaryType value) {
setState(() {
beneficiaryType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
beneficiaryType = BeneficiaryType.OtherAccount;
});
},
child: ListTile(
title: Text(
TranslationBase.of(context).otherAccount,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: BeneficiaryType.OtherAccount,
groupValue: beneficiaryType,
activeColor: Color(0xffC5272D),
onChanged: (BeneficiaryType value) {
setState(() {
beneficiaryType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Color(0xffC5272D),
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(beneficiaryType);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
),
)
],
);
}
}

@ -7,6 +7,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// todo 'sikander' remove this file when usage known
class SelectCiteisDialog extends StatefulWidget { class SelectCiteisDialog extends StatefulWidget {
final List<CitiesModel> hospitals; final List<CitiesModel> hospitals;
final Function(CitiesModel) onValueSelected; final Function(CitiesModel) onValueSelected;

@ -1,145 +0,0 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectHospitalDialog extends StatefulWidget {
final List<HospitalsModel> hospitals;
final Function(HospitalsModel) onValueSelected;
HospitalsModel selectedHospital;
SelectHospitalDialog({Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
}
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
@override
void initState() {
super.initState();
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.hospitals.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedHospital = widget.hospitals[index];
});
},
child: ListTile(
title: Text(
widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.hospitals[index],
groupValue: widget.selectedHospital,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.selectedHospital = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedHospital);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
)
],
);
}
}

@ -1,152 +0,0 @@
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectPatientFamilyDialog extends StatefulWidget {
final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
final Function(GetAllSharedRecordsByStatusList) onValueSelected;
GetAllSharedRecordsByStatusList selectedPatientFamily;
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusApprovedList = new List();
SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected, this.selectedPatientFamily});
@override
_SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState();
}
class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
@override
void initState() {
super.initState();
widget.selectedPatientFamily = widget.selectedPatientFamily ?? widget.getAllSharedRecordsByStatusList[0];
if (widget.getAllSharedRecordsByStatusList.isNotEmpty)
widget.getAllSharedRecordsByStatusList.forEach((element) {
if (element.status == 3) widget.getAllSharedRecordsByStatusApprovedList.add(element);
});
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.getAllSharedRecordsByStatusApprovedList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusApprovedList[index];
});
},
child: ListTile(
title: Text(
widget.getAllSharedRecordsByStatusApprovedList[index].patientName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.getAllSharedRecordsByStatusApprovedList[index],
groupValue: widget.selectedPatientFamily,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.selectedPatientFamily = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedPatientFamily);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
)
],
);
}
}

@ -1,146 +0,0 @@
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectPatientInfoDialog extends StatefulWidget {
final List<PatientInfo> patientInfoList;
final Function(PatientInfo) onValueSelected;
PatientInfo selectedPatientInfo;
SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected, this.selectedPatientInfo});
@override
_SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState();
}
class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
@override
void initState() {
super.initState();
widget.selectedPatientInfo = widget.selectedPatientInfo ?? widget.patientInfoList[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.patientInfoList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedPatientInfo = widget.patientInfoList[index];
});
},
child: ListTile(
title: Text(
widget.patientInfoList[index].fullName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.patientInfoList[index],
groupValue: widget.selectedPatientInfo,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.selectedPatientInfo = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedPatientInfo);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
)
],
);
}
}

@ -1,14 +1,16 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart';
import 'advance_payment_page.dart'; import 'advance_payment_page.dart';
@ -24,118 +26,156 @@ class MyBalancePage extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).myBalances, appBarTitle: TranslationBase.of(context).myWallet,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMyBalance, description: TranslationBase.of(context).infoMyBalance,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: Column(
child: Container( children: [
margin: EdgeInsets.all(12), Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.fromLTRB(14, 12, 10, 12),
decoration: BoxDecoration(
color: Color(0xff2B353E),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SvgPicture.asset(
"assets/images/new/services/balance_credit.svg",
height: 40,
width: 40,
color: Colors.white,
),
SizedBox(height: 6),
Text( Text(
TranslationBase.of(context).balanceAmount, TranslationBase.of(context).totalBalance,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, letterSpacing: -0.96,
letterSpacing: -0.46, fontWeight: FontWeight.bold,
color: Colors.white,
//height: 16/22
),
), ),
],
), ),
SizedBox(
height: 15,
), ),
Container( Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.fromLTRB(14, 10, 12, 10),
width: double.infinity,
height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[700], color: Color(0xff3f4850),
shape: BoxShape.rectangle, borderRadius: BorderRadius.all(
borderRadius: BorderRadius.circular(7), Radius.circular(10.0),
), ),
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
'${model.totalAdvanceBalanceAmount ?? 0} ' + TranslationBase.of(context).sar, double.parse(model.totalAdvanceBalanceAmount?.toString() ?? "0").toStringAsFixed(2),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 28,
fontWeight: FontWeight.w600, fontWeight: FontWeight.bold,
letterSpacing: -0.46, letterSpacing: -3.2,
height: 40 / 35,
color: Colors.white, color: Colors.white,
), ),
), ),
Text( Text(
TranslationBase.of(context).totalBalance, TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
letterSpacing: -0.46, fontWeight: FontWeight.bold,
letterSpacing: -0.96,
color: Colors.white, color: Colors.white,
), ),
), ),
], ],
), ),
), ),
SizedBox( ],
height: 9, ),
), ),
...List.generate( SizedBox(height: 12),
model.patientAdvanceBalanceAmountList.length, ListView.separated(
(index) => Container( physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.all(8), shrinkWrap: true,
height: 65, itemBuilder: (cxt, index) {
margin: EdgeInsets.only(top: 8), PatientAdvanceBalanceAmount balanceAmount = model.patientAdvanceBalanceAmountList[index];
double amount = double.parse(balanceAmount.patientAdvanceBalanceAmount?.toString() ?? "0");
return Container(
padding: EdgeInsets.fromLTRB(14, 18, 14, 18),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.all(
shape: BoxShape.rectangle, Radius.circular(10.0),
borderRadius: BorderRadius.circular(12), ),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
), ),
],
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Expanded(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + TranslationBase.of(context).sar, child: Text(
balanceAmount.projectDescription,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
fontWeight: FontWeight.w600, letterSpacing: -0.64,
letterSpacing: -0.46, fontWeight: amount > 0 ? FontWeight.bold : FontWeight.w500,
color: Color(0xff2E303A),
),
), ),
), ),
Text( Text(
model.patientAdvanceBalanceAmountList[index].projectDescription, amount.toStringAsFixed(2) + " " + TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
letterSpacing: -0.46, letterSpacing: -0.64,
fontWeight: amount > 0 ? FontWeight.bold : FontWeight.w500,
color: Color(0xff2E303A),
), ),
), ),
], ],
), ),
), );
), },
SizedBox( separatorBuilder: (cxt, index) => SizedBox(height: 12),
height: MediaQuery.of(context).size.height * 0.13, itemCount: model.patientAdvanceBalanceAmountList.length),
)
], ],
), ),
), ),
), ),
bottomSheet: Container( DefaultButton(
// height: MediaQuery.of(context).size.height * 0.12,
height: 70.0,
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(12),
child: DefaultButton(
// textColor: Colors.white,
// color: CustomColors.accentColor,
TranslationBase.of(context).createAdvancedPayment, TranslationBase.of(context).createAdvancedPayment,
() { () {
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));
}, },
), ).insideContainer,
],
), ),
), ),
); );

@ -9,7 +9,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.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';
@ -280,24 +280,6 @@ class _AddWeightPageState extends State<AddWeightPage> {
return " ${timeWeightDate.hour}:${timeWeightDate.minute}"; return " ${timeWeightDate.hour}:${timeWeightDate.minute}";
} }
void confirmSelectMeasureTimeDialog(List<String> list) {
showDialog(
context: context,
child: RadioStringDialog(
radioList: list,
title: TranslationBase.of(context).measureUnit,
selectedValue: measureTimeSelectedType,
onValueSelected: (value) {
setState(() {
measureTimeSelectedType = value;
weightUnit = list.indexOf(value);
validateForm();
});
},
),
);
}
void validateForm() { void validateForm() {
if (_weightValueController.text.length > 0 && measureTimeSelectedType != null) { if (_weightValueController.text.length > 0 && measureTimeSelectedType != null) {
setState(() { setState(() {

@ -6,10 +6,8 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; 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/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.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';
@ -119,9 +117,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
}, },
), ),
); );
return;
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -277,24 +272,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
} }
void confirmSelectMeasureTimeDialog(List<String> list) {
showDialog(
context: context,
child: RadioStringDialog(
radioList: list,
title: TranslationBase.of(context).selectArm,
selectedValue: measureTimeSelectedType,
onValueSelected: (value) {
setState(() {
measureTimeSelectedType = value;
measuredArm = list.indexOf(value);
validateForm();
});
},
),
);
}
void validateForm() { void validateForm() {
print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
if (_bloodSystolicValueController.text.length > 0 && _bloodDiastolicValueController.text.length > 0) { if (_bloodSystolicValueController.text.length > 0 && _bloodDiastolicValueController.text.length > 0) {

@ -8,8 +8,8 @@ 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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,6 +41,8 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
String measureUnitSelectedType = 'mg/dlt'; String measureUnitSelectedType = 'mg/dlt';
int measuredTime = 1; int measuredTime = 1;
bool isButtonDisabled = true; bool isButtonDisabled = true;
int _selectedMeasureUnitIndex = 0;
final List<String> measureUnitList = ['mg/dlt', 'mol/L']; final List<String> measureUnitList = ['mg/dlt', 'mol/L'];
final List<String> measureTimeEnList = [ final List<String> measureTimeEnList = [
'Before Breakfast', 'Before Breakfast',
@ -66,6 +68,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
"صائم", "صائم",
"آخر", "آخر",
]; ];
int _selectedMeasureTimeIndex;
String measureTimeSelectedType; String measureTimeSelectedType;
@override @override
@ -92,15 +95,14 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
body: SingleChildScrollView( body: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( padding: EdgeInsets.all(21),
margin: EdgeInsets.all(15),
child: Column( child: Column(
children: [ children: [
SizedBox(
height: 15,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).sugarAdd, hintText: TranslationBase.of(context).sugarAdd,
controller: _bloodSugarValueController, controller: _bloodSugarValueController,
@ -109,9 +111,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 14, fontSize: 14,
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureUnitDialog(); confirmSelectMeasureUnitDialog();
@ -133,9 +133,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
@ -158,9 +156,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
@ -180,9 +176,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
@ -218,14 +212,11 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
color: Colors.red[900], color: Colors.red[900],
), ),
onTap: () { onTap: () {
ConfirmDialog dialog = new ConfirmDialog( showDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).removeMeasure, child: ConfirmWithMessageDialog(
okText: TranslationBase.of(context).ok, message: TranslationBase.of(context).removeMeasure,
cancelText: TranslationBase.of(context).cancel, onTap: () async {
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) { widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -238,23 +229,20 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
}); });
}, },
cancelFunction: () => {}); ),
dialog.showAlertDialog(context); );
}, },
) )
], ],
)) ),
)
: Container() : Container()
], ],
), ),
), ),
), ),
bottomSheet: Container( DefaultButton(
color: Theme.of(context).scaffoldBackgroundColor, TranslationBase.of(context).save,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(
TranslationBase.of(context).save.toUpperCase(),
isButtonDisabled isButtonDisabled
? null ? null
: () async { : () async {
@ -291,9 +279,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
} }
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
).insideContainer,
],
), ),
), );
));
} }
String getDate() { String getDate() {
@ -305,33 +294,41 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
} }
void confirmSelectMeasureUnitDialog() { void confirmSelectMeasureUnitDialog() {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("mg/dlt", 0),
RadioSelectionDialogModel("mol/L", 1),
];
showDialog( showDialog(
context: context, context: context,
child: RadioStringDialog( child: RadioSelectionDialog(
radioList: measureUnitList, listData: list,
title: TranslationBase.of(context).measureUnit, selectedIndex: _selectedMeasureUnitIndex,
selectedValue: measureUnitSelectedType, onValueSelected: (index) {
onValueSelected: (value) { _selectedMeasureUnitIndex = index;
setState(() { measureUnitSelectedType = list[index].title;
measureUnitSelectedType = value; setState(() {});
});
}, },
), ),
); );
} }
void confirmSelectMeasureTimeDialog(List<String> list) { void confirmSelectMeasureTimeDialog(List<String> dataList) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < dataList.length; i++) RadioSelectionDialogModel(dataList[i], i),
];
showDialog( showDialog(
context: context, context: context,
child: RadioStringDialog( child: RadioSelectionDialog(
radioList: list, listData: list,
title: TranslationBase.of(context).measureTime, selectedIndex: _selectedMeasureTimeIndex,
selectedValue: measureTimeSelectedType, isScrollable: true,
onValueSelected: (value) { onValueSelected: (index) {
setState(() { _selectedMeasureTimeIndex = index;
measureTimeSelectedType = value; measureTimeSelectedType = list[index].title;
measuredTime = list.indexOf(value); measuredTime = index;
}); setState(() {});
}, },
), ),
); );

@ -795,6 +795,8 @@ class TranslationBase {
String get myBalances => localizedValues['MyBalances'][locale.languageCode]; String get myBalances => localizedValues['MyBalances'][locale.languageCode];
String get myWallet => localizedValues['MyWallet'][locale.languageCode];
String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode]; String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode];
String get totalBalance => localizedValues['TotalBalance'][locale.languageCode]; String get totalBalance => localizedValues['TotalBalance'][locale.languageCode];

@ -1,139 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RadioStringDialog extends StatefulWidget {
final List<String> radioList;
final Function(String) onValueSelected;
final String title;
String selectedValue;
RadioStringDialog({Key key, this.radioList, this.onValueSelected, this.selectedValue, this.title});
@override
_RadioStringDialogState createState() => _RadioStringDialogState();
}
class _RadioStringDialogState extends State<RadioStringDialog> {
@override
void initState() {
super.initState();
widget.selectedValue = widget.selectedValue ?? widget.radioList[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: Container(
width: double.infinity,
child: Center(
child: Texts(
widget.title,
textAlign: TextAlign.center,
))),
children: [
Container(
height: widget.radioList.length > 3 ? MediaQuery.of(context).size.height * 0.6 : null,
child: SingleChildScrollView(
child: Column(
children: [
Divider(),
...List.generate(
widget.radioList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(
// height: 2,
// ),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedValue = widget.radioList[index];
});
},
child: ListTile(
title: Texts(
widget.radioList[index],
fontSize: 14,
),
leading: Radio(
value: widget.radioList[index],
groupValue: widget.selectedValue,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedValue = value;
});
},
),
),
),
)
],
),
],
),
),
SizedBox(
height: 5.0,
),
],
),
),
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedValue);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
)
],
);
}
}
Loading…
Cancel
Save