diff --git a/android/app/build.gradle b/android/app/build.gradle index 19d22b13..759fa6a7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -41,7 +41,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cloud.diplomaticquarterapp" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt index bebd0101..ceecd65b 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -68,12 +68,12 @@ class HMGUtils { } } - fun getGeoZonesFromPreference(context: Context):List{ + fun getGeoZonesFromPreference(context: Context): List { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val json = pref.getString(PREF_KEY_HMG_ZONES,"[]") - val geoZones = GeoZoneModel().listFrom(json) - return geoZones + val geoZones = json?.let { GeoZoneModel().listFrom(it) } + return geoZones!! } } diff --git a/assets/images/DQ/logo.png b/assets/images/DQ/logo.png new file mode 100644 index 00000000..29719b35 Binary files /dev/null and b/assets/images/DQ/logo.png differ diff --git a/assets/images/DQ/logo_big.png b/assets/images/DQ/logo_big.png new file mode 100644 index 00000000..0d9e4a56 Binary files /dev/null and b/assets/images/DQ/logo_big.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 29d5e061..fa7893d5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -329,7 +329,7 @@ const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; const GET_ORDER = "orders?"; -const GET_ORDER_DETAILS = "epharmacy/api/orders/"; +const GET_ORDER_DETAILS = "orders/"; const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 05193cd9..69e4ef25 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -177,6 +177,7 @@ const Map localizedValues = { 'ar': 'ابحث عن الدواء هنا' }, 'description': {'en': 'Description', 'ar': 'الوصف'}, + 'howToUse': {'en': 'How to Use', 'ar': 'طريقة الأستخدام'}, 'price': {'en': 'Price', 'ar': 'السعر'}, 'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'}, 'pleaseEnterMedicineName': { diff --git a/lib/core/model/pharmacies/orders_model.dart b/lib/core/model/pharmacies/orders_model.dart index aaddf6f4..a97bda98 100644 --- a/lib/core/model/pharmacies/orders_model.dart +++ b/lib/core/model/pharmacies/orders_model.dart @@ -29,6 +29,9 @@ class Orders { int orderStatusId; String orderStatus; String orderStatusn; + bool canCancel; + bool canRefund; + dynamic customerId; Orders( {this.id, @@ -37,7 +40,10 @@ class Orders { this.createdOnUtc, this.orderStatusId, this.orderStatus, - this.orderStatusn}); + this.orderStatusn, + this.canCancel, + this.canRefund, + this.customerId,}); Orders.fromJson(Map json) { try { @@ -48,6 +54,9 @@ class Orders { orderStatusId = json['order_status_id']; orderStatus = json['order_status']; orderStatusn = json['order_statusn']; + canCancel = json['can_cancel']; + canRefund = json['can_refund']; + customerId = json['customer_id']; }catch(e){ print(e); } diff --git a/lib/core/service/parmacyModule/prescription_service.dart b/lib/core/service/parmacyModule/prescription_service.dart index d03111a0..7aafc9d3 100644 --- a/lib/core/service/parmacyModule/prescription_service.dart +++ b/lib/core/service/parmacyModule/prescription_service.dart @@ -21,7 +21,7 @@ class PrescriptionService extends BaseService { hasError = false; url = PRESCRIPTION; print("Print PRESCRIPTION url" + url); - await baseAppClient.getPharmacy(url, + await baseAppClient.get(url, onSuccess: (dynamic response, int statusCode) { _prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((item) { diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart index 5f36e9f6..f434db54 100644 --- a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart @@ -18,15 +18,12 @@ import '../base_view_model.dart'; class OrderModelViewModel extends BaseViewModel { OrderService _orderService = locator(); - List get orders => _orderService.orderList; OrderDetailsService _orderDetailsService = locator(); - - List get orderDetails => _orderDetailsService.orderDetails; + List get orderListModel => _orderDetailsService.orderList; CancelOrderService _cancelOrderService = locator(); - List get cancelOrder => _cancelOrderService.cancelOrderList; @@ -53,9 +50,9 @@ class OrderModelViewModel extends BaseViewModel { } } - Future getOrderDetails(orderId) async { + Future getOrderDetails(OrderId) async { setState(ViewState.Busy); - await _orderDetailsService.getOrderDetails(orderId); + await _orderDetailsService.getOrderDetails(OrderId); if (_orderDetailsService.hasError) { error = _orderDetailsService.error; setState(ViewState.Error); diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index 52bbb888..fda83fc2 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -78,11 +78,19 @@ class _LandingPagePharmacyState extends State { ), leading: Builder( builder: (BuildContext context) { - return Container( - height: 2.0, - width: 10.0, - child: Image.asset( - 'assets/images/pharmacy_logo.png', + return InkWell( + onTap: (){ + setState(() { + currentTab = 0; + pageController.jumpToPage(0); + }); + }, + child: Container( + height: 2.0, + width: 10.0, + child: Image.asset( + 'assets/images/pharmacy_logo.png', + ), ), ); }, @@ -135,6 +143,7 @@ class _LandingPagePharmacyState extends State { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ + // TODO mosa_comeback PharmacyPage(), PharmacyCategorisePage(), // OffersCategorisePage(), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 6113fb71..69a66d9e 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -32,7 +32,7 @@ class LoginType extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/DQ/dq_logo_icon.png', + 'assets/images/DQ/logo.png', height: 90, width: 90, ), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 419df302..4b8e90ae 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -36,7 +37,7 @@ class _WelcomeLogin extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset('assets/images/DQ/dq_logo_icon.png', + Image.asset('assets/images/DQ/logo.png', height: 90, width: 90), Text( TranslationBase.of(context).welcome, @@ -75,7 +76,7 @@ class _WelcomeLogin extends State { LOGIN_TYPE, ), }, - color: Color(0xFF40ACC9), + color: Color(0xFFc5272c), textColor: Colors.white, )) ], diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart index 2040db11..ebb7fe39 100644 --- a/lib/pages/pharmacies/product_detail.dart +++ b/lib/pages/pharmacies/product_detail.dart @@ -279,6 +279,31 @@ class __ProductDetailPageState extends State { SizedBox( height: 10, ), + Container( + child: Text( + languageID == 'ar' + ? widget.product.shortDescriptionn + : widget.product.shortDescription, + style: TextStyle( + fontSize: 16, + fontFamily: 'WorkSans-Regular'), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + TranslationBase.of(context).howToUse, + style: TextStyle( + fontSize: 17, + color: Colors.grey, + fontWeight: FontWeight.w600), + ), + ), + SizedBox( + height: 10, + ), Container( child: Text( languageID == 'ar' diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart index c5576900..51d93d71 100644 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -19,26 +19,21 @@ class CartOrderPage extends StatelessWidget { Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = - AppBarWidget(TranslationBase.of(context).shoppingCart, null, true); - final height = mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top; + final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; return BaseView( onModelReady: (model) => model.getOrderPreviewData(), builder: (_, model, wi) => ChangeNotifierProvider.value( value: model.cartResponse, child: AppScaffold( - title: TranslationBase.of(context).shoppingCart, + appBarTitle: TranslationBase.of(context).shoppingCart, isShowAppBar: true, isShowDecPage: false, isPharmacy: true, baseViewModel: model, - appBarWidget: appBarWidget, backgroundColor: Colors.white, body: !(model.cartResponse.shoppingCarts == null || - model.cartResponse.shoppingCarts.length == 0) + model.cartResponse.shoppingCarts.length == 0) ? Container( height: height * 0.85, width: double.infinity, @@ -179,7 +174,29 @@ class CartOrderPage extends StatelessWidget { ), ), ) - : Container(), + : Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], + ), + ), bottomSheet: Container( height: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0) diff --git a/lib/pages/pharmacies/screens/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-order-preview.dart index b4736d7a..9d819c1c 100644 --- a/lib/pages/pharmacies/screens/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-order-preview.dart @@ -24,11 +24,9 @@ class OrderPreviewPage extends StatelessWidget { @override Widget build(BuildContext context) { - PreferredSizeWidget appBarWidget = - AppBarWidget("${TranslationBase.of(context).checkOut}", null, true); final mediaQuery = MediaQuery.of(context); final height = mediaQuery.size.height - - appBarWidget.preferredSize.height - + 60 - mediaQuery.padding.top; return BaseView( @@ -36,11 +34,10 @@ class OrderPreviewPage extends StatelessWidget { builder: (_, model, wi) => ChangeNotifierProvider.value( value: model.paymentCheckoutData, child: AppScaffold( - title: "${TranslationBase.of(context).checkOut}", + appBarTitle: "${TranslationBase.of(context).checkOut}", isShowAppBar: true, isPharmacy: true, isShowDecPage: false, - appBarWidget: appBarWidget, backgroundColor: Colors.white, baseViewModel: model, body: Container( diff --git a/lib/pages/pharmacies/screens/lacum-registration-page.dart b/lib/pages/pharmacies/screens/lacum-registration-page.dart index 53b9705d..c40771b8 100644 --- a/lib/pages/pharmacies/screens/lacum-registration-page.dart +++ b/lib/pages/pharmacies/screens/lacum-registration-page.dart @@ -34,7 +34,6 @@ class _LakumRegistrationPageState extends State { @override Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); languages.clear(); languages.add(IdNamePair(1, TranslationBase.of(context).arabic)); languages.add(IdNamePair(2, TranslationBase.of(context).english)); @@ -49,19 +48,18 @@ class _LakumRegistrationPageState extends State { return BaseView( builder: (_, model, wi) => AppScaffold( - title: "Register Lakum", + appBarTitle: + "${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}", isShowAppBar: true, isShowDecPage: false, backgroundColor: Colors.white, - appBarWidget: appBarWidget, baseViewModel: model, body: Container( width: double.infinity, child: SingleChildScrollView( child: SizedBox( - height: mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top, + height: + mediaQuery.size.height - 60 - mediaQuery.padding.top, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/pharmacies/screens/lacum-setting-page.dart b/lib/pages/pharmacies/screens/lacum-setting-page.dart index 91e4c965..861279f3 100644 --- a/lib/pages/pharmacies/screens/lacum-setting-page.dart +++ b/lib/pages/pharmacies/screens/lacum-setting-page.dart @@ -36,24 +36,22 @@ class _LakumSettingPageState extends State { @override Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); return BaseView( onModelReady: (model) => model.setLakumData( widget.lacumInformation, widget.lacumGroupInformation), builder: (_, model, wi) => AppScaffold( - title: "Lakum", + appBarTitle: "${TranslationBase.of(context).lakum}", isShowAppBar: true, isShowDecPage: false, backgroundColor: Colors.white, - appBarWidget: appBarWidget, baseViewModel: model, body: Container( width: double.infinity, child: SingleChildScrollView( child: SizedBox( height: mediaQuery.size.height - - appBarWidget.preferredSize.height - + 60 - mediaQuery.padding.top, child: _buildSettingScreen(mediaQuery, model), ), diff --git a/lib/pages/pharmacies/screens/lacum-transfer-page.dart b/lib/pages/pharmacies/screens/lacum-transfer-page.dart index 0671f80a..9103b646 100644 --- a/lib/pages/pharmacies/screens/lacum-transfer-page.dart +++ b/lib/pages/pharmacies/screens/lacum-transfer-page.dart @@ -32,17 +32,15 @@ class _LacumTransferPageState extends State { @override Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); return BaseView( onModelReady: (model) => model.setLakumData( widget.lacumInformation, widget.lacumGroupInformation), builder: (_, model, wi) => AppScaffold( - title: "Lakum", + appBarTitle: "${TranslationBase.of(context).lakum}", isShowAppBar: true, isShowDecPage: false, backgroundColor: Colors.white, - appBarWidget: appBarWidget, baseViewModel: model, body: Container( width: double.infinity, diff --git a/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart b/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart index 30c3bb6e..228b0874 100644 --- a/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart +++ b/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart @@ -19,21 +19,14 @@ class LakumTermsConditions extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); - final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); - double height = mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top; - return BaseView( onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(), builder: (_, model, wi) => AppScaffold( - appBarTitle: "Register Lakum", + appBarTitle: "${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}", isShowAppBar: true, isShowDecPage: false, backgroundColor: Colors.white, baseViewModel: model, - appBarWidget: appBarWidget, body: Container( margin: EdgeInsets.all(8), width: double.infinity, diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index ffdc6be6..b41c1804 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -28,7 +28,6 @@ class PharmacyPage extends StatelessWidget { @override void initState() { // print("model prescription " + model.prescriptionsList.length); - // cancelOrderDetail(order) } @@ -49,8 +48,8 @@ class PharmacyPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - BannerPager(model), - GridViewButtons(model), + BannerPager(model), + // GridViewButtons(model), Container( margin: EdgeInsets.fromLTRB(10, 10, 10, 10), child: Row( @@ -78,179 +77,182 @@ class PharmacyPage extends StatelessWidget { ], ), ), -// model.getPrescription(), + Container( - padding: - EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0), + padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0), height: MediaQuery.of(context).size.height * 0.30, -// width: 200.0, -// height: MediaQuery.of(context).size.height / 4 + 20, +// width: 200.0, +// height: MediaQuery.of(context).size.height / 4 + 20, margin: EdgeInsets.only(left: 10), + child: BaseView( + onModelReady: (model) => model.getPrescription(), + builder: (_, model, wi) => model.prescriptionsList.length != 0 // model.getPrescription(); - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - physics: ScrollPhysics(), -// physics: NeverScrollableScrollPhysics(), -// itemCount: 4, - itemCount: model.prescriptionsList.length, - itemBuilder: (context, index) { - return Container( + ? ListView.builder( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + physics: ScrollPhysics(), + // physics: NeverScrollableScrollPhysics(), + // itemCount: 4, + itemCount: model.prescriptionsList.length, + itemBuilder: (context, index) { + return Container( // width: 160.0, - height: MediaQuery.of(context).size.height * 0.6, - padding: EdgeInsets.only(bottom: 5.0, left: 5.0), - margin: EdgeInsets.only(right: 10.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: [ - Column(children: [ - Container( - padding: EdgeInsets.only( - top: 10.0, - left: 10.0, - right: 3.0, - bottom: 15.0, - ), - child: Image.network( - model.prescriptionsList[index] - .doctorImageURL, - width: 60, - height: 60, + height: MediaQuery.of(context).size.height * 0.6, + padding: EdgeInsets.only(bottom: 5.0, left: 5.0), + margin: EdgeInsets.only(right: 10.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: [ + Column(children: [ + Container( + padding: EdgeInsets.only( + top: 10.0, + left: 10.0, + right: 3.0, + bottom: 15.0, + ), + child: Image.network( + model.prescriptionsList[index] + .doctorImageURL, + width: 60, + height: 60, + ), ), - ), - ]), - Column( + ]), + Column( // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(left: 1), - padding: EdgeInsets.only( - left: 15.0, right: 15.0), - decoration: BoxDecoration( - border: Border.all( + 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: 4.0, + ), color: Colors.green, - style: BorderStyle.solid, - width: 4.0, + borderRadius: + BorderRadius.circular( + 30.0)), + child: Text( + model.prescriptionsList[index] + .isInOutPatientDescription + .toString(), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, +// fontWeight: FontWeight.bold, ), - color: Colors.green, - borderRadius: - BorderRadius.circular( - 30.0)), - child: Text( + )), + Row(children: [ + Image.asset( + 'assets/images/Icon-awesome-calendar.png', + width: 30, + height: 30, + ), + Text( model.prescriptionsList[index] - .isInOutPatientDescription + .appointmentDate .toString(), style: TextStyle( - color: Colors.white, + color: Colors.black, fontSize: 15.0, -// fontWeight: FontWeight.bold, +// fontWeight: FontWeight.bold, ), - )), - Row(children: [ - Image.asset( - 'assets/images/Icon-awesome-calendar.png', - width: 30, - height: 30, + ) + ]), + ], + ), + ], + ), + 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, + ), ), Text( model.prescriptionsList[index] - .appointmentDate + .doctorName .toString(), style: TextStyle( color: Colors.black, fontSize: 15.0, -// fontWeight: FontWeight.bold, + fontWeight: FontWeight.bold, ), - ) - ]), - ], - ), - ], - ), - 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, ), - ), - Text( + ]), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text( model.prescriptionsList[index] - .doctorName + .clinicDescription .toString(), style: TextStyle( - color: Colors.black, + color: Colors.green, 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( + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( // 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, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), ), - ), - ) - ]), - ]), - ); - }), + ) + ]), + ]), + ); + }) + : Container(), + ), ), - Container( margin: EdgeInsets.fromLTRB(10, 10, 10, 10), child: Row( diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 33599516..681f007b 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -165,7 +165,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,11), + child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,10), style: TextStyle(fontSize: 14.0, ), ), @@ -378,7 +378,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,11), + child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,10), style: TextStyle(fontSize: 14.0, ), ), @@ -770,7 +770,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,11), + child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,10), style: TextStyle(fontSize: 14.0, ), ), @@ -987,7 +987,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,11), + child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,10), style: TextStyle(fontSize: 14.0, ), ), diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 6effb47b..b60d33cb 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -1,3 +1,4 @@ + import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -19,15 +20,15 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:provider/provider.dart'; - - dynamic languageID; class OrderDetailsPage extends StatefulWidget { - Orders orderModel; - OrderModel orderDetails; - OrderDetailsPage({@required this.orderModel, this.orderDetails}); + Orders orderModel; + OrderDetailsPage({@required this.orderModel}); + // Orders orderModel; +// OrderModel orderModelDetails; +// OrderDetailsPage({@required this.orderModel, this.orderModelDetails}); @override _OrderDetailsPageState createState() => _OrderDetailsPageState(); @@ -39,9 +40,8 @@ class _OrderDetailsPageState extends State { } // AppSharedPreferences sharedPref = AppSharedPreferences(); - String orderId = ""; String customerId; - List orderList = []; + List ordersList = []; List cancelledOrderList = []; @@ -59,6 +59,8 @@ class _OrderDetailsPageState extends State { super.initState(); // print(widget.orderModel.orderItems.length); getCancelOrder(widget.orderModel.id); + + print("ID is"+widget.orderModel.id); // cancelOrderDetail(order) } @@ -110,8 +112,8 @@ class _OrderDetailsPageState extends State { borderRadius: BorderRadius.circular(30.0)), child: Text( languageID == "ar" - ? widget.orderModel.orderStatusn.toString(): - widget.orderModel.orderStatus.toString().substring(12) , + ? model.orderListModel[0].orderStatusn.toString(): + model.orderListModel[0].orderStatus.toString().substring(12) , // TranslationBase.of(context).delivered, style: TextStyle( color: Colors.white, @@ -128,11 +130,11 @@ class _OrderDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.orderDetails.shippingAddress.firstName + model.orderListModel[0].shippingAddress.firstName .toString() .substring(10) + ' ' + - widget.orderDetails.shippingAddress.lastName + model.orderListModel[0].shippingAddress.lastName .toString() .substring(9), style: TextStyle( @@ -148,7 +150,8 @@ class _OrderDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.orderDetails.shippingAddress.address1 + + model.orderListModel[0].shippingAddress.address1 .toString() .substring(9), style: TextStyle( @@ -165,14 +168,14 @@ class _OrderDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.orderDetails.shippingAddress.address2 + model.orderListModel[0].shippingAddress.address2 .toString() .substring(9) + ' ' + - widget.orderDetails.shippingAddress.country + model.orderListModel[0].shippingAddress.country .toString() + ' ' + - widget.orderDetails.shippingAddress.zipPostalCode + model.orderListModel[0].shippingAddress.zipPostalCode .toString(), style: TextStyle( fontSize: 10.0, @@ -195,7 +198,7 @@ class _OrderDetailsPageState extends State { Container( margin: EdgeInsets.only(top: 5.0, bottom: 5.0), child: Text( - widget.orderDetails.shippingAddress.phoneNumber + model.orderListModel[0].shippingAddress.phoneNumber .toString(), style: TextStyle( fontSize: 15.0, @@ -234,7 +237,7 @@ class _OrderDetailsPageState extends State { ), Container( child: flutterImage.Image.asset( - widget.orderDetails.shippingRateComputationMethodSystemName != + model.orderListModel[0].shippingRateComputationMethodSystemName != "Shipping.Aramex" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", @@ -286,7 +289,7 @@ class _OrderDetailsPageState extends State { Container( margin: EdgeInsets.only(bottom: 10.0, top: 10.0), child: Text( - widget.orderDetails.paymentName.toString().substring(12), + model.orderListModel[0].paymentName.toString().substring(12), style: TextStyle( fontSize: 13.0, fontWeight: FontWeight.bold, @@ -322,23 +325,23 @@ class _OrderDetailsPageState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), - itemCount:widget.orderDetails.orderItems.length, + itemCount:model.orderListModel[0].orderItems.length, itemBuilder: (context, index){ return Container( - child: productTile(productName: widget.orderDetails.orderItems[index].product.name.toString(), - productPrice: widget.orderDetails.orderItems[index].product.price.toString(), - productRate: widget.orderDetails.orderItems[index].product.approvedRatingSum.toDouble(), - productReviews:widget.orderDetails.orderItems[index].product.approvedTotalReviews, - totalPrice: "${(widget.orderDetails.orderItems[index].product.price - * widget.orderDetails.orderItems[index].quantity).toStringAsFixed(2)}", - qyt: widget.orderDetails.orderItems[index].quantity.toString(), + child: productTile(productName: model.orderListModel[0].orderItems[index].product.name.toString(), + productPrice: model.orderListModel[0].orderItems[index].product.price.toString(), + productRate: model.orderListModel[0].orderItems[index].product.approvedRatingSum.toDouble(), + productReviews:model.orderListModel[0].orderItems[index].product.approvedTotalReviews, + totalPrice: "${(model.orderListModel[0].orderItems[index].product.price + * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}", + qyt: model.orderListModel[0].orderItems[index].quantity.toString(), isOrderDetails:true, - imgs: widget.orderDetails.orderItems[index].product.images != null && - widget.orderDetails.orderItems[index].product.images.length != 0 - ? widget.orderDetails.orderItems[index].product.images [0].src.toString() + imgs: model.orderListModel[0].orderItems[index].product.images != null && + model.orderListModel[0].orderItems[index].product.images.length != 0 + ? model.orderListModel[0].orderItems[index].product.images [0].src.toString() : null, - status: widget.orderDetails.orderStatusId, - product: widget.orderDetails.orderItems[index].product, + status: model.orderListModel[0].orderStatusId, + product: model.orderListModel[0].orderItems[index].product, ), ); }), @@ -387,7 +390,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderDetails.orderSubtotalExclTax.toString(), + model.orderListModel[0].orderSubtotalExclTax.toString(), style: TextStyle( fontSize: 13.0, ), @@ -425,7 +428,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderDetails.orderShippingExclTax.toString(), + model.orderListModel[0].orderShippingExclTax.toString(), style: TextStyle( fontSize: 13.0, ), @@ -463,7 +466,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderDetails.orderTax.toString(), + model.orderListModel[0].orderTax.toString(), style: TextStyle( fontSize: 13.0, ), @@ -501,7 +504,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderModel.orderTotal.toString(), + model.orderListModel[0].orderTotal.toString(), style: TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, @@ -512,7 +515,7 @@ class _OrderDetailsPageState extends State { ), ], ), - widget.orderModel.orderStatusId == 10 + model.orderListModel[0].orderStatusId == 10 ? InkWell( onTap: () { model.makeOrder(); @@ -548,7 +551,8 @@ class _OrderDetailsPageState extends State { ? InkWell( onTap: () { presentConfirmDialog(model, - widget.orderModel.id); //(widget.orderModel.id)); + widget.orderModel.id); + // model.orderListModel[0].id//(widget.orderModel.id)); // }, child: Container( @@ -595,17 +599,17 @@ class _OrderDetailsPageState extends State { } getCancelOrder(dataIsCancel) { - if (widget.orderDetails.canCancel && widget.orderDetails.canRefund) { + if (widget.orderModel.canCancel && widget.orderModel.canRefund) { setState(() { isCancel = true; isRefund = false; }); - } else if (widget.orderDetails.canCancel) { + } else if (widget.orderModel.canCancel) { setState(() { isCancel = true; isRefund = false; }); - } else if (widget.orderDetails.canRefund) { + } else if (widget.orderModel.canRefund) { setState(() { isCancel = false; isRefund = true; @@ -634,7 +638,8 @@ class _OrderDetailsPageState extends State { context, MaterialPageRoute( builder: (context) => OrderPage( - customerID: widget.orderDetails.customerId.toString())), +// customerID: model.ordersList[0].customerId.toString() + customerID: widget.orderModel.customerId.toString())), ); }), cancelFunction: () => {}); @@ -643,7 +648,7 @@ class _OrderDetailsPageState extends State { getCanceledOrder(order) { Navigator.pop(context); - if (widget.orderDetails.canCancel && widget.orderDetails.canRefund == false) { + if (widget.orderModel.canCancel && widget.orderModel.canRefund == false) { // getCanceledOrder(order); // AppToast.showSuccessToast(message: "Request Sent Successfully"); // Navigator.push(context, @@ -651,4 +656,4 @@ class _OrderDetailsPageState extends State { } } -} \ No newline at end of file +} diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index 7e8763e1..7569ed43 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -49,11 +49,9 @@ class _AddAddressPageState extends State { @override Widget build(BuildContext context) { - PreferredSizeWidget appBarWidget = AppBarWidget( - "${TranslationBase.of(context).changeAddress}", null, true); final mediaQuery = MediaQuery.of(context); final height = mediaQuery.size.height - - appBarWidget.preferredSize.height - + 60 - mediaQuery.padding.top; return BaseView( @@ -62,7 +60,6 @@ class _AddAddressPageState extends State { isShowAppBar: true, isPharmacy: true, backgroundColor: Colors.white, - appBarWidget: appBarWidget, body: Container( height: height * 1, child: PickupLocationFromMap( diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index e3651e21..340e2bd8 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -12,14 +12,12 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; - class PharmacyAddressesPage extends StatefulWidget { @override _PharmacyAddressesState createState() => _PharmacyAddressesState(); } class _PharmacyAddressesState extends State { - void navigateToAddressPage( BuildContext ctx, PharmacyAddressesViewModel model, Addresses address) { Navigator.push( @@ -31,12 +29,8 @@ class _PharmacyAddressesState extends State { } Widget build(BuildContext context) { - PreferredSizeWidget appBarWidget = AppBarWidget( - "${TranslationBase.of(context).changeAddress}", null, true); final mediaQuery = MediaQuery.of(context); - final height = mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top; + final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; return BaseView( onModelReady: (model) => model.getAddressesList(), @@ -46,7 +40,6 @@ class _PharmacyAddressesState extends State { isPharmacy: true, baseViewModel: model, backgroundColor: Colors.white, - appBarWidget: appBarWidget, body: Container( height: height * 0.90, child: SingleChildScrollView( @@ -115,8 +108,8 @@ class _PharmacyAddressesState extends State { handler: () { model.saveSelectedAddressLocally( model.addresses[model.selectedAddressIndex]); - Navigator.pop(context, - model.addresses[model.selectedAddressIndex]); + Navigator.pop( + context, model.addresses[model.selectedAddressIndex]); }, ), ), diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 85305c99..fb1e1c2a 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -100,552 +100,560 @@ class _ProfilePageState extends State { isShowAppBar: false, isShowDecPage: false, isPharmacy: true, - body: Container( - child: SingleChildScrollView( - child: Column( - children: [ - Container( - child: Row( + body: user != null + ? Container( + child: SingleChildScrollView( + child: Column( children: [ Container( - padding: EdgeInsets.only( - top: 20.0, - left: 10.0, - right: 10.0, - bottom: 10.0, - ), - child: LargeAvatar( - name: "profile", - url: '', + child: Row( + children: [ + Container( + child: Row( + children: [ + Container( + padding: EdgeInsets.only( + top: 20.0, + left: 10.0, + right: 10.0, + bottom: 10.0, + ), + child: LargeAvatar( + name: "profile", + url: '', + ), + ), + Text( + languageID == "ar" + ? user.firstNameN.toString() + + " " + + user.lastNameN.toString() + : user.firstName.toString() + + " " + + user.lastName.toString(), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold), + ), + ], + ), + ) + ], ), ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 15, + ), Container( - child: Column( - children: [ - Text( - TranslationBase.of(context).welcome, - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.bold, - color: Colors.grey), - ), - Text( - languageID == "ar" - ? user.firstNameN.toString() + - " " + - user.lastNameN.toString() - : user.firstName.toString() + - " " + - user.lastName.toString(), - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.bold), - ), - ], - ), - ) - ], - ), - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 15, - ), - Container( - child: Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - if (customerId == null) { - AppToast.showErrorToast( - message: "Customer not found"); - return; - } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - OrderPage(customerID: customerId))); - }, - child: Column( - children: [ + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + if (customerId == null) { + AppToast.showErrorToast( + message: "Customer not found"); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OrderPage( + customerID: customerId))); + }, + child: Column( + children: [ // Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')), - SvgPicture.asset( - 'assets/images/pharmacy/orders_icon.svg', - width: 50, - height: 50, + SvgPicture.asset( + 'assets/images/pharmacy/orders_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).orders, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), ), - SizedBox( - height: 5, + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LakumMainPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/lakum_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).lakum, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold), + ), + ], + ), ), - Text( - TranslationBase.of(context).orders, - style: TextStyle( - fontSize: 13.0, - fontWeight: FontWeight.bold, + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + WishlistPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/wishlist_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).wishlist, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + ], ), ), - ], - ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MyReviewsPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/review_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ), + ], + )), + SizedBox( + height: 15, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, ), - ), - Expanded( - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => LakumMainPage())); - }, + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset( - 'assets/images/pharmacy/lakum_icon.svg', - width: 50, - height: 50, - ), - SizedBox( - height: 5, - ), Text( - TranslationBase.of(context).lakum, + TranslationBase.of(context).myAccount, style: TextStyle( - fontSize: 13.0, + fontSize: 16.0, fontWeight: FontWeight.bold), ), - ], - ), - ), - ), - Expanded( - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => WishlistPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/wishlist_icon.svg', - width: 50, - height: 50, - ), SizedBox( - height: 5, + height: 10, ), - Text( - TranslationBase.of(context).wishlist, - style: TextStyle( - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), + Divider( + color: Colors.grey, + height: 20, ), - ], - ), - ), - ), - Expanded( - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MyReviewsPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/review_icon.svg', - width: 50, - height: 50, + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_prescription_icon.svg', + width: 28, + height: 28, + ), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context) + .myPrescription, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), ), SizedBox( height: 5, ), - Text( - TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), + Divider( + color: Colors.grey, + height: 20, ), - ], - ), - ), - ), - ], - )), - SizedBox( - height: 15, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).myAccount, - style: TextStyle( - fontSize: 16.0, fontWeight: FontWeight.bold), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - HomePrescriptionsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_prescription_icon.svg', - width: 28, - height: 28, + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + ComparePage())); + }, + child: Row( + children: [ + Image.asset( + 'assets/images/pharmacy/compare.png', + width: 35, + height: 35), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context).compare, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), ), SizedBox( - width: 15, + height: 5, ), - Text( - TranslationBase.of(context).myPrescription, - style: TextStyle( - fontSize: 13.0, + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/medication_refill_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context) + .medicationsRefill, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], ), ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ComparePage())); - }, - child: Row( - children: [ - Image.asset( - 'assets/images/pharmacy/compare.png', - width: 35, - height: 35), SizedBox( - width: 15, + height: 5, ), - Text( - TranslationBase.of(context).compare, - style: TextStyle( - fontSize: 13.0, - ), + Divider( + color: Colors.grey, + height: 20, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - HomePrescriptionsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/medication_refill_icon.svg', - width: 30, - height: 30, + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MyFamily())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_family_icon.svg', + width: 20, + height: 20, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).family, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), ), SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context) - .medicationsRefill, - style: TextStyle( - fontSize: 13.0, - ), + height: 5, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MyFamily())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_family_icon.svg', - width: 20, + Divider( + color: Colors.grey, height: 20, ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).family, - style: TextStyle( - fontSize: 13.0, + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmacyAddressesPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/shipping_addresses_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context) + .shippingAddresses, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], ), ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PharmacyAddressesPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/shipping_addresses_icon.svg', - width: 30, - height: 30, - ), SizedBox( - width: 20, + height: 5, ), - Text( - TranslationBase.of(context) - .shippingAddresses, - style: TextStyle( - fontSize: 13.0, - ), + Divider( + color: Colors.grey, + height: 20, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PharmacyTermsConditions())); - }, - child: Row( - children: [ - Image.asset( - 'assets/images/pharmacy/terms.png', - width: 25, - height: 25, + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmacyTermsConditions())); + }, + child: Row( + children: [ + Image.asset( + 'assets/images/pharmacy/terms.png', + width: 25, + height: 25, + ), + SizedBox( + width: 10, + ), + Text( + TranslationBase.of(context) + .conditionsHMG, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), ), SizedBox( - width: 10, - ), - Text( - TranslationBase.of(context).conditionsHMG, - style: TextStyle( - fontSize: 13.0, - ), + height: 5, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - LakumTermsConditions( - this.identificationNo, - this.firstName, - this.lastName, - this.mobileNo, - this.languageId))); - }, - child: Row( - children: [ - Image.asset( - 'assets/images/pharmacy/terms.png', - width: 25, - height: 25, + Divider( + color: Colors.grey, + height: 20, ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LakumTermsConditions( + this.identificationNo, + this.firstName, + this.lastName, + this.mobileNo, + this.languageId))); + }, + child: Row( + children: [ + Image.asset( + 'assets/images/pharmacy/terms.png', + width: 25, + height: 25, + ), // IconButton(icon: Icon(Icons.error_outline), iconSize: 30, // color: Colors.black,), - SizedBox( - width: 10, - ), - Text( - TranslationBase.of(context).conditions, - style: TextStyle( - fontSize: 13.0, + SizedBox( + width: 10, + ), + Text( + TranslationBase.of(context) + .conditions, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], ), ), ], ), ), - ], - ), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).reachUs, - style: TextStyle( - fontSize: 16.0, fontWeight: FontWeight.bold), - ), SizedBox( - height: 5, + height: 10, ), Divider( - color: Colors.grey, + color: Colors.grey[350], height: 20, + thickness: 5, + indent: 0, + endIndent: 0, ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => LiveChatPage())); - }, - child: Row( + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset( - 'assets/images/pharmacy/contact_us_icon.svg', - width: 20, - height: 20, + Text( + TranslationBase.of(context).reachUs, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold), ), SizedBox( - width: 20, + height: 5, ), - Text( - TranslationBase.of(context).contactUs, - style: TextStyle(fontSize: 13.0), + Divider( + color: Colors.grey, + height: 20, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => FindUsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/our_locations_icon.svg', - width: 30, - height: 30, + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LiveChatPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/contact_us_icon.svg', + width: 20, + height: 20, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).contactUs, + style: TextStyle(fontSize: 13.0), + ), + ], + ), ), SizedBox( - width: 20, + height: 5, ), - Text( - TranslationBase.of(context).ourLocations, - style: TextStyle(fontSize: 13.0), + Divider( + color: Colors.grey, + height: 20, ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + FindUsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/our_locations_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context) + .ourLocations, + style: TextStyle(fontSize: 13.0), + ), + ], + ), + ) ], ), ) ], ), - ) - ], - ), - ), - ), + ), + ) + : Container(), )); } } diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart index 1e9306d4..b8ea8214 100644 --- a/lib/services/pharmacy_services/orderDetails_service.dart +++ b/lib/services/pharmacy_services/orderDetails_service.dart @@ -16,21 +16,20 @@ class OrderDetailsService extends BaseService{ AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - - List get orderDetails => orderDetails; +// String url =""; +// List get orderDetails => ordeDetails; List _orderList = List(); List get orderList => _orderList; - Future getOrderDetails(orderId) async { - print("step 2" + orderId); - print("this is what i need"+GET_ORDER_DETAILS + orderId); + Future getOrderDetails(OrderId) async { hasError = false; - await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, + await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId, onSuccess: (dynamic response, int statusCode) { _orderList.clear(); response['orders'].forEach((item) { _orderList.add(OrderModel.fromJson(item)); + print(response); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/services/pharmacy_services/order_service.dart b/lib/services/pharmacy_services/order_service.dart index abdeda20..3f1ece78 100644 --- a/lib/services/pharmacy_services/order_service.dart +++ b/lib/services/pharmacy_services/order_service.dart @@ -22,7 +22,7 @@ class OrderService extends BaseService{ hasError = false; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; - url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count&page=$pageId&limit=200&customer_id=$customerId"; + url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId"; print(url); await baseAppClient.getPharmacy(url, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b84e3c69..18094d35 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -264,6 +264,7 @@ class TranslationBase { localizedValues['pharmaciesList'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; + String get howToUse => localizedValues['howToUse'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart index af2768a5..5b0a4568 100644 --- a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -168,20 +168,28 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { + try{ double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble > max) max = resultValueDouble; + if (resultValueDouble > max) max = resultValueDouble;} + catch(e){ + print(e); + } }); return max.roundToDouble(); } double getMinY() { - double min = double.parse(widget.labResult[0].resultValue); + double min = 0; + try{ + min = double.parse(widget.labResult[0].resultValue); widget.labResult.forEach((element) { double resultValueDouble = double.parse(element.resultValue); if (resultValueDouble < min) min = resultValueDouble; - }); + });}catch(e){ + print(e); + } int value = min.toInt(); return value.toDouble(); @@ -190,8 +198,14 @@ class LineChartCurvedState extends State { List getData() { List spots = List(); for (int index = 0; index < widget.labResult.length; index++) { + try{ var resultValueDouble = double.parse(widget.labResult[index].resultValue); spots.add(FlSpot(index.toDouble(), resultValueDouble)); + }catch(e){ + print(e); + spots.add(FlSpot(index.toDouble(), 0.0)); + + } } final LineChartBarData lineChartBarData1 = LineChartBarData( diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 332db82e..461bfa7c 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -77,7 +77,7 @@ class _AppDrawerState extends State { children: [ Container( child: - Image.asset('assets/images/DQ/DQ_logo.png'), + Image.asset('assets/images/DQ/logo_big.png'), margin: EdgeInsets.all( SizeConfig.imageSizeMultiplier * 4), ), @@ -95,7 +95,7 @@ class _AppDrawerState extends State { EdgeInsets.only(right: 0), child: Icon( Icons.account_circle, - color: Color(0xFF40ACC9), + color: Color(0xFFc5272c), size: 28, )), Padding( @@ -105,7 +105,7 @@ class _AppDrawerState extends State { user.firstName + ' ' + user.lastName, - color: Color(0xFF40ACC9), + color: Color(0xFFc5272c), )) ], ), @@ -124,7 +124,7 @@ class _AppDrawerState extends State { ": " + user.patientID .toString(), - color: Color(0xFF40ACC9), + color: Color(0xFFc5272c), fontSize: SizeConfig .textMultiplier * 1.5, @@ -161,8 +161,8 @@ class _AppDrawerState extends State { child: DrawerItem( TranslationBase.of(context).family, Icons.group, - textColor: Color(0xFF40ACC9), - iconColor: Color(0xFF40ACC9), + textColor: Color(0xFFc5272c), + iconColor: Color(0xFFc5272c), bottomLine: false, sideArrow: true, ), @@ -225,7 +225,7 @@ class _AppDrawerState extends State { Icons .account_circle, color: Color( - 0xFF40ACC9), + 0xFFc5272c), size: 24, ), @@ -273,15 +273,15 @@ class _AppDrawerState extends State { CrossAxisAlignment.start, children: [ Expanded( - child: Icon(Icons.account_circle, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + child: Icon(Icons.account_circle, color: result.responseID == user.patientID ? Color(0xFFc5272c) : Colors.black), ), Expanded( flex: 7, child: Padding( padding: EdgeInsets.only(left: 5, right: 5), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFFc5272c) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFFc5272c) : Colors.black), ]))), ], )))) diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 2e831963..a1c28f7e 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -46,7 +46,6 @@ class AppScaffold extends StatelessWidget { final Color backgroundColor; final double preferredSize; final List appBarIcons; - final PreferredSizeWidget appBarWidget; final List imagesInfo; AuthenticatedUserObject authenticatedUserObject = @@ -69,25 +68,18 @@ class AppScaffold extends StatelessWidget { this.backgroundColor, this.preferredSize = 0.0, this.appBarIcons, - this.appBarWidget, this.image, this.infoList, this.imagesInfo}); @override Widget build(BuildContext context) { AppGlobal.context = context; - ProjectViewModel projectViewModel = Provider.of(context); - AppGlobal.context = context; - PreferredSizeWidget appBar; - - return Scaffold( backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, appBar: isShowAppBar? AppBarWidget( - appBarTitle, - appBarIcons, - isShowAppBar, + appBarTitle:appBarTitle, + appBarIcons:appBarIcons, isPharmacy: isPharmacy, isShowDecPage: isShowDecPage, image: image, @@ -95,22 +87,17 @@ class AppScaffold extends StatelessWidget { body: (!Provider.of(context, listen: false).isLogin && isShowDecPage) ? NotAutPage( - title: appBarTitle, + title: title ?? appBarTitle, description: description, infoList: infoList, imagesInfo: imagesInfo, ) : baseViewModel != null ? NetworkBaseView( - child: buildBodyWidget(), + child: body, baseViewModel: baseViewModel, ) - : buildBodyWidget(), - bottomSheet: bottomSheet, - //floatingActionButton: floatingActionButton ?? floatingActionButton, - // bottomNavigationBar: - // this.isBottomBar == true ? BottomBarSearch() : SizedBox() - // floatingActionButton: FloatingSearchButton(), + : body, ); } @@ -118,12 +105,6 @@ class AppScaffold extends StatelessWidget { return isLoading ? AppLoaderWidget() : Container(); } - buildBodyWidget() { - // return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); - return Stack(children: [ - body, /*FloatingSearchButton()*/ - ]); - } } class AppBarWidget extends StatelessWidget with PreferredSizeWidget { @@ -132,13 +113,12 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { final String appBarTitle; final List appBarIcons; - final bool isShowAppBar; final bool isPharmacy; final bool isShowDecPage; final String image; - AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar, - {this.isPharmacy = true, this.isShowDecPage = true, this.image}); + AppBarWidget({this.appBarTitle, this.appBarIcons, + this.isPharmacy = true, this.isShowDecPage = true, this.image}); @override Widget build(BuildContext context) { @@ -147,8 +127,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { Widget buildAppBar(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return isShowAppBar - ? AppBar( + return AppBar( elevation: 0, backgroundColor: isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, @@ -194,10 +173,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { ), if (appBarIcons != null) ...appBarIcons ], - ) - : Container( - height: 0, - width: 0, + ); }