From 5943522163e2c5f9bd3165b89997299b0d11ed86 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 Nov 2021 12:58:54 +0300 Subject: [PATCH] UI fixes --- lib/pages/Blood/blood_donation.dart | 39 ++- .../widgets/home/PrescriptionsWidget.dart | 248 +++++++++--------- .../pharmacy/bottom_nav_pharmacy_item.dart | 2 +- 3 files changed, 135 insertions(+), 154 deletions(-) diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index e0c6bfe7..db96a5a1 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -38,9 +38,6 @@ class _BloodDonationPageState extends State { TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; - // Gender gender = Gender.Male; //Gender.NON; - // Blood blood = Blood.Aminus; //Blood.NON; - //HospitalsModel _selectedHospital; CitiesModel _selectedHospital; int _selectedHospitalIndex = 0; @@ -80,7 +77,6 @@ class _BloodDonationPageState extends State { cityID = element.iD; } }); - return cityID; } @@ -90,20 +86,22 @@ class _BloodDonationPageState extends State { return BaseView( onModelReady: (model) { - model.getCities().then((value) { - model.getBlood().then((value) { - if (model.bloodModelList.length > 0) { - CitiesModel citiesModel = new CitiesModel(); - citiesModel.iD = getSelectedCityID(model); - _selectedHospitalIndex = (citiesModel.iD - 1); - citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; - citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; - _selectedHospital = citiesModel; - } else { - _selectedHospital = model.CitiesModelList[0]; - } + if (projectProvider.isLogin) { + model.getCities().then((value) { + model.getBlood().then((value) { + if (model.bloodModelList.length > 0) { + CitiesModel citiesModel = new CitiesModel(); + citiesModel.iD = getSelectedCityID(model); + _selectedHospitalIndex = (citiesModel.iD - 1); + citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; + citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; + _selectedHospital = citiesModel; + } else { + _selectedHospital = model.CitiesModelList[0]; + } + }); }); - }); + } }, builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -130,12 +128,7 @@ class _BloodDonationPageState extends State { ), SizedBox(height: 12), if (projectProvider.isLogin && model.state != ViewState.Busy) - CommonDropDownView( - TranslationBase.of(context).city, - // (model.bloodModelList.isNotEmpty && model.CitiesModelList.isNotEmpty) - // ? model.bloodModelList[0].city - // : - projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description, () { + CommonDropDownView(TranslationBase.of(context).city, projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description, () { List list = [ for (int i = 0; i < model.CitiesModelList.length; i++) RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), diff --git a/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart b/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart index fabab916..ab278984 100644 --- a/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart +++ b/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart @@ -13,9 +13,7 @@ import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class PrescriptionsWidget extends StatelessWidget { - - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); @override Widget build(BuildContext context) { @@ -36,157 +34,147 @@ class PrescriptionsWidget extends StatelessWidget { ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()), Container( margin: EdgeInsets.only(right: 10.0, left: 10.0), - height: MediaQuery.of(context).size.height * 0.18, + height: MediaQuery.of(context).size.height * 0.2, child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model.prescriptionsList.length, - itemBuilder: (context, index) { - return Container( - padding: EdgeInsets.only(left: 8.0, right: 8.0), - margin: EdgeInsets.only(right: 5.0, left: 5.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey, - style: BorderStyle.solid, - width: 1.0, + scrollDirection: Axis.horizontal, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model.prescriptionsList.length, + itemBuilder: (context, index) { + return Container( + padding: EdgeInsets.only(left: 8.0, right: 8.0), + margin: EdgeInsets.only(right: 5.0, left: 5.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0, + ), + color: Colors.white, + borderRadius: BorderRadius.circular(10.0)), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Container( + padding: EdgeInsets.only( + top: 10.0, + left: 10.0, + right: 10.0, + bottom: 10.0, + ), + child: CircleAvatar( + radius: 30, + backgroundColor: Colors.transparent, + child: Image.network( + model.prescriptionsList[index].doctorImageURL, + width: 50, + height: 50, + ), + ), ), - color: Colors.white, - borderRadius: BorderRadius.circular(10.0)), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Column(children: [ + Column( + children: [ Container( - padding: EdgeInsets.only( - top: 10.0, - left: 10.0, - right: 10.0, - bottom: 10.0, - ), - child: CircleAvatar( - radius: 30, - backgroundColor: Colors.transparent, - child: Image.network( - model.prescriptionsList[index].doctorImageURL, - width: 60, - height: 60, - ), - ), - ), - ]), - Column( - children: [ - Container( - margin: EdgeInsets.only(left: 1), - padding: EdgeInsets.only(left: 15.0, right: 15.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 3.0, - ), + padding: EdgeInsets.only(left: 15.0, right: 15.0), + decoration: BoxDecoration( + border: Border.all( color: Colors.green, - borderRadius: BorderRadius.circular(30.0)), - child: Text( - model.languageID == "ar" - ? model.prescriptionsList[index].isInOutPatientDescriptionN.toString() - : model.prescriptionsList[index].isInOutPatientDescription.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, + style: BorderStyle.solid, + width: 3.0, ), - )), - Row(children: [ - Image.asset( - 'assets/images/Icon-awesome-calendar.png', - width: 30, - height: 30, - ), - Text( - DateUtil.convertStringToDate(model.prescriptionsList[index].appointmentDate.toString()).toString().substring(0, 10), + color: Colors.green, + borderRadius: BorderRadius.circular(30.0)), + child: Text( + model.languageID == "ar" + ? model.prescriptionsList[index].isInOutPatientDescriptionN.toString() + : model.prescriptionsList[index].isInOutPatientDescription.toString(), style: TextStyle( - color: Colors.black, + color: Colors.white, fontSize: 15.0, ), - ) - ]), - ], - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Row(children: [ - Text( - model.prescriptionsList[index].doctorTitle.toString(), - style: TextStyle( - color: Colors.black, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), + )), + Row(children: [ + Image.asset( + 'assets/images/Icon-awesome-calendar.png', + width: 30, + height: 30, ), Text( - model.prescriptionsList[index].doctorName.toString(), + DateUtil.convertStringToDate(model.prescriptionsList[index].appointmentDate.toString()).toString().substring(0, 10), style: TextStyle( color: Colors.black, fontSize: 15.0, - fontWeight: FontWeight.bold, ), - ), + ) ]), + ], + ), + ], + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Row(children: [ + Text( + model.prescriptionsList[index].doctorTitle.toString(), + style: TextStyle( + color: Colors.black, + fontSize: 15.0, + fontWeight: FontWeight.bold, ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text( - model.prescriptionsList[index].clinicDescription.toString(), - style: TextStyle( - color: Colors.green, - fontSize: 15.0, -// fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - Row(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(), -// initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), + ), + Text( + model.prescriptionsList[index].doctorName.toString(), + style: TextStyle( + color: Colors.black, + fontSize: 15.0, + fontWeight: FontWeight.bold, ), - ) + ), ]), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + model.prescriptionsList[index].clinicDescription.toString(), + style: TextStyle( + color: Colors.green, + fontSize: 15.0, + ), + ), + ), + Row(children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: RatingBar.readOnly( + initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + SizedBox( + width: 100.0, + ), + Container( + child: Icon( + Icons.arrow_forward, + color: Theme.of(context).primaryColor, + )), ]), - ); - }), + ]), + ); + }, + ), ), ], ), ), ) - : Container( - ), + : Container(), ); } } diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart index 6e6a5f53..9731f2b1 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart @@ -96,7 +96,7 @@ class BottomNavPharmacyItem extends StatelessWidget { fontWeight: currentIndex == index ? FontWeight.normal : FontWeight.w400, - fontSize: currentIndex == index ? 13 : 11, + fontSize: currentIndex == index ? 11 : 9, ), ], ),