Merge branch 'haroon-new-design' into 'development_new_design_2.0'

Haroon new design

See merge request Cloud_Solution/diplomatic-quarter!460
merge-requests/461/merge
haroon amjad 5 years ago
commit d38de8c494

@ -421,7 +421,7 @@ const Map localizedValues = {
"country": {"en": "Country", "ar": "دولة"}, "country": {"en": "Country", "ar": "دولة"},
"Ok": {"en": "Ok", "ar": "موافق"}, "Ok": {"en": "Ok", "ar": "موافق"},
"averageWaitingTime": {"en": "Average Waiting Time:", "ar": "متوسط ​​وقت الانتظار:"}, "averageWaitingTime": {"en": "Average Waiting Time:", "ar": "متوسط ​​وقت الانتظار:"},
"waitingTime": {"en": "Waiting Time:", "ar": "وقت الانتظار:"}, "waitingTime": {"en": "Expected waiting time:", "ar": "وقت الانتظار المتوقع:"},
"WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"}, "WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"},
"WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"}, "WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"},
"TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires in", "ar": "تنتهي صلاحية رمز التحقق في"}, "TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires in", "ar": "تنتهي صلاحية رمز التحقق في"},

@ -22,7 +22,7 @@ class BloodDetailsService extends BaseService{
BloodModelList.add(List_BloodGroupDetailsModel.fromJson(vital)); BloodModelList.add(List_BloodGroupDetailsModel.fromJson(vital));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; // hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }

@ -32,7 +32,7 @@ class MyBalanceViewModel extends BaseViewModel {
_bloodDonationService.CitiesModelList; _bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService = locator<BloodDetailsService>(); BloodDetailsService _bloodDetailsService = locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList => List<List_BloodGroupDetailsModel> get bloodDetailsModelList =>
_bloodDetailsService _bloodDetailsService
.BloodModelList; //_bloodDonationService.CitiesModelList; .BloodModelList; //_bloodDonationService.CitiesModelList;
@ -52,6 +52,9 @@ class MyBalanceViewModel extends BaseViewModel {
PatientInfoAndMobileNumber get patientInfoAndMobileNumber => PatientInfoAndMobileNumber get patientInfoAndMobileNumber =>
_myBalanceService.patientInfoAndMobileNumber; _myBalanceService.patientInfoAndMobileNumber;
List<List_BloodGroupDetailsModel> get bloodModelList =>
_bloodDetailsService.BloodModelList;
String get logInTokenID => _myBalanceService.logInTokenID; String get logInTokenID => _myBalanceService.logInTokenID;
String get verificationCode => _myBalanceService.verificationCode; String get verificationCode => _myBalanceService.verificationCode;

@ -228,4 +228,4 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
enum PaymentOption { meda, sadad, visa, mastercard, installments } enum PaymentOption { meda, sadad, visa, mastercard, installments, applepay }

@ -77,7 +77,6 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
width: 350.0, width: 350.0,
child: Text( child: Text(
TranslationBase.of(context).convertCholesterolStatement, TranslationBase.of(context).convertCholesterolStatement,
//textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 20.0),
), ),
), ),
@ -90,7 +89,6 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0), padding: const EdgeInsets.symmetric(horizontal: 15.0),

@ -50,18 +50,23 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
children: [ children: [
TabBar( TabBar(
controller: _tabController, controller: _tabController,
isScrollable: true, indicatorWeight: 3.0,
indicatorWeight: 4.0, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red, labelColor: Color(0xff2B353E),
labelColor: Theme.of(context).buttonColor, unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
unselectedLabelColor: Colors.grey,
labelStyle: TextStyle( labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: <Widget>[ tabs: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
@ -14,6 +13,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.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/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';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -26,10 +26,6 @@ import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dialogs/SelectBeneficiaryDialog.dart';
import 'dialogs/SelectPatientFamilyDialog.dart';
import 'dialogs/SelectPatientInfoDialog.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
enum Gender { Male, Female, NON } enum Gender { Male, Female, NON }
enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
@ -73,7 +69,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'),
); );
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectProvider.isLogin) getAuthUser(); if (projectProvider.isLogin) authUser = projectProvider.user;
}); });
super.initState(); super.initState();
} }
@ -83,7 +79,10 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getCities(), //model.getHospitals(), onModelReady: (model) {
model.getCities();
model.getBlood();
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
@ -109,11 +108,11 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView( CommonDropDownView(
TranslationBase.of(context).city, TranslationBase.of(context).city,
model.CitiesModelList.isNotEmpty model.bloodModelList.isNotEmpty
? projectProvider.isArabic ? model.bloodModelList[0].city
: projectProvider.isArabic
? model.CitiesModelList[_selectedHospitalIndex].descriptionN ? model.CitiesModelList[_selectedHospitalIndex].descriptionN
: model.CitiesModelList[_selectedHospitalIndex].description : model.CitiesModelList[_selectedHospitalIndex].description, () {
: "", () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < model.CitiesModelList.length; i++) for (int i = 0; i < model.CitiesModelList.length; i++)
RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),
@ -152,7 +151,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
); );
}).withBorderedContainer, }).withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).bloodType, getBlood(_selectedBloodTypeIndex), () { CommonDropDownView(TranslationBase.of(context).bloodType, model.bloodModelList.isNotEmpty ? model.bloodModelList[0].bloodGroup : getBlood(_selectedBloodTypeIndex), () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("O+", 0), RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1), RadioSelectionDialogModel("O-", 1),
@ -253,7 +252,10 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
), ),
), ),
DefaultButton(TranslationBase.of(context).save, () async { DefaultButton(
TranslationBase.of(context).save,
checkedValue
? () async {
if (_selectedHospital == null) { if (_selectedHospital == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return; return;
@ -268,82 +270,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} }
}).insideContainer
],
),
),
);
} }
: null,
void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { disabledColor: CustomColors.grey2,
showDialog( ).insideContainer
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 confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
showDialog(
context: context,
child: SelectPatientInfoDialog(
patientInfoList: patientInfoList,
selectedPatientInfo: _selectedPatientInfo,
onValueSelected: (value) {
setState(() {
advanceModel.depositorName = value.fullName;
_selectedPatientInfo = value;
});
},
), ),
); );
} }
void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
showDialog(
context: context,
child: SelectPatientFamilyDialog(
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList,
selectedPatientFamily: selectedPatientFamily,
onValueSelected: (value) {
setState(() {
selectedPatientFamily = value;
_fileTextController.text = selectedPatientFamily.patientID.toString();
advanceModel.depositorName = value.patientName;
});
},
),
);
}
String getBeneficiaryType() {
switch (beneficiaryType) {
case BeneficiaryType.MyAccount:
return TranslationBase.of(context).myAccount;
case BeneficiaryType.MyFamilyFiles:
return TranslationBase.of(context).myFamilyFiles;
break;
case BeneficiaryType.OtherAccount:
return TranslationBase.of(context).otherAccount;
break;
case BeneficiaryType.NON:
return TranslationBase.of(context).selectBeneficiary;
}
return TranslationBase.of(context).selectBeneficiary;
}
String getBlood(int index) { String getBlood(int index) {
switch (index) { switch (index) {
case 0: case 0:
@ -384,32 +320,5 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
else else
return TranslationBase.of(context).selectCity; return TranslationBase.of(context).selectCity;
// return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
}
String getPatientName() {
if (_selectedPatientInfo != null)
return _selectedPatientInfo.fullName;
else
return TranslationBase.of(context).selectPatientName;
}
getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
} }
}
String getFamilyMembersName() {
if (selectedPatientFamily != null)
return selectedPatientFamily.patientName;
else
return TranslationBase.of(context).selectFamilyPatientName;
}
//================
} }

@ -193,7 +193,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.text,
controller: _controller, controller: _controller,
onChanged: (value) => {_onDocTextChanged(value)}, onChanged: (value) => {_onDocTextChanged(value)},
style: TextStyle( style: TextStyle(

@ -60,7 +60,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
color: Colors.white, color: Colors.white,
gradient: LinearGradient( gradient: LinearGradient(
colors: model.babyInformationModelList[index].gender == 1 colors: model.babyInformationModelList[index].gender == 2
? [ ? [
Color(0xFFFDA4B0), Color(0xFFFDA4B0),
Color(0xFFFBC8CC), Color(0xFFFBC8CC),
@ -94,7 +94,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
), ),
), ),
Text( Text(
model.babyInformationModelList[index].gender == 1 ? TranslationBase.of(context).female : TranslationBase.of(context).male, model.babyInformationModelList[index].genderDescription,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
color: selectedColor, color: selectedColor,

@ -5,7 +5,6 @@ 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/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function onSelectedMethod;
@ -37,7 +36,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0), margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0),
child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
@ -119,16 +117,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/visa.png"), child: Image.asset("assets/images/new/payment/visa.png"),
), ),
// mWidth(12),
// Text(
// "VISA",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// )
// ,
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "VISA") if (selectedPaymentMethod == "VISA")
Container( Container(
@ -178,15 +166,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/Mastercard.png"), child: Image.asset("assets/images/new/payment/Mastercard.png"),
), ),
// mWidth(12),
// Text(
// "MasterCard",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "MASTERCARD") if (selectedPaymentMethod == "MASTERCARD")
Container( Container(
@ -236,15 +215,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/installments.png"), child: Image.asset("assets/images/new/payment/installments.png"),
), ),
// mWidth(12),
// Text(
// "Installments",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "Installment") if (selectedPaymentMethod == "Installment")
Container( Container(
@ -295,15 +265,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new/payment/Apple_Pay.png"), child: Image.asset("assets/images/new/payment/Apple_Pay.png"),
), ),
// mWidth(12),
// Text(
// "Apple Pay",
// style: TextStyle(
// color: Colors.black,
// fontSize: 14,
// fontWeight: FontWeight.bold,
// ),
// ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "ApplePay") if (selectedPaymentMethod == "ApplePay")
Container( Container(
@ -323,40 +284,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
) )
// Container(
// margin: EdgeInsets.only(top: 25.0),
// child: Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("ApplePay");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(20.0),
// child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
// ),
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// )
: Container(), : Container(),
SizedBox( SizedBox(
height: 150.0, height: 150.0,

@ -107,7 +107,7 @@ class ServicesView extends StatelessWidget {
FadePage(page: ChildInitialPage()), FadePage(page: ChildInitialPage()),
); );
} else if (index == 15) { } else if (index == 15) {
Navigator.pop(context); // Navigator.pop(context);
LandingPage.shared.switchToDoFromHMGServices(); LandingPage.shared.switchToDoFromHMGServices();
} else if (index == 16) { } else if (index == 16) {
Navigator.push( Navigator.push(

@ -62,10 +62,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Flexible( Flexible(
// margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider( child: CarouselSlider(
carouselController: buttonCarouselController, carouselController: buttonCarouselController,
options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.65), options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) { items: [1, 2].map((i) {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {

@ -178,7 +178,10 @@ class _PackagesCartPageState extends State<PackagesCartPage>
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0), padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: getPaymentMethods(), // child: getPaymentMethods(),
child: _paymentOptions(context, (paymentMethod) {
setState(() => _selectedPaymentMethod = paymentMethod);
}),
), ),
Container( Container(
height: 0.25, height: 0.25,

@ -1,26 +1,10 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class SelectPaymentOptionWidget extends StatefulWidget { class SelectPaymentOptionWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
@ -28,21 +12,18 @@ class SelectPaymentOptionWidget extends StatefulWidget {
SelectPaymentOptionWidget(this.model); SelectPaymentOptionWidget(this.model);
@override @override
_SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState();
_SelectPaymentOptionWidgetState();
} }
class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> { class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
PaymentOption paymentOption; PaymentOption paymentOption;
_navigateToPaymentOption() { _navigateToPaymentOption() {
Navigator.push(context, FadePage(page: PaymentMethodSelectPage())) Navigator.push(context, FadePage(page: PaymentMethodSelectPage())).then((result) => {
.then((result) => {
setState(() { setState(() {
if (result != null) { if (result != null) {
paymentOption = result; paymentOption = result;
widget.model.paymentCheckoutData.paymentOption = widget.model.paymentCheckoutData.paymentOption = paymentOption;
paymentOption;
} }
}) })
}); });
@ -75,8 +56,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6),
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
child: Texts( child: Texts(
TranslationBase.of(context).selectPaymentOption, TranslationBase.of(context).selectPaymentOption,
fontSize: 14, fontSize: 14,

@ -1,14 +1,16 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.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/borderedButton.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PaymentMethodSelectPage extends StatefulWidget { class PaymentMethodSelectPage extends StatefulWidget {
@override @override
_PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState();
_PaymentMethodSelectPageState();
} }
class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> { class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
@ -20,8 +22,9 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
double cardWidth = screenSize.width / 2 - 32; double cardWidth = screenSize.width / 2 - 32;
return AppScaffold( return AppScaffold(
title: "Payment method", appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
@ -30,18 +33,18 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Center( Center(
child: Texts( child: Text(
TranslationBase.of(context).selectPaymentOption, TranslationBase.of(context).selectPaymentOption,
style: TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
), ),
), ),
),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 0, vertical: 16),
child: Column( child: Column(
children: [
Row(
children: [ children: [
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
@ -55,45 +58,38 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption,
PaymentOption.sadad, PaymentOption.visa,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = PaymentOption.sadad; selectedPaymentOption = PaymentOption.visa;
}) })
}), }),
],
),
Row(
children: [
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption,
PaymentOption.visa, PaymentOption.mastercard,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = PaymentOption.visa; selectedPaymentOption = PaymentOption.mastercard;
}) })
}), }),
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption,
PaymentOption.mastercard, PaymentOption.installments,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = selectedPaymentOption = PaymentOption.installments;
PaymentOption.mastercard;
}) })
}), }),
], if (Platform.isIOS)
),
PaymentMethodCard( PaymentMethodCard(
(cardWidth * 2 + 32), cardWidth,
selectedPaymentOption, selectedPaymentOption,
PaymentOption.installments, PaymentOption.applepay,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = selectedPaymentOption = PaymentOption.applepay;
PaymentOption.installments;
}) })
}), }),
], ],
@ -103,18 +99,12 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: screenSize.height * 0.08, color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 20),
child: BorderedButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
backgroundColor: Color(0xff5AB154), selectedPaymentOption != null ? () => {Navigator.pop(context, selectedPaymentOption)} : null,
textColor: Colors.white, color: Color(0xff5AB154),
fontSize: 16,
hPadding: 8,
vPadding: 12,
handler: selectedPaymentOption != null
? () => {Navigator.pop(context, selectedPaymentOption)}
: null,
), ),
), ),
); );
@ -127,61 +117,102 @@ class PaymentMethodCard extends StatelessWidget {
final PaymentOption paymentOption; final PaymentOption paymentOption;
final Function selectMethod; final Function selectMethod;
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod);
this.paymentOption, this.selectMethod);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isSelected = false; bool isSelected = false;
if (selectedPaymentOption != null && if (selectedPaymentOption != null && selectedPaymentOption == paymentOption) {
selectedPaymentOption == paymentOption) {
isSelected = true; isSelected = true;
} }
return InkWell( return Container(
width: MediaQuery.of(context).size.width * 0.99,
child: InkWell(
onTap: selectMethod, onTap: selectMethod,
child: Container( child: Card(
margin: EdgeInsets.symmetric(horizontal: 2, vertical: 0), elevation: 0.0,
child: Stack( margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: isSelected ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), width: 24,
margin: EdgeInsets.symmetric(horizontal: 14, vertical: 8), height: 24,
decoration: new BoxDecoration( decoration: containerColorRadiusBorderWidth(isSelected ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
color: Colors.grey.shade100,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide(
color: isSelected ? Color(0xff20BC11) : Colors.grey.shade300,
width: 0.8,
)),
),
width: cardWidth,
child: Image.asset(
getPaymentOptionImage(paymentOption),
fit: BoxFit.cover,
), ),
mWidth(12),
Container(
height: 70.0,
width: 70.0,
child: Image.asset(getPaymentOptionImage(paymentOption)),
), ),
mFlex(1),
if (isSelected) if (isSelected)
Positioned( Container(
right: 1, decoration: containerRadius(CustomColors.green, 200),
child: Icon( padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
Icons.check_circle, child: Text(
color: Color(0xff20BC11), TranslationBase.of(context).paymentSelected,
size: 30, style: TextStyle(
color: Colors.white,
fontSize: 11,
),
), ),
), ),
], ],
), ),
), ),
),
// Container(
// margin: EdgeInsets.symmetric(horizontal: 2, vertical: 0),
// child: Stack(
// children: [
// Container(
// padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
// margin: EdgeInsets.symmetric(horizontal: 14, vertical: 8),
// decoration: new BoxDecoration(
// color: Colors.grey.shade100,
// shape: BoxShape.rectangle,
// borderRadius: BorderRadius.circular(8),
// border: Border.fromBorderSide(BorderSide(
// color: isSelected ? Color(0xff20BC11) : Colors.grey.shade300,
// width: 0.8,
// )),
// ),
// width: cardWidth,
// child: Image.asset(
// getPaymentOptionImage(paymentOption),
// fit: BoxFit.cover,
// ),
// ),
// if (isSelected)
// Positioned(
// right: 1,
// child: Icon(
// Icons.check_circle,
// color: Color(0xff20BC11),
// size: 30,
// ),
// ),
// ],
// ),
// ),
),
); );
} }
String getPaymentOptionImage(PaymentOption paymentOption) { String getPaymentOptionImage(PaymentOption paymentOption) {
String assetFile = "assets/images/pharmacy_module/payment/"; String assetFile = "assets/images/new/payment/";
switch (paymentOption.index) { switch (paymentOption.index) {
case 0: case 0:
return "${assetFile}mada.png"; return "${assetFile}Mada.png";
break; break;
case 1: case 1:
return "${assetFile}sadad.png"; return "${assetFile}sadad.png";
@ -190,10 +221,13 @@ class PaymentMethodCard extends StatelessWidget {
return "${assetFile}visa.png"; return "${assetFile}visa.png";
break; break;
case 3: case 3:
return "${assetFile}mastercard.png"; return "${assetFile}Mastercard.png";
break; break;
case 4: case 4:
return "${assetFile}installment.png"; return "${assetFile}installments.png";
break;
case 5:
return "${assetFile}Apple_Pay.png";
break; break;
default: default:
return ""; return "";

@ -1,4 +1,3 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
@ -7,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dar
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -14,9 +14,7 @@ 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:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import '../../text.dart';
import 'FlowChartPage.dart'; import 'FlowChartPage.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
@ -81,6 +79,14 @@ class LabResultWidget extends StatelessWidget {
), ),
) )
: Container(), : Container(),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Divider(
height: 1,
color: Color(0xff2E303A),
thickness: 1,
),
),
], ],
), ),
); );
@ -152,10 +158,10 @@ class LabResultWidget extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnTitle(TranslationBase.of(context).description), Utils.tableColumnTitle(TranslationBase.of(context).description, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).value), Utils.tableColumnTitle(TranslationBase.of(context).value, showDivider: false),
Utils.tableColumnTitle(TranslationBase.of(context).range), Utils.tableColumnTitle(TranslationBase.of(context).range, showDivider: false),
Utils.tableColumnTitle(""), Utils.tableColumnTitle("", showDivider: false),
], ],
), ),
); );

Loading…
Cancel
Save