From 3be7f7f8990abed5832c90fa59840d82ad5a39fa Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 18 Oct 2021 11:23:12 +0300 Subject: [PATCH 1/9] fixed loader issue --- lib/pages/final_products_page.dart | 9 ++++----- lib/pages/parent_categorise_page.dart | 8 ++++---- lib/pages/sub_categorise_page.dart | 9 ++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart index 7e8385f0..854b66a6 100644 --- a/lib/pages/final_products_page.dart +++ b/lib/pages/final_products_page.dart @@ -621,19 +621,18 @@ class _FinalProductsPageState extends State { size: 18, color: Colors.blue,), onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); if(model.finalProducts[index].rxMessage == null){ + GifLoaderDialogUtils.showMyDialog(context); await addToCartFunction(1, model.finalProducts[index].id); -// GifLoaderDialogUtils.hideDialog(context); + GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, - FadePage(page: CartOrderPage()), - ); + FadePage(page: CartOrderPage())); } else{ AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); } - GifLoaderDialogUtils.hideDialog(context); +// } ), diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index 1ac20946..18133bb2 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -1175,18 +1175,18 @@ class _ParentCategorisePageState extends State { size: 18, color: Colors.blue,), onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); if(model.parentProducts[index].rxMessage == null){ + GifLoaderDialogUtils.showMyDialog(context); await addToCartFunction(1, model.parentProducts[index].id); + GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, - FadePage(page: CartOrderPage()), - ); + FadePage(page: CartOrderPage())); } else{ AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); } - GifLoaderDialogUtils.hideDialog(context); + } ), diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart index 3fb1574f..6c41f550 100644 --- a/lib/pages/sub_categorise_page.dart +++ b/lib/pages/sub_categorise_page.dart @@ -1072,18 +1072,17 @@ class _SubCategorisePageState extends State { size: 18, color: Colors.blue,), onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); if(model.subProducts[index].rxMessage == null){ + GifLoaderDialogUtils.showMyDialog(context); await addToCartFunction(1, model.subProducts[index].id); -// GifLoaderDialogUtils.hideDialog(context); + GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, - FadePage(page: CartOrderPage()), - );} + FadePage(page: CartOrderPage()));} else{ AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); } - GifLoaderDialogUtils.hideDialog(context); + } ), From e494c9304db55e962d6ccfbd1311ba272392f8ee Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 24 Oct 2021 15:54:03 +0300 Subject: [PATCH 2/9] fixed issues --- .../model/pharmacies/PharmacyProduct.dart | 2 +- lib/core/model/pharmacies/orders_model.dart | 10 +- .../pharmacies/ProductCheckTypeWidget.dart | 1 + .../pharmacies/widgets/ProductOrderItem.dart | 3 +- lib/pages/pharmacy/order/Order.dart | 587 +++++++++--------- lib/pages/pharmacy/order/OrderDetails.dart | 3 +- .../bottom_nav_pharmacy_home_item.dart | 23 +- .../pharmacy/bottom_nav_pharmacy_item.dart | 19 +- lib/widgets/pharmacy/product_tile.dart | 46 +- 9 files changed, 359 insertions(+), 335 deletions(-) diff --git a/lib/core/model/pharmacies/PharmacyProduct.dart b/lib/core/model/pharmacies/PharmacyProduct.dart index dbef5737..8f846480 100644 --- a/lib/core/model/pharmacies/PharmacyProduct.dart +++ b/lib/core/model/pharmacies/PharmacyProduct.dart @@ -20,7 +20,7 @@ class PharmacyProduct { bool allowCustomerReviews; int approvedRatingSum; int notApprovedRatingSum; - int approvedTotalReviews; + dynamic approvedTotalReviews; int notApprovedTotalReviews; dynamic sku; bool isRx; diff --git a/lib/core/model/pharmacies/orders_model.dart b/lib/core/model/pharmacies/orders_model.dart index 0ad94767..cef20c30 100644 --- a/lib/core/model/pharmacies/orders_model.dart +++ b/lib/core/model/pharmacies/orders_model.dart @@ -24,7 +24,7 @@ class OrdersModel { class Orders { String id; int productCount; - double orderTotal; + dynamic orderTotal; String createdOnUtc; int orderStatusId; String orderStatus; @@ -32,9 +32,9 @@ class Orders { bool canCancel; bool canRefund; dynamic customerId; - double orderSubtotalExclTax; + dynamic orderSubtotalExclTax; dynamic orderShippingExclTax; - double orderTax; + dynamic orderTax; Orders( @@ -64,9 +64,9 @@ class Orders { canCancel = json['can_cancel']; canRefund = json['can_refund']; customerId = json['customer_id']; - orderSubtotalExclTax= json["order_subtotal_excl_tax"].toDouble(); + orderSubtotalExclTax= json["order_subtotal_excl_tax"]; orderShippingExclTax= json["order_shipping_excl_tax"]; - orderTax= json["order_tax"].toDouble(); + orderTax= json["order_tax"]; }catch(e){ print(e); } diff --git a/lib/pages/pharmacies/ProductCheckTypeWidget.dart b/lib/pages/pharmacies/ProductCheckTypeWidget.dart index aac971a0..2b88d30a 100644 --- a/lib/pages/pharmacies/ProductCheckTypeWidget.dart +++ b/lib/pages/pharmacies/ProductCheckTypeWidget.dart @@ -32,6 +32,7 @@ class _ProductCheckTypeWidgetState extends State { : widget.model.wishListList[index].product.name, productPrice: widget.model.wishListList[index].subtotal, productRate: double.parse(widget.model.wishListList[index].subtotalVatRate), + approvedTotalReviews:widget.model.wishListList[index].product.approvedTotalReviews, productImage: widget.model.wishListList[index].product.images[0].src, productID: widget.model.wishListList[index].product.id, onDelete: deleteWishListItem, diff --git a/lib/pages/pharmacies/widgets/ProductOrderItem.dart b/lib/pages/pharmacies/widgets/ProductOrderItem.dart index cb7c59fd..11976175 100644 --- a/lib/pages/pharmacies/widgets/ProductOrderItem.dart +++ b/lib/pages/pharmacies/widgets/ProductOrderItem.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; class ProductOrderItem extends StatefulWidget { @@ -39,7 +40,7 @@ class _ProductOrderItemState extends State { leading: InkWell( onTap: () => {widget.deleteCartItems()}, child: Icon( - Icons.delete_outline_sharp, + FontAwesomeIcons.trashAlt,size: 15, color: Colors.grey.shade700, ), ), diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 7ffcbdbd..4e4a0cc9 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -70,6 +70,7 @@ class _OrderPageState extends State TabBar( labelPadding: EdgeInsets.only(left: 3.0, right: 3.0), labelColor: Colors.black, + indicatorColor: Colors.green, tabs: [ Tab(text: TranslationBase.of(context).delivered), Tab(text: TranslationBase.of(context).processing), @@ -127,86 +128,86 @@ class _OrderPageState extends State return Container( child: Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderNumber, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + deliveredOrderList[ + index]), + )); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - Container( - child: Text( - deliveredOrderList[index] - .id - .toString(), - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + Container( + child: Text( + deliveredOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderDate, - style: TextStyle( - fontSize: 14.0, + ], + ), + SizedBox( + height: 5, + ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - Container( - child: Text( - deliveredOrderList[index] - .createdOnUtc - .toString() - .substring(0, 10), - style: TextStyle( - fontSize: 14.0, + Container( + child: Text( + deliveredOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: OrderDetailsPage( - orderModel: - deliveredOrderList[ - index]), - )); - }, + Container( + margin: EdgeInsets.all(8.0), child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -215,8 +216,8 @@ class _OrderPageState extends State width: 20, ), ), - ), - ], + ], + ), ), Divider( color: Colors.grey[350], @@ -394,85 +395,85 @@ class _OrderPageState extends State return Container( child: Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderNumber, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + processingOrderList[ + index]))); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - Container( - child: Text( - processingOrderList[index] - .id - .toString(), - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + Container( + child: Text( + processingOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderDate, - style: TextStyle( - fontSize: 14.0, + ], + ), + SizedBox( + height: 5, + ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - Container( - child: Text( - processingOrderList[index] - .createdOnUtc - .toString() - .substring(0, 10), - style: TextStyle( - fontSize: 14.0, + Container( + child: Text( + processingOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: OrderDetailsPage( - orderModel: - processingOrderList[ - index]))); - }, + Container( + margin: EdgeInsets.all(8.0), child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -481,8 +482,8 @@ class _OrderPageState extends State width: 20, ), ), - ), - ], + ], + ), ), Divider( color: Colors.grey[350], @@ -837,87 +838,87 @@ class _OrderPageState extends State child: SingleChildScrollView( child: Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: - EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderNumber, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + pendingOrderList[ + index]))); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - Container( - child: Text( - pendingOrderList[index] - .id - .toString(), - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + Container( + child: Text( + pendingOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - Container( - margin: - EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderDate, - style: TextStyle( - fontSize: 14.0, + ], + ), + SizedBox( + height: 5, + ), + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - Container( - child: Text( - pendingOrderList[index] - .createdOnUtc - .toString() - .substring(0, 10), - style: TextStyle( - fontSize: 14.0, + Container( + child: Text( + pendingOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: OrderDetailsPage( - orderModel: - pendingOrderList[ - index]))); - }, + Container( + margin: EdgeInsets.all(8.0), child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -926,8 +927,8 @@ class _OrderPageState extends State width: 20, ), ), - ), - ], + ], + ), ), Divider( color: Colors.grey[350], @@ -1106,87 +1107,87 @@ class _OrderPageState extends State child: SingleChildScrollView( child: Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: - EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderNumber, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + cancelledOrderList[ + index]))); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - Container( - child: Text( - cancelledOrderList[index] - .id - .toString(), - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, + Container( + child: Text( + cancelledOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - Container( - margin: - EdgeInsets.only(right: 5), - child: Text( - TranslationBase.of(context) - .orderDate, - style: TextStyle( - fontSize: 14.0, + ], + ), + SizedBox( + height: 5, + ), + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - Container( - child: Text( - cancelledOrderList[index] - .createdOnUtc - .toString() - .substring(0, 10), - style: TextStyle( - fontSize: 14.0, + Container( + child: Text( + cancelledOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: OrderDetailsPage( - orderModel: - cancelledOrderList[ - index]))); - }, + Container( + margin: EdgeInsets.all(8.0), child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -1195,8 +1196,8 @@ class _OrderPageState extends State width: 20, ), ), - ), - ], + ], + ), ), Divider( color: Colors.grey[350], diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 1275042a..aadb5a90 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -321,8 +321,7 @@ class _OrderDetailsPageState extends State { margin: EdgeInsets.only(bottom: 10.0, top: 10.0), child: Text( model.orderListModel[0].paymentName - .toString() - .substring(12), + .toString(), style: TextStyle( fontSize: 13.0, fontWeight: FontWeight.bold, diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart index fba53c1c..24986c74 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart @@ -45,9 +45,9 @@ class BottomNavHomeItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox( - height: 15, - ), +// SizedBox( +// height: 15, +// ), currentIndex == index ? Divider( // color: Color(0xff5AB145), @@ -57,19 +57,24 @@ class BottomNavHomeItem extends StatelessWidget { thickness: 0, ), Container( + margin: EdgeInsets.only(bottom: 5.0), child: Image.asset( 'assets/images/habib-logo.png', ), height: 22.0, + ), SizedBox( - height: 9, + height: 5, ), - Texts( - title, - textAlign: TextAlign.start, - color: currentIndex == index ? Colors.grey : Colors.grey, - fontSize: 11, + Container( + margin: EdgeInsets.only(bottom: 7.0), + child: Texts( + title, + textAlign: TextAlign.start, + color: currentIndex == index ? Colors.grey : Colors.grey, + fontSize: 11, + ), ), // Added TextAlign Property ], diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart index ff0cac32..6e6a5f53 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart @@ -39,7 +39,7 @@ class BottomNavPharmacyItem extends StatelessWidget { return Expanded( child: SizedBox( - // height: 72.0, + height: 66.0, child: Stack( clipBehavior: Clip.none, children: [ @@ -63,17 +63,18 @@ class BottomNavPharmacyItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox( - height: 15, - ), +// SizedBox( +// height: 15, +// ), currentIndex == index ? Divider( - color: Color(0xff5AB145), + color: Color(0xff5AB133), thickness: 3.5, ) : Divider( thickness: 0, ), + Container( child: Icon(currentIndex == index ? activeIcon : icon, color: isHome @@ -81,7 +82,7 @@ class BottomNavPharmacyItem extends StatelessWidget { : currentIndex == index ? Colors.grey : Colors.grey, - size: 22.0), + size: 20.0), ), SizedBox( height: 11, @@ -93,7 +94,7 @@ class BottomNavPharmacyItem extends StatelessWidget { textAlign: TextAlign.center, color: currentIndex == index ? Colors.grey : Colors.grey, fontWeight: currentIndex == index - ? FontWeight.bold + ? FontWeight.normal : FontWeight.w400, fontSize: currentIndex == index ? 13 : 11, ), @@ -108,13 +109,13 @@ class BottomNavPharmacyItem extends StatelessWidget { 0) Positioned( top: 11.5, - right: -4.5, + right: -3.5, child: Container( decoration: BoxDecoration( color: Colors.red, borderRadius: BorderRadius.circular(15), ), - padding: EdgeInsets.only(left: 7, right: 6.5), + padding: EdgeInsets.only(left: 6.5, right: 6.5), height: 18, child: Center( child: Texts( diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 78ea12b0..0d4c91e0 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -25,6 +25,7 @@ class productTile extends StatelessWidget { final PharmacyProduct product; final dynamic productID; final Function onDelete; + final dynamic approvedTotalReviews; // final VoidCallback deleteWishlistItems; productTile( @@ -43,6 +44,8 @@ class productTile extends StatelessWidget { this.product, this.productID, this.onDelete, + this.approvedTotalReviews, + }); @override @@ -112,22 +115,33 @@ class productTile extends StatelessWidget { ), ), this.isOrderDetails == false - ? Container( - margin: EdgeInsets.all(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, + ? Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(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, + ), + ), ), + Text( '$approvedTotalReviews', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.grey, + fontSize: 13), ), - ) + ], + ) : Container(), ], ), @@ -150,7 +164,9 @@ class productTile extends StatelessWidget { height: 50, ), IconButton( - icon: Icon(FontAwesomeIcons.shoppingCart, size: 15), + icon: Icon(Icons.shopping_cart, + size: 18, + color: Colors.blue,), onPressed: () async { GifLoaderDialogUtils.showMyDialog(context); await addToCartFunction(1, productID); From d409875741f5b2469f773f35cf04f1edfd1a8600 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 25 Oct 2021 10:23:31 +0300 Subject: [PATCH 3/9] Smartwatch updates --- lib/config/config.dart | 4 +-- lib/core/service/client/base_app_client.dart | 2 +- .../distance/distanceTracker.dart | 2 ++ .../heartrate/heartrateTracker.dart | 20 +++++++------- .../smart_watch_instructions.dart | 2 +- .../steps/stepsTracker.dart | 2 ++ lib/uitl/date_uitl.dart | 9 +++++++ lib/widgets/charts/show_chart.dart | 27 +++++++++++-------- 8 files changed, 42 insertions(+), 26 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index efac58e5..7270f91e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index b1a84fb0..4f8a3f5d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -115,7 +115,7 @@ class BaseAppClient { } // body['PatientID'] = 1018977; - // body['TokenID'] = "@dm!n"; + body['TokenID'] = "@dm!n"; body.removeWhere((key, value) => key == null || value == null); diff --git a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart index 32811cf9..787bc210 100644 --- a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart @@ -262,6 +262,7 @@ class _DistanceTrackerState extends State with SingleTickerProv timeSeries: weeklyTimeSeriesData, indexes: weeklyTimeSeriesData.length ~/ 5.5, horizontalInterval: 8, + isWeeklyOrMonthly: true, ), ), Container( @@ -337,6 +338,7 @@ class _DistanceTrackerState extends State with SingleTickerProv timeSeries: monthlyTimeSeriesData, indexes: monthlyTimeSeriesData.length ~/ 5.5, horizontalInterval: 8, + isWeeklyOrMonthly: true, ), ), Container( diff --git a/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart b/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart index d4fd738a..1c109669 100644 --- a/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart @@ -99,7 +99,7 @@ class _HeartRateTrackerState extends State with SingleTickerPr } else if (value == 1) { getMonthlyHeartRateData(); } else { - // getYearlyHeartRateData(); + getYearlyHeartRateData(); } }, ), @@ -109,11 +109,7 @@ class _HeartRateTrackerState extends State with SingleTickerPr children: [ isWeeklyDataLoaded ? getWeeklyHeartRateDetails() : Container(), isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(), - // isYearlyDataLoaded ? getYearlyDistanceDetails() : Container() - - // Container(), - // Container(), - Container() + isYearlyDataLoaded ? getYearlyHeartRateDetails() : Container() ], controller: _tabController, ), @@ -183,13 +179,13 @@ class _HeartRateTrackerState extends State with SingleTickerPr yearlyDataLength = 0; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getPatientHealthDataStats(7, 3, context).then((res) { + service.getPatientHealthDataStats(3, 3, context).then((res) { GifLoaderDialogUtils.hideDialog(context); yearlyHearRateList.clear(); res['Med_GetYearTransactionsStsList'].forEach((element) { yearlyHearRateList.add(new YearlyHeartRateResModel.fromJson(element)); - if (element['ValueSum'] != null) { - num value = element['ValueSum']; + if (element['ValueAvg'] != null) { + num value = element['ValueAvg']; avgYearlyHearRateValue += value; yearlyDataLength++; } @@ -264,6 +260,7 @@ class _HeartRateTrackerState extends State with SingleTickerPr timeSeries: weeklyTimeSeriesData, indexes: weeklyTimeSeriesData.length ~/ 5.5, horizontalInterval: 8, + isWeeklyOrMonthly: true, ), ), Container( @@ -339,6 +336,7 @@ class _HeartRateTrackerState extends State with SingleTickerPr timeSeries: monthlyTimeSeriesData, indexes: monthlyTimeSeriesData.length ~/ 5.5, horizontalInterval: 8, + isWeeklyOrMonthly: true, ), ), Container( @@ -424,11 +422,11 @@ class _HeartRateTrackerState extends State with SingleTickerPr children: [ Container( padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0), - child: Text(TranslationBase.of(context).avgDistance, style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).avgHeartRate, style: TextStyle(fontSize: 18.0)), ), Container( margin: EdgeInsets.only(bottom: 10.0), - child: Text(yearlyStatsAvgValue.toString() + " " + TranslationBase.of(context).km_, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + child: Text(yearlyStatsAvgValue.toString() + " " + TranslationBase.of(context).bpm, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), ), ], ), diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index c550fa08..b4471611 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -447,7 +447,7 @@ class _SmartWatchInstructionsState extends State { options: CarouselOptions( // enableInfiniteScroll: true, viewportFraction: 0.99, - height: MediaQuery.of(context).size.height*1.02 ), + height: MediaQuery.of(context).size.height*1.1 ), items: [1, 2].map((i) { return Builder( builder: (BuildContext context) { diff --git a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart index 74ea76f4..c1be5f2d 100644 --- a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart @@ -258,6 +258,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt timeSeries: weeklyTimeSeriesData, indexes: weeklyTimeSeriesData.length ~/ 5.5, horizontalInterval: 8, + isWeeklyOrMonthly: true, ), ), Container( @@ -333,6 +334,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt timeSeries: monthlyTimeSeriesData, indexes: monthlyTimeSeriesData.length ~/ 5.5, horizontalInterval: 8, + isWeeklyOrMonthly: true, ), ), Container( diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 337d4af0..a11b85e6 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -395,6 +395,15 @@ class DateUtil { return ""; } + /// get data formatted like 26/4/2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthDateFormatted(DateTime dateTime) { + if (dateTime != null) + return DateFormat('dd/MM').format(dateTime); + else + return ""; + } + /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted according to language static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) { diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index 86c83f5b..301d45ff 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -10,8 +10,9 @@ class ShowChart extends StatelessWidget { final List timeSeries; final int indexes; final double horizontalInterval; + final bool isWeeklyOrMonthly; - ShowChart({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 8.0}); + ShowChart({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 8.0, this.isWeeklyOrMonthly = false}); List xAxixs = List(); List yAxixs = List(); @@ -115,19 +116,23 @@ class ShowChart extends StatelessWidget { rotateAngle: -65, margin: 22, getTitles: (value) { - if (timeSeries.length < 15) { - if (timeSeries.length > value.toInt()) { - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - } else - return ''; + if(isWeeklyOrMonthly) { + return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.month}'; } else { - if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - if (xAxixs.contains(value.toInt())) { - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } } + return ''; } - return ''; }, ), leftTitles: SideTitles( From 1fff2dad251b2109fd6cdf0113e50061cb19e6a4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 25 Oct 2021 16:21:27 +0300 Subject: [PATCH 4/9] Smartwatch updates --- assets/images/SmartWatches/distance.png | Bin 0 -> 3432 bytes assets/images/SmartWatches/steps.png | Bin 0 -> 2739 bytes lib/config/config.dart | 6 +- lib/config/localized_values.dart | 10 + lib/core/service/client/base_app_client.dart | 4 +- lib/core/viewModels/er/rrt-view-model.dart | 46 +- .../rapid-response-team/rrt-logs-page.dart | 9 +- .../rapid-response-team/rrt-main-screen.dart | 51 +- .../rrt-order-list-item.dart | 23 +- .../rapid-response-team/rrt-place-order.dart | 2 +- .../rapid-response-team/rrt-request-page.dart | 9 +- .../distance/distanceTracker.dart | 2 +- .../health_data_list.dart | 163 ++---- .../heartrate/heartrateTracker.dart | 2 +- .../smart_watch_instructions.dart | 547 ++++++------------ .../steps/stepsTracker.dart | 2 +- lib/uitl/translations_delegate_base.dart | 22 + 17 files changed, 373 insertions(+), 525 deletions(-) create mode 100644 assets/images/SmartWatches/distance.png create mode 100644 assets/images/SmartWatches/steps.png diff --git a/assets/images/SmartWatches/distance.png b/assets/images/SmartWatches/distance.png new file mode 100644 index 0000000000000000000000000000000000000000..d07f3e8aa96e286d21389001cb2e0a7142baf592 GIT binary patch literal 3432 zcmV-u4VUtXP)Px?B1uF+RCodHT|ILY$rj8i-4#RTDjROdfJ95?jO7<-2^}FaXSa&% z4Dk!JWX^609cf8`jM3q%a)wkU*gCt)QUcVS+41vCPw)23&h$*rhtQ6;tEBGfkGH$u zr{8}25D^&ICwOj4rN)$4ec+MlpGdw+MOW3u@glN5|(3mp<1LWw_D zf7w+mq1YUtbnEM1e}~1`ntERJgJVd=pWgT{|NQUCzb47_$z<~J$H_bY%k^Ikr{esV z0LQ31Afi{0f0U%NdXARFMRdtjOz+xk1h0FyhX7{Nz~rOv{TEjZ>1Q@6)G6mg(9hw( zwhbVpg$*P0MsR4Ly9VHThV(O=6oLXhVVG)yW2}~TY&pc$6{fp^sa)O^XDZv~v=9_9 zXCteV0Blrt`TE9xHO!*Rc!1V5rJvQb5EN7Au{`rl>3L~fGUw%4rN=pt3(6En@$n+7 zr=~fO3rf=sSkYhPKrSday6-L)D;@)V^^4-US2@Xn5ELl$eFHo08PbeNzw>Un$dI|R z17Kq#fis#INs3W#c)aW?!=DS`kxO<-ECN>gDuq32`WmIA&7yew$g{0kM1cTL2_OlZ z*;#{Q9N8G_%`V&Sln@lj9OLfW`y?(uF3O7N*k&&$|1c;0%qA;I0RtQ(ldxau-|+6d zCc{nKqLBqJvyjIqSwD$j$3*8Wr-9efaeA7HO9ucaceMmvFhap`;Ak7mK;YP3^ibXv zIS%EYLOT07+0Jb83>0zzk}!bxEyGQ^)m@62yXW;}9y~%?wu(rLUd|>=DQVN?7MJ~B z2nPm=!UZ2ZjTb&fJgs=1CocrGJgLE$q%cR*($WSgkyHIe?B9wSCeXe>~kQ5SWMp}3; z^T91LQe;O?*MDh)a0&Ks4i+<&oevwh2U*kFf~2szW~9a0S!O^m%J*slge<0^e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>%{18T^07CMyaJ2wm;hfzYqISAf)m+mM zrBuEu4UlY_V?{%2^xWDSe8!PSX@F4S>BK8S*SdlsS_(YIl0_vm8h%IN(k(iOIhNK` zP^wf9$@Rs01I@OI28_tJl=C@@_eubv1~~%-d$Zgx3U^hnSGa2{qpT!k9aj}I!l?1~ z$?>$J&lwmCMc>}qI0nKFl8wuAKdeI$svJMzHrt>7V3hwDp7BS2`q_M{+(S;9 tm5!0saC8ldMcAN_l(BvDqz+X+{|}~L9uGsWL~Q^7002ovPDHLkV1glF7ncA4 literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 7270f91e..d4ab58a9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -452,6 +452,8 @@ const UPDATE_CMC_ORDER_RC = 'rc/api/cmc/update'; // RRT RC SERVICES const ADD_RRT_ORDER_RC = "rc/api/rrt/add"; +const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list"; +const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update'; //Pharmacy wishlist const GET_WISHLIST = "shopping_cart_items/"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7584ec6e..d1f138e4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1584,4 +1584,14 @@ const Map localizedValues = { "avgDistance": { "en": "Average Distance", "ar": "متوسط المسافة" }, "enterDetails": {"en": "Enter Details", "ar": "أدخل التفاصيل"}, "avgHeartRate": { "en": "Average Heart Rate", "ar": "متوسط معدل ضربات القلب" }, + "alreadySynced": { "en": "Already Synced", "ar": "متزامنة" }, + "sync-instructions-intro1": { "en": "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", "ar": "يبدو أنك لم تقم بمزامنة بياناتك الصحية مع تطبيق Dr. Alhabib App من قبل. للمتابعة ، تحتاج إلى مزامنة بياناتك الصحية مع تطبيق Dr. Alhabib" }, + "sync-instructions-intro2": { "en": "Before syncing data, please make sure that you have followed the instructions properly", "ar": "قبل مزامنة البيانات ، يرجى التأكد من اتباع التعليمات بشكل صحيح." }, + "sync-instructions-intro3": { "en": "Before syncing data, please make sure that following instructions are met:", "ar": "قبل مزامنة البيانات ، يرجى التأكد من تلبية الإرشادات التالية:" }, + "ios-instructions-1": { "en": "Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", "ar": "تأكد من أنك قمت بتثبيت تطبيق 'Health' App & 'Watch' من متجر Apple." }, + "ios-instructions-2": { "en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health." }, + "ios-instructions-3": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك." }, + "supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" }, + "watchInstructions": { "en": "Watch Instructions:", "ar": "تعليمات الساعة:" }, + "monthlyTab": {"en": "Monthly", "ar": "شهري"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 4f8a3f5d..c35be69b 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -114,8 +114,10 @@ class BaseAppClient { } } + // body['IdentificationNo'] = 1009199553; + // body['MobileNo'] = "966545156035"; // body['PatientID'] = 1018977; - body['TokenID'] = "@dm!n"; + // body['TokenID'] = "@dm!n"; body.removeWhere((key, value) => key == null || value == null); diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index 83732ebd..60411fab 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; @@ -17,8 +18,8 @@ import '../base_view_model.dart'; class RRTService extends BaseService {} class _RRTServiceData { - List pendingOrders = []; - List completedOrders = []; + List pendingOrders = []; + List completedOrders = []; ServicePrice servicePrice; } @@ -34,7 +35,8 @@ class RRTViewModel extends BaseViewModel { Future<_RRTServiceData> loadRequiredData() async { await getServicePrice(); - await getAllOrders(); + // await getAllOrders(); + await getAllOrdersRC(); return rrtServiceData; } @@ -79,9 +81,9 @@ class RRTViewModel extends BaseViewModel { if (json["ServiceID"] == 5) { if (json["Status"] == 1 || json["Status"] == 2) { // Pending - rrtServiceData.pendingOrders.add(PrescriptionsOrder.fromJson(json)); + rrtServiceData.pendingOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); } - rrtServiceData.completedOrders.add(PrescriptionsOrder.fromJson(json)); + rrtServiceData.completedOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); } }); } @@ -91,6 +93,26 @@ class RRTViewModel extends BaseViewModel { return rrtServiceData; } + Future<_RRTServiceData> getAllOrdersRC() async { + await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, body: {}, onSuccess: (response, statusCode) { + var data = response["response"]; + rrtServiceData.completedOrders.clear(); + rrtServiceData.pendingOrders.clear(); + if (data != null && data is List) { + data.forEach((json) { + if (json["StatusId"] == 1 || json["StatusId"] == 2) { + // Pending + rrtServiceData.pendingOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); + } + rrtServiceData.completedOrders.add(GetCMCAllOrdersResponseModel.fromJson(json)); + }); + } + }, onFailure: (error, statusCode) { + AppToast.showErrorToast(message: error); + }); + return rrtServiceData; + } + Future getOrderDetails() async { return null; } @@ -136,6 +158,19 @@ class RRTViewModel extends BaseViewModel { return Future.value(success); } + Future cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async { + Map body = {"Id": order.iD, "ClickButton": 16}; + var success = false; + await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { + success = true; + rrtServiceData.pendingOrders.remove(order); + }, onFailure: (error, statusCode) { + AppToast.showErrorToast(message: error); + success = false; + }); + return Future.value(success); + } + Future> getAddresses() async { Object error; try { @@ -175,7 +210,6 @@ class RRTViewModel extends BaseViewModel { await getCustomerAddresses(); } - // setState(ViewState.Busy); // await _pharmacy_service.generatePharmacyToken(); // if (_customerAddressesService.hasError) { diff --git a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart index c7c12a2d..2a1dd3c9 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; @@ -11,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; class RRTLogPage extends StatefulWidget { - final List orders; + final List orders; const RRTLogPage({this.orders}); @@ -45,13 +46,13 @@ class RRTLogPageState extends State { }); } - deleteOrder(PrescriptionsOrder order) async { + deleteOrder(GetCMCAllOrdersResponseModel order) async { GifLoaderDialogUtils.showMyDialog(context); - var success = await viewModel.cancelOrder(order); + var success = await viewModel.cancelOrderRC(order); if (success) { viewModel.setState(ViewState.Busy); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); viewModel.setState(ViewState.Idle); Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(context, FadePage(page: RRTMainScreen())); diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index 351c918a..62fa4745 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -7,10 +8,13 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class RRTMainScreen extends StatefulWidget { final index = 0; + RRTMainScreen({index}); + @override State createState() => RRTMainScreenState(); } @@ -25,6 +29,8 @@ class RRTMainScreenState extends State with SingleTickerProviderS List imagesInfo = List(); + ProjectViewModel projectViewModel; + @override void initState() { super.initState(); @@ -36,6 +42,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); localize = TranslationBase.of(context); return AppScaffold( @@ -80,20 +87,40 @@ class RRTMainScreenState extends State with SingleTickerProviderS margin: EdgeInsets.all(0.0), clipBehavior: Clip.hardEdge, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), - child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [ - Tab( - child: Text( - localize.rapidResponseTeam, - style: TextStyle(color: Theme.of(context).appBarTheme.color), + child: TabBar( + onTap: onPageChanged, + controller: tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 5, bottom: 5), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), - ), - Tab( - child: Text( - localize.orderLog, - style: TextStyle(color: Theme.of(context).appBarTheme.color), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), - ), - ]), + tabs: [ + Tab( + child: Text( + localize.rapidResponseTeam, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), + ), + Tab( + child: Text( + localize.orderLog, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), + ), + ]), ); Widget contentPager() => PageView( diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart index a2ef7cd0..8a4f1e18 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -16,8 +17,8 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); class RRTLogListItem extends StatefulWidget { - final PrescriptionsOrder order; - final Function(PrescriptionsOrder) onCancel; + final GetCMCAllOrdersResponseModel order; + final Function(GetCMCAllOrdersResponseModel) onCancel; RRTLogListItem(this.order, {this.onCancel}); @override @@ -34,8 +35,8 @@ class RRTLogListItemState extends State { ProjectViewModel projectViewModel = Provider.of(context); localize = TranslationBase.of(context); - int status = widget.order.status; - String _statusDisp = projectViewModel.isArabic ? widget.order.descriptionN : widget.order.description; + int status = widget.order.statusId; + String _statusDisp = widget.order.statusText; Color _color; if (status == 1) { //pending @@ -46,7 +47,7 @@ class RRTLogListItemState extends State { } else if (status == 3) { //completed _color = Color(0xff359846); - } else if (status == 4) { + } else if (status == 4 || status == 6 || status == 7) { //cancel // Rejected _color = Color(0xffD02127); } @@ -111,7 +112,7 @@ class RRTLogListItemState extends State { ), Expanded( child: Text( - !projectViewModel.isArabic ? widget.order.nearestProjectDescription.trim().toString() : widget.order.nearestProjectDescriptionN.toString(), + widget.order.projectName.toString(), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -126,7 +127,7 @@ class RRTLogListItemState extends State { ), Expanded( child: Text( - widget.order.getFormattedDateTime(), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -140,11 +141,11 @@ class RRTLogListItemState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormattedLang(widget.order.createdOn, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (widget.order.status == 1 || widget.order.status == 2) + if (widget.order.statusId == 1 || widget.order.statusId == 2) InkWell( onTap: () { //onCancel(order); @@ -227,11 +228,11 @@ class RRTLogListItemState extends State { // ); cancelOrders(order) async { GifLoaderDialogUtils.showMyDialog(context); - var success = await viewModel.cancelOrder(order); + var success = await viewModel.cancelOrderRC(order); if (success) { viewModel.setState(ViewState.Busy); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); viewModel.setState(ViewState.Idle); Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(context, FadePage(page: RRTMainScreen())); diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index 4e863bd1..938b0528 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -217,7 +217,7 @@ class RRTPlaceOrderPage extends StatelessWidget { gotoRRTRoot() async { viewModel.setState(ViewState.Busy); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); viewModel.setState(ViewState.Idle); Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(_context, FadePage(page: RRTMainScreen())); diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 28cd3cf4..1848f52c 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; @@ -15,7 +16,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RRTRequestPage extends StatefulWidget { - final List pendingOrders; + final List pendingOrders; final ServicePrice servicePrice; RRTRequestPage({this.pendingOrders, this.servicePrice}); @@ -208,14 +209,14 @@ class RRTRequestPageState extends State { ))); } - deleteOrder(PrescriptionsOrder order) async { + deleteOrder(GetCMCAllOrdersResponseModel order) async { GifLoaderDialogUtils.showMyDialog(context); - var success = await viewModel.cancelOrder(order); + var success = await viewModel.cancelOrderRC(order); GifLoaderDialogUtils.hideDialog(context); if (success) setState(() { widget.pendingOrders.remove(order); }); - await viewModel.getAllOrders(); + await viewModel.getAllOrdersRC(); } } diff --git a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart index 787bc210..cceb8b1e 100644 --- a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart @@ -89,7 +89,7 @@ class _DistanceTrackerState extends State with SingleTickerProv ), tabs: [ Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).monthlyTab), Tab(text: TranslationBase.of(context).yearly), ], onTap: (value) { diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart index f63e3151..f43a6e63 100644 --- a/lib/pages/medical/smart_watch_health_data/health_data_list.dart +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/dista import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -30,118 +31,35 @@ class _HealthDataListState extends State { @override Widget build(BuildContext context) { + List myMedicalList = myOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).smartWatches, isShowAppBar: true, showNewAppBar: true, showNewAppBarTitle: true, body: Container( - height: MediaQuery.of(context).size.height, - margin: EdgeInsets.all(20.0), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: HeartRateTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).heart, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - ), - Divider( - color: Colors.grey[500], - ), - Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/sleep_data.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Sleep Data", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], + Container( + width: double.infinity, + height: 20, ), - Divider( - color: Colors.grey[500], - ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: StepsTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).steps, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], + Padding( + padding: EdgeInsets.only(left: 12, right: 12), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + return myMedicalList[index]; + }, ), ), - Divider( - color: Colors.grey[500], - ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DistanceTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).distance, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - ), - Divider( - color: Colors.grey[500], - ), - // Row( - // children: [ - // Container( - // child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), - // ), - // Container( - // margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - // child: Text("Energy", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - // ), - // ], - // ), - // Divider( - // color: Colors.grey[500], - // ), ], ), ), @@ -159,6 +77,53 @@ class _HealthDataListState extends State { ); } + + List myOptionsList(BuildContext context) { + List medical = List(); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: HeartRateTracker()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).heart, + imagePath: 'assets/images/SmartWatches/heartrate_icon.png', + subTitle: null, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: StepsTracker()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).steps, + imagePath: 'assets/images/SmartWatches/steps.png', + subTitle: null, + isPngImage: true, + ), + )); + + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage(page: DistanceTracker()), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).distance, + imagePath: 'assets/images/SmartWatches/distance.png', + subTitle: null, + isPngImage: true, + ), + )); + + return medical; + } + + // void readLast() async { // print("ReadLast"); // final result = await FitKit.readLast(DataType.DISTANCE); diff --git a/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart b/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart index 1c109669..da82d540 100644 --- a/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart @@ -89,7 +89,7 @@ class _HeartRateTrackerState extends State with SingleTickerPr ), tabs: [ Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).monthlyTab), Tab(text: TranslationBase.of(context).yearly), ], onTap: (value) { diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index b4471611..4c515e3a 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/healt import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -24,13 +26,12 @@ class _SmartWatchInstructionsState extends State { bool hasAlreadySynced = false; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - if(authenticatedUserObject.isLogin) getLastPatientRecord(context); + if (authenticatedUserObject.isLogin) getLastPatientRecord(context); }); super.initState(); } @@ -49,9 +50,7 @@ class _SmartWatchInstructionsState extends State { ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/1.png') ], body: Container( - child: Platform.isIOS - ? _getAppleWatchInstructions() - : _getGoogleWatchInstructions(), + child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(), )); } @@ -65,10 +64,7 @@ class _SmartWatchInstructionsState extends State { // margin: EdgeInsets.only(top: 10.0), child: CarouselSlider( carouselController: buttonCarouselController, - options: CarouselOptions( - enableInfiniteScroll: false, - viewportFraction: 0.95, - height: MediaQuery.of(context).size.height * 0.9), + options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9), items: [1, 2].map((i) { return Builder( builder: (BuildContext context) { @@ -83,33 +79,24 @@ class _SmartWatchInstructionsState extends State { ), child: i == 1 ? Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Supported Smartwatches", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold)), + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), Container( child: Row( children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-1.jpeg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 1", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -117,20 +104,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-2.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 2", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -145,20 +125,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-3.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 3", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -166,20 +139,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-4.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 4", overflow: TextOverflow.clip , - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -194,20 +160,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/apple-watch-5.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 5", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -215,20 +174,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/Apple-Watch-6.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Apple Watch Series 6", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -243,19 +195,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand3.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 3", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -263,19 +209,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand4.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 4", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -285,143 +225,78 @@ class _SmartWatchInstructionsState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB( - 10.0, 30.0, 10.0, 10.0), - child: Text( - "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 30.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "Before syncing data, please make sure that you have followed the instructions properly", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.all(15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - buttonCarouselController.nextPage(); - }, - child: Text("CONTINUE", - style: TextStyle(fontSize: 18.0)), - ), + margin: EdgeInsets.fromLTRB(15.0, 40.0, 15.0, 0.0), + child: DefaultButton( + TranslationBase.of(context).continues, + () { + buttonCarouselController.nextPage(); + }, + color: Color(0xff359846), ), ), ], ) : Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Watch Instructions:", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), Container( - margin: EdgeInsets.all(10.0), - child: Text( - "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.fromLTRB( - 10.0, 20.0, 10.0, 10.0), - child: Text( - "Before syncing data, please make sure that following instructions are met: ", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.fromLTRB( - 10.0, 20.0, 10.0, 10.0), - child: Text( - "1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.all(10.0), - child: Text( - "2. Make sure that your Apple Watch is connected with the Watch & Health Apps.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( - margin: EdgeInsets.all(10.0), - child: Text( - "3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), - Container( - margin: EdgeInsets.fromLTRB( - 15.0, 80.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - buttonCarouselController.nextPage(); - }, - child: Text("SYNC HEALTH DATA", - style: TextStyle(fontSize: 18.0)), - ), + Padding( + padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).syncHealthData, + () {}, + color: Color(0xFFD02127), + disabledColor: Color(0xff28323A).withOpacity(0.3), + ), + ), + mWidth(12), + if (hasAlreadySynced) + Expanded( + child: DefaultButton( + TranslationBase.of(context).alreadySynced, + () { + _openHealthDataList(); + }, + color: Color(0xff359846), + ), + ), + ], ), ), - hasAlreadySynced ? Container( - margin: EdgeInsets.fromLTRB( - 15.0, 0.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - _openHealthDataList(); - }, - child: Text("ALREADY SYNCED", - style: TextStyle(fontSize: 18.0)), - ), - ), - ): Container(), ], ), )); @@ -447,7 +322,7 @@ class _SmartWatchInstructionsState extends State { options: CarouselOptions( // enableInfiniteScroll: true, viewportFraction: 0.99, - height: MediaQuery.of(context).size.height*1.1 ), + height: MediaQuery.of(context).size.height * 0.9), items: [1, 2].map((i) { return Builder( builder: (BuildContext context) { @@ -455,7 +330,7 @@ class _SmartWatchInstructionsState extends State { width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 5.0), child: Card( - margin: EdgeInsets.only(top:16.0 , bottom: 8.0), + margin: EdgeInsets.only(top: 16.0, bottom: 8.0), // fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white.withOpacity(1.0), shape: RoundedRectangleBorder( @@ -466,31 +341,20 @@ class _SmartWatchInstructionsState extends State { children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Supported Smartwatches", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + child: Text("Supported Smartwatches", style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, fontFamily: "WorkSans")), ), Container( child: Row( children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/huawei-watch-2.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/huawei-watch-2.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Huawei Watch 2", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Huawei Watch 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -498,21 +362,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 10.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/ticwatche2.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "Mobovi TicWatch E2", - overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mobovi TicWatch E2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -527,19 +383,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/huawei-watch-2-classic.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/huawei-watch-2-classic.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Huawei Watch", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Huawei Watch", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -547,19 +397,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/ticwatche2.png", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/ticwatche2.png", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Fossil Sport", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Fossil Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -574,20 +418,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/misfit-vapor-2.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/misfit-vapor-2.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "MisFit Vapor 2", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("MisFit Vapor 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -595,20 +432,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/lg-watch-sport.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/lg-watch-sport.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text( - "LG Watch Sport", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("LG Watch Sport", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -623,19 +453,13 @@ class _SmartWatchInstructionsState extends State { children: [ Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand3.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 3", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -643,19 +467,13 @@ class _SmartWatchInstructionsState extends State { ), Expanded( child: Container( - margin: - EdgeInsets.only(top: 15.0), + margin: EdgeInsets.only(top: 15.0), child: Row( children: [ - Image.asset( - "assets/images/SmartWatches/miBand4.jpg", - width: 70.0, - height: 70.0), + Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), Container( - width: MediaQuery.of(context).size.width*0.22, - child: Text("Mi Band 4", overflow: TextOverflow.clip, - style: TextStyle( - fontSize: 12.0)), + width: MediaQuery.of(context).size.width * 0.22, + child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), ) ], ), @@ -666,18 +484,11 @@ class _SmartWatchInstructionsState extends State { ), InkWell( onTap: () { - launch( - "https://wearos.google.com/#find-your-watch"); + launch("https://wearos.google.com/#find-your-watch"); }, child: Container( margin: EdgeInsets.only(top: 20.0), - child: Text( - "More Supported Smartwatches...", - style: TextStyle( - fontSize: 17.0, - color: Colors.blue, - decoration: - TextDecoration.underline)), + child: Text("More Supported Smartwatches...", style: TextStyle(fontSize: 17.0, color: Colors.blue, decoration: TextDecoration.underline)), ), ), Container( @@ -689,20 +500,16 @@ class _SmartWatchInstructionsState extends State { ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "Before syncing data, please make sure that you have followed the instructions properly", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: + Text("Before syncing data, please make sure that you have followed the instructions properly", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(15.0), child: ButtonTheme( shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width, + minWidth: MediaQuery.of(context).size.width, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -713,8 +520,7 @@ class _SmartWatchInstructionsState extends State { onPressed: () { buttonCarouselController.nextPage(); }, - child: Text("CONTINUE", - style: TextStyle(fontSize: 18.0)), + child: Text("CONTINUE", style: TextStyle(fontSize: 18.0)), ), ), ), @@ -724,11 +530,7 @@ class _SmartWatchInstructionsState extends State { children: [ Container( margin: EdgeInsets.only(top: 10.0), - child: Text("Watch Instructions:", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + child: Text("Watch Instructions:", style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, fontFamily: "WorkSans")), ), Container( margin: EdgeInsets.all(10.0), @@ -739,49 +541,33 @@ class _SmartWatchInstructionsState extends State { ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "Before syncing data, please make sure that following instructions are met: ", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("Before syncing data, please make sure that following instructions are met: ", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", + textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "2. Make sure that you have installed your watch related apps from Google PlayStore.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("2. Make sure that you have installed your watch related apps from Google PlayStore.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: + Text("3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "4. Make sure that your smart watch apps are linked/associated with Google Fit App.", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text("4. Make sure that your smart watch apps are linked/associated with Google Fit App.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), ), Container( - margin: EdgeInsets.fromLTRB( - 15.0, 75.0, 15.0, 15.0), + margin: EdgeInsets.fromLTRB(15.0, 75.0, 15.0, 15.0), child: ButtonTheme( shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width, + minWidth: MediaQuery.of(context).size.width, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -792,36 +578,33 @@ class _SmartWatchInstructionsState extends State { onPressed: () { buttonCarouselController.nextPage(); }, - child: Text("SYNC HEALTH DATA", - style: TextStyle(fontSize: 18.0)), + child: Text("SYNC HEALTH DATA", style: TextStyle(fontSize: 18.0)), ), ), ), - hasAlreadySynced ? Container( - margin: EdgeInsets.fromLTRB( - 15.0, 0.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10.0), - ), - minWidth: - MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - _openHealthDataList(); - }, - child: Text("ALREADY SYNCED", - style: TextStyle(fontSize: 18.0)), - ), - ), - ) : Container(), + hasAlreadySynced + ? Container( + margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + elevation: 0, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", style: TextStyle(fontSize: 18.0)), + ), + ), + ) + : Container(), ], ), )); diff --git a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart index c1be5f2d..5f63c2ad 100644 --- a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart @@ -89,7 +89,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt ), tabs: [ Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).monthlyTab), Tab(text: TranslationBase.of(context).yearly), ], onTap: (value) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d61b4f10..e82c6521 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2484,7 +2484,9 @@ class TranslationBase { String get mostViewed => localizedValues["mostViewed"][locale.languageCode]; String get newProducts => localizedValues["newProducts"][locale.languageCode]; + String get enterDetails => localizedValues["enterDetails"][locale.languageCode]; + String get paymentSelected => localizedValues["paymentSelected"][locale.languageCode]; String get moreNotifications => localizedValues["moreNotifications"][locale.languageCode]; @@ -2530,6 +2532,26 @@ class TranslationBase { String get avgDistance => localizedValues["avgDistance"][locale.languageCode]; String get avgHeartRate => localizedValues["avgHeartRate"][locale.languageCode]; + + String get alreadySynced => localizedValues["alreadySynced"][locale.languageCode]; + + String get syncInstructionsIntro1 => localizedValues["sync-instructions-intro1"][locale.languageCode]; + + String get syncInstructionsIntro2 => localizedValues["sync-instructions-intro2"][locale.languageCode]; + + String get syncInstructionsIntro3 => localizedValues["sync-instructions-intro3"][locale.languageCode]; + + String get iosInstructions1 => localizedValues["ios-instructions-1"][locale.languageCode]; + + String get iosInstructions2 => localizedValues["ios-instructions-2"][locale.languageCode]; + + String get iosInstructions3 => localizedValues["ios-instructions-3"][locale.languageCode]; + + String get supportedWatches => localizedValues["supportedWatches"][locale.languageCode]; + + String get watchInstructions => localizedValues["watchInstructions"][locale.languageCode]; + + String get monthlyTab => localizedValues["monthlyTab"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 30c6f1dedb1796d6d7fe2fcc3da6951307042cd6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 25 Oct 2021 17:41:23 +0300 Subject: [PATCH 5/9] Updates --- lib/config/localized_values.dart | 5 + .../all_habib_medical_service_page2.dart | 54 +++--- .../health-weather-indicator.dart | 54 +++--- .../smart_watch_instructions.dart | 172 +++++++++--------- lib/uitl/translations_delegate_base.dart | 10 + 5 files changed, 156 insertions(+), 139 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d1f138e4..113f397f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1594,4 +1594,9 @@ const Map localizedValues = { "supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" }, "watchInstructions": { "en": "Watch Instructions:", "ar": "تعليمات الساعة:" }, "monthlyTab": {"en": "Monthly", "ar": "شهري"}, + "moreSupportedWatches": {"en": "More Supported Smartwatches...", "ar": "المزيد من الساعات الذكية المدعومة..."}, + "android-instructions-1": { "en": "Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", "ar": "تأكد من تثبيت تطبيقات 'WearOS' و 'Google Fit' من متجر Google PlayStore." }, + "android-instructions-2": { "en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore." }, + "android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." }, + "android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." }, }; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index fc3eebb5..6b31b1ba 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:geolocator/geolocator.dart'; import 'package:provider/provider.dart'; @@ -89,28 +90,25 @@ class _AllHabibMedicalSevicePage2State extends State child: SingleChildScrollView( child: Column( children: [ - AspectRatio( - aspectRatio: 1.9, - child: Container( - width: double.infinity, - height: double.infinity, - decoration: containerRadiusWithGradient(0, - color1: timeCalculator(6, 0, 10, 59) - ? Color(0xFFB3E3FE) - : timeCalculator(11, 0, 15, 59) - ? Color(0xFFFF9E7E) - : Color(0xFF2E6686), - color2: timeCalculator(6, 0, 10, 59) - ? Color(0xFF9AC7FF) - : timeCalculator(11, 0, 15, 59) - ? Color(0xFFFECB50) - : Color(0xFF122F48)), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Stack( - alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight, - children: [ - Column( + Container( + width: double.infinity, + decoration: containerRadiusWithGradient(0, + color1: timeCalculator(6, 0, 10, 59) + ? Color(0xFFB3E3FE) + : timeCalculator(11, 0, 15, 59) + ? Color(0xFFFF9E7E) + : Color(0xFF2E6686), + color2: timeCalculator(6, 0, 10, 59) + ? Color(0xFF9AC7FF) + : timeCalculator(11, 0, 15, 59) + ? Color(0xFFFECB50) + : Color(0xFF122F48)), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Directionality( @@ -134,7 +132,6 @@ class _AllHabibMedicalSevicePage2State extends State color: Colors.white, ), ), - mFlex(0), Text( TranslationBase.of(context).healthWeatherIndicators, style: TextStyle( @@ -172,12 +169,11 @@ class _AllHabibMedicalSevicePage2State extends State ) ], ), - Image.asset( - "assets/images/Weather_ico.png", - color: Colors.white.withOpacity(0.5), - ), - ], - ), + ), + SvgPicture.asset( + "assets/images/new/cloudy.svg", + ), + ], ), ), ), diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart index 39264fe8..d85db81f 100644 --- a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; class HealthWeatherIndicator extends StatefulWidget { @@ -49,28 +50,25 @@ class _HospitalsPageState extends State { body: mode.weatherIndicatorData.length > 0 ? SingleChildScrollView( child: Column(children: [ - AspectRatio( - aspectRatio: 2.3, - child: Container( - width: double.infinity, - height: double.infinity, - decoration: containerRadiusWithGradient(0, - color1: timeCalculator(6, 0, 10, 59) - ? Color(0xFFB3E3FE) - : timeCalculator(11, 0, 15, 59) - ? Color(0xFFFF9E7E) - : Color(0xFF2E6686), - color2: timeCalculator(6, 0, 10, 59) - ? Color(0xFF9AC7FF) - : timeCalculator(11, 0, 15, 59) - ? Color(0xFFFECB50) - : Color(0xFF122F48)), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Stack( - alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight, - children: [ - Column( + Container( + width: double.infinity, + decoration: containerRadiusWithGradient(0, + color1: timeCalculator(6, 0, 10, 59) + ? Color(0xFFB3E3FE) + : timeCalculator(11, 0, 15, 59) + ? Color(0xFFFF9E7E) + : Color(0xFF2E6686), + color2: timeCalculator(6, 0, 10, 59) + ? Color(0xFF9AC7FF) + : timeCalculator(11, 0, 15, 59) + ? Color(0xFFFECB50) + : Color(0xFF122F48)), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Row( + children: [ + Expanded( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Directionality( @@ -94,7 +92,6 @@ class _HospitalsPageState extends State { color: Colors.white, ), ), - mFlex(0), Text( TranslationBase.of(context).healthWeatherIndicators, style: TextStyle( @@ -115,12 +112,11 @@ class _HospitalsPageState extends State { ), ], ), - Image.asset( - "assets/images/Weather_ico.png", - color: Colors.white.withOpacity(0.5), - ), - ], - ), + ), + SvgPicture.asset( + "assets/images/new/cloudy.svg", + ), + ], ), ), ), diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index 4c515e3a..7cc6ab01 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -64,7 +65,7 @@ class _SmartWatchInstructionsState extends State { // margin: EdgeInsets.only(top: 10.0), child: CarouselSlider( carouselController: buttonCarouselController, - options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9), + options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.65), items: [1, 2].map((i) { return Builder( builder: (BuildContext context) { @@ -338,10 +339,11 @@ class _SmartWatchInstructionsState extends State { ), child: i == 1 ? Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Supported Smartwatches", style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, fontFamily: "WorkSans")), + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), Container( child: Row( @@ -487,124 +489,132 @@ class _SmartWatchInstructionsState extends State { launch("https://wearos.google.com/#find-your-watch"); }, child: Container( - margin: EdgeInsets.only(top: 20.0), - child: Text("More Supported Smartwatches...", style: TextStyle(fontSize: 17.0, color: Colors.blue, decoration: TextDecoration.underline)), + margin: EdgeInsets.only(top: 20.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).moreSupportedWatches, + textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.blue, decoration: TextDecoration.underline, letterSpacing: -0.36)), ), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( margin: EdgeInsets.all(10.0), - child: - Text("Before syncing data, please make sure that you have followed the instructions properly", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), ), Container( margin: EdgeInsets.all(15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - buttonCarouselController.nextPage(); - }, - child: Text("CONTINUE", style: TextStyle(fontSize: 18.0)), - ), + child: DefaultButton( + TranslationBase.of(context).continues, + () { + buttonCarouselController.nextPage(); + }, + color: CustomColors.green, ), ), ], ) : Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("Watch Instructions:", style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, fontFamily: "WorkSans")), + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.all(10.0), - child: Text( - "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), ), Container( margin: EdgeInsets.all(10.0), - child: Text("Before syncing data, please make sure that following instructions are met: ", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), ), Container( margin: EdgeInsets.all(10.0), - child: Text("1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", - textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).androidInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), ), Container( margin: EdgeInsets.all(10.0), - child: Text("2. Make sure that you have installed your watch related apps from Google PlayStore.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).androidInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), ), Container( margin: EdgeInsets.all(10.0), - child: - Text("3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).androidInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), ), Container( margin: EdgeInsets.all(10.0), - child: Text("4. Make sure that your smart watch apps are linked/associated with Google Fit App.", textAlign: TextAlign.center, style: TextStyle(fontSize: 17.0)), + child: Text(TranslationBase.of(context).androidInstructions4, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), ), - Container( - margin: EdgeInsets.fromLTRB(15.0, 75.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - buttonCarouselController.nextPage(); - }, - child: Text("SYNC HEALTH DATA", style: TextStyle(fontSize: 18.0)), - ), - ), - ), - hasAlreadySynced - ? Container( - margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 15.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { + Padding( + padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).syncHealthData, + () {}, + color: Color(0xFFD02127), + disabledColor: Color(0xff28323A).withOpacity(0.3), + ), + ), + mWidth(12), + if (hasAlreadySynced) + Expanded( + child: DefaultButton( + TranslationBase.of(context).alreadySynced, + () { _openHealthDataList(); }, - child: Text("ALREADY SYNCED", style: TextStyle(fontSize: 18.0)), + color: Color(0xff359846), ), ), - ) - : Container(), + ], + ), + ), + // Container( + // margin: EdgeInsets.fromLTRB(15.0, 75.0, 15.0, 15.0), + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width, + // height: 45.0, + // child: RaisedButton( + // color: new Color(0xFF60686b), + // textColor: Colors.white, + // elevation: 0, + // disabledTextColor: Colors.white, + // disabledColor: new Color(0xFFbcc2c4), + // onPressed: () { + // buttonCarouselController.nextPage(); + // }, + // child: Text("SYNC HEALTH DATA", style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ), + // hasAlreadySynced + // ? Container( + // margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 15.0), + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width, + // height: 45.0, + // child: RaisedButton( + // color: new Color(0xFF60686b), + // textColor: Colors.white, + // elevation: 0, + // disabledTextColor: Colors.white, + // disabledColor: new Color(0xFFbcc2c4), + // onPressed: () { + // _openHealthDataList(); + // }, + // child: Text("ALREADY SYNCED", style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ) + // : Container(), ], ), )); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index e82c6521..c0578bbb 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2552,6 +2552,16 @@ class TranslationBase { String get watchInstructions => localizedValues["watchInstructions"][locale.languageCode]; String get monthlyTab => localizedValues["monthlyTab"][locale.languageCode]; + + String get moreSupportedWatches => localizedValues["moreSupportedWatches"][locale.languageCode]; + + String get androidInstructions1 => localizedValues["android-instructions-1"][locale.languageCode]; + + String get androidInstructions2 => localizedValues["android-instructions-2"][locale.languageCode]; + + String get androidInstructions3 => localizedValues["android-instructions-3"][locale.languageCode]; + + String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 940441106ab4b7cea3e0d4611be45f224d80a4f4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 25 Oct 2021 18:00:21 +0300 Subject: [PATCH 6/9] UI fixes --- lib/pages/ChildVaccines/add_newchild_page.dart | 1 + lib/pages/ChildVaccines/new/child_vaccine_page.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 496488d7..84989ed3 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -77,6 +77,7 @@ class _AddNewChildPageState extends State { builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).vaccination, + showNewAppBarTitle: true, showNewAppBar: true, body: Container( child: Column( diff --git a/lib/pages/ChildVaccines/new/child_vaccine_page.dart b/lib/pages/ChildVaccines/new/child_vaccine_page.dart index 71e1ea3f..cdf4e4e6 100644 --- a/lib/pages/ChildVaccines/new/child_vaccine_page.dart +++ b/lib/pages/ChildVaccines/new/child_vaccine_page.dart @@ -137,7 +137,7 @@ class _ChildPageState extends State with SingleTickerProviderS } }, child: Container( - decoration: containerRadius(Colors.black.withOpacity(0.2), 2000), + decoration: containerRadius(Colors.grey.withOpacity(0.2), 2000), padding: EdgeInsets.only(left: 12, right: 12, top: 8, bottom: 8), child: Row( children: [ From e913316c549938b7834f88831cf19b5a9dac96a2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 26 Oct 2021 11:54:11 +0300 Subject: [PATCH 7/9] Updates --- .../all_habib_medical_service_page2.dart | 42 ++++++++------- .../ChildVaccines/add_newchild_page.dart | 15 ++---- .../ChildVaccines/new/child_initial_page.dart | 12 ++--- .../ChildVaccines/new/child_vaccine_page.dart | 24 +++------ .../insurance/insurance_card_screen.dart | 5 +- .../insurance_card_update_details.dart | 54 +------------------ lib/pages/insurance/insurance_page.dart | 1 + lib/pages/landing/landing_page.dart | 6 +-- lib/pages/livecare/livecare_type_select.dart | 4 +- lib/widgets/others/app_scaffold_widget.dart | 1 + 10 files changed, 47 insertions(+), 117 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index 6b31b1ba..ac4c11e1 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -150,28 +150,32 @@ class _AllHabibMedicalSevicePage2State extends State color: Colors.white, ), ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: HealthWeatherIndicator(), - ), - ); - }, - child: Padding( - padding: const EdgeInsets.only(top: 0, bottom: 0), - child: Text( - TranslationBase.of(context).moreDetails, - style: TextStyle(fontSize: 12, letterSpacing: -0.72, fontWeight: FontWeight.w600, color: Colors.white, decoration: TextDecoration.underline), - ), - ), - ) ], ), ), - SvgPicture.asset( - "assets/images/new/cloudy.svg", + Column( + children: [ + SvgPicture.asset( + "assets/images/new/cloudy.svg", + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: HealthWeatherIndicator(), + ), + ); + }, + child: Padding( + padding: const EdgeInsets.only(top: 10, bottom: 0), + child: Text( + TranslationBase.of(context).moreDetails, + style: TextStyle(fontSize: 12, letterSpacing: -0.72, fontWeight: FontWeight.w600, color: Colors.white, decoration: TextDecoration.underline), + ), + ), + ) + ], ), ], ), diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 84989ed3..fa526360 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -4,15 +4,12 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; -import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -72,7 +69,6 @@ class _AddNewChildPageState extends State { @override Widget build(BuildContext context) { - return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -254,12 +250,9 @@ class _AddNewChildPageState extends State { width: double.infinity, padding: EdgeInsets.all(16), color: Colors.white, - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false ? Colors.white24 : CustomColors.accentColor, - label: TranslationBase.of(context).add, - // - onTap: () async { + child: DefaultButton( + TranslationBase.of(context).add, + () async { newChild.babyName = _firstTextController.text + " " + _secondTextController.text; newChild.gender = checkedValue.toString(); newChild.strDOB = getStartDay(); diff --git a/lib/pages/ChildVaccines/new/child_initial_page.dart b/lib/pages/ChildVaccines/new/child_initial_page.dart index 6069f814..a0deec0c 100644 --- a/lib/pages/ChildVaccines/new/child_initial_page.dart +++ b/lib/pages/ChildVaccines/new/child_initial_page.dart @@ -1,13 +1,12 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; -import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -126,12 +125,9 @@ class _ChildVaccinesPageState extends State with SingleTickerP }, ), if (checkedValue) mHeight(16), - SecondaryButton( - textColor: Colors.white, - color: CustomColors.accentColor, - label: TranslationBase.of(context).viewListChildren, - // - onTap: () => Navigator.push( + DefaultButton( + TranslationBase.of(context).viewListChildren, + () => Navigator.push( context, FadePage( page: ChildVaccinePage(), diff --git a/lib/pages/ChildVaccines/new/child_vaccine_page.dart b/lib/pages/ChildVaccines/new/child_vaccine_page.dart index cdf4e4e6..81f83798 100644 --- a/lib/pages/ChildVaccines/new/child_vaccine_page.dart +++ b/lib/pages/ChildVaccines/new/child_vaccine_page.dart @@ -1,13 +1,11 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -56,7 +54,7 @@ class _ChildPageState extends State with SingleTickerProviderS ); }, child: Container( - margin: EdgeInsets.only(left: 16, right: 16,top: index==0?16:0,bottom: index==model.babyInformationModelList.length-1?16:0), + margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 0, bottom: index == model.babyInformationModelList.length - 1 ? 16 : 0), decoration: BoxDecoration( shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(12)), @@ -111,7 +109,7 @@ class _ChildPageState extends State with SingleTickerProviderS color: selectedColor, ), ), - Text(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB), + Text(" " + DateUtil.getDayMonthYearDateFormatted(model.babyInformationModelList[index].dOB), style: TextStyle( fontSize: 11, color: selectedColor, @@ -175,19 +173,9 @@ class _ChildPageState extends State with SingleTickerProviderS width: double.infinity, padding: EdgeInsets.all(16), color: Colors.white, - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue - ? CustomColors.accentColor - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: TranslationBase.of(context).addNewChild, - // - onTap: () { + child: DefaultButton( + TranslationBase.of(context).addNewChild, + () { Navigator.push( context, FadePage( diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 9e95e0fe..b84b63d3 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -113,9 +114,7 @@ class _InsuranceCardState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), Text( - convertDateFormat( - model.insurance[index].cardValidTo, - ), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.insurance[index].cardValidTo)), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), ], diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index c6eccae1..f765d9b7 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -344,59 +345,6 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ), ], ), - // bottomSheet: Container( - // width: double.infinity, - // height: insuranceCardDetailsModel.isEmpty ? MediaQuery.of(context).size.height * 0.14 : MediaQuery.of(context).size.height * 0.21, - // child: Container( - // margin: EdgeInsets.only(left: 8, right: 8), - // child: Column( - // children: [ - // SizedBox( - // height: 8, - // ), - // if (insuranceCardDetailsModel.isEmpty) - // SecondaryButton( - // textColor: Colors.white, - // label: TranslationBase.of(context).scanNow.toUpperCase(), - // color: Theme.of(context).primaryColor, - // small: true, - // onTap: () async { - // confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); - // }, - // ), - // if (insuranceCardDetailsModel.isNotEmpty) - // SecondaryButton( - // textColor: Colors.white, - // label: TranslationBase.of(context).agree.toUpperCase(), - // color: Theme.of(context).primaryColor, - // onTap: () async { - // GifLoaderDialogUtils.showMyDialog(context); - // await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID, patientID: patientID); - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // AppToast.showErrorToast(message: model.error); - // } else { - // AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); - // } - // }, - // ), - // if (insuranceCardDetailsModel.isNotEmpty) - // SizedBox( - // height: 12, - // ), - // if (insuranceCardDetailsModel.isNotEmpty) - // SecondaryButton( - // textColor: Colors.white, - // label: TranslationBase.of(context).disagree.toUpperCase(), - // color: Colors.grey[800], - // onTap: () async { - // confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); - // }, - // ) - // ], - // ), - // ), - // ), ), ); } diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index fb3271fd..22e1b03e 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -94,6 +94,7 @@ class InsurancePage extends StatelessWidget { }, child: Container( width: double.infinity, + margin: EdgeInsets.only(top: 12.0), child: Container( decoration: cardRadius(12), child: Padding( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 21160b61..9498282b 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -512,9 +512,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { Widget build(BuildContext context) { projectViewModel = Provider.of(context); model = Provider.of(context); - + // currentTab == 0 ? 45 : 0.0 return Scaffold( - appBar: PreferredSize( + appBar: currentTab == 0 ? PreferredSize( preferredSize: Size.fromHeight(currentTab == 0 ? 45 : 0.0), child: AppBar( elevation: 0, @@ -598,7 +598,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { ], centerTitle: true, ), - ), + ) : null, drawer: SafeArea(child: AppDrawer()), extendBody: false, body: WillPopScope( diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 765d6383..85bae24b 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -170,11 +170,11 @@ class _LiveCareTypeSelectState extends State { ), InkWell( onTap: (){ - // Navigator.pop(context, "schedule"); + Navigator.pop(context, "schedule"); }, child: Container( decoration: BoxDecoration( - color: Colors.grey[400], + color: Colors.grey[600], borderRadius: BorderRadius.all(Radius.circular(10.0))), height: 100.0, margin: EdgeInsets.only(top: 20.0), diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 45642833..8729fe4a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -197,6 +197,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { return AppBar( elevation: 0, backgroundColor: showTitle ? Colors.white : Colors.transparent, + // backgroundColor: Colors.red, // automaticallyImplyLeading: false, leading: ArrowBack( onTap: onTap, From a4f404386b09df7f4e2010d46b79b21a31060658 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 26 Oct 2021 13:41:05 +0300 Subject: [PATCH 8/9] fixed issues --- assets/images/pharmacy_module/payment.png | Bin 0 -> 15499 bytes lib/config/localized_values.dart | 2 +- .../pharmacies/screens/cart-order-page.dart | 8 +++++--- .../product-details/footor/footer-widget.dart | 4 +++- .../screens/product-details/product-detail.dart | 15 +++++++++++++++ .../widgets/home/GridViewButtons.dart | 6 +++++- 6 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 assets/images/pharmacy_module/payment.png diff --git a/assets/images/pharmacy_module/payment.png b/assets/images/pharmacy_module/payment.png new file mode 100644 index 0000000000000000000000000000000000000000..275aa40ac7941efaafe3ec10e9a62df4aad88802 GIT binary patch literal 15499 zcmV;6Jaof}P)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR931E2!{ z1ONa40RR91GXMYp0MO&FW&i*@0ZBwbRCodHT?t?mMb>`ZJu{ifO*q04$Ry14rm z@fErn3czzHlK}A#qeQ!ufIv+!tHD9oDsJa)qt5~%XlWV;P9+X#%D|~~w=`Nc4xC~f z*h(}2gUnNq;Fp2)s7@xo3H7dpL|+7@;7G8#B}+ge-3qaP2Y#u*>&$V_4dr4d>U@%0 zL~jS9K}**-(9=24nJ-08@2f_i#sQ53-N*qb0!z@`L-_UX;$|IC3YJGgAdg^c{3;M% zptG9`F)2=g}Hzz(&NQ9jreB>GPogW!-wlQaR#)VfxN)^I4c$Hsm>!R zZ&J$lN==RH%}2~3foC(BzC6bV9mw3GSY5n#$Ca#XYHG%Koj&3ZM53friJWLBH&^Je z+ukZIEn>42Ojg>4 z=q94X*~(HR$Ce}oI^ST7xG^Jh#NVuzh6fKGJXoXP`(G0i6Qknd`{WbHFF-vlrc4hR z9M4^po|Uk`?u@_fK=H1h{L5=`jRQS}1JHb@LE?P?dcvm&=t)ey5r-9IkiJLog~QH? zSFmg1W|AfkJ%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qhp zX^OxJ^H3|;%^V1?-rUWd)tb{dpmCt1D(f9ttO2F8V6Jy_>rV8^8_7O5Haze!DWCwG_fIVFE;w7ABB zp34DE8R)t9Mx#vQz-hq&SPJeyN1nhh62HzGbC?of!Jk*x5d9{vjU@r`1xkY|@EOXO z@$0-pl0nQv}`8PB}-2a5FzUy$^h~0du|&09%?j~7 zEFDzgj07G&1|r2mK@gyBI1#S}F-K`V9pT { endIndent: 0, ), Image.asset( - "assets/images/pharmacy_module/payment_image.png", + "assets/images/pharmacy_module/payment.png", width: mediaQuery.size.width - 20, height: 30.0, fit: BoxFit.scaleDown, @@ -348,6 +348,7 @@ class _OrderBottomWidgetState extends State { Icons.info, size: 25, color: Color(0xff005aff), +// color: Color(0xff005aff), ), ), ), @@ -420,8 +421,9 @@ class _OrderBottomWidgetState extends State { isAgree ? Colors.white : Colors.grey.shade300, fontSize: 14), ), - color: Color(0xff005aff), - disabledColor: Color(0xff005aff), + color: Color(0xFF4CAF50), + disabledColor:Color(0xFF4CAF50), +// disabledColor: Color(0xff005aff), ) // RaisedButton( // onPressed: isAgree diff --git a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart index 3a3eba23..19286b6a 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -20,6 +20,7 @@ class FooterWidget extends StatefulWidget { final int quantityLimit; final PharmacyProduct item; final Function addToCartFunction; + final Function addToShoppingCartFunction; final ProductDetailViewModel model; int quantity; @@ -30,6 +31,7 @@ class FooterWidget extends StatefulWidget { {this.quantity, this.isOverQuantity = false, this.addToCartFunction, + this.addToShoppingCartFunction, this.model}); @override @@ -217,7 +219,7 @@ class _FooterWidgetState extends State { widget.quantity > widget.quantityLimit || widget.item.rxMessage != null, onTap: () async { - await widget.addToCartFunction( + await widget.addToShoppingCartFunction( quantity: widget.quantity, itemID: widget.item.id, model: widget.model); diff --git a/lib/pages/pharmacies/screens/product-details/product-detail.dart b/lib/pages/pharmacies/screens/product-details/product-detail.dart index 83a76a19..4cee4ba3 100644 --- a/lib/pages/pharmacies/screens/product-details/product-detail.dart +++ b/lib/pages/pharmacies/screens/product-details/product-detail.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart' import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart'; @@ -13,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'availability_info.dart'; @@ -331,6 +333,7 @@ class __ProductDetailPageState extends State { quantity: quantity, isOverQuantity: isOverQuantity, addToCartFunction: addToCartFunction, + addToShoppingCartFunction: addToShoppingCartFunction, model: model, ), )); @@ -355,6 +358,18 @@ class __ProductDetailPageState extends State { await model.addToCartData(quantity, itemID); GifLoaderDialogUtils.hideDialog(context); } + + addToShoppingCartFunction( + {quantity, + itemID, + ProductDetailViewModel model}) async { + GifLoaderDialogUtils.showMyDialog(context); + await model.addToCartData(quantity, itemID); + GifLoaderDialogUtils.hideDialog(context); + Navigator.push( + context, + FadePage(page: CartOrderPage())); + } } diff --git a/lib/pages/pharmacies/widgets/home/GridViewButtons.dart b/lib/pages/pharmacies/widgets/home/GridViewButtons.dart index 5d979136..1a33ce74 100644 --- a/lib/pages/pharmacies/widgets/home/GridViewButtons.dart +++ b/lib/pages/pharmacies/widgets/home/GridViewButtons.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -44,6 +45,9 @@ class GridViewButtons extends StatelessWidget { hasColorFilter: false, child: GridViewCard(TranslationBase.of(context).medicationRefill, 'assets/images/pharmacy_module/medication_icon.png', () { + Navigator.push( + context, FadePage(page: HomePrescriptionsPage())); + // model.checkUserIsActivated().then((isActivated) { // if (isActivated) { // Navigator.push(context, FadePage(page: LakumMainPage())); @@ -71,7 +75,7 @@ class GridViewButtons extends StatelessWidget { child: GridViewCard( TranslationBase.of(context).searchAndScanMedication, 'assets/images/pharmacy_module/search_scan_icon.png', - () {}), + () {Navigator.push(context, FadePage(page: SearchProductsPage()));}), ), ], ), From 9dbe922259e2855bfd1ad058e1463a4b7fa28960 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 26 Oct 2021 14:57:10 +0300 Subject: [PATCH 9/9] pharmacy updates --- .../screens/cart-page/cart-order-page.dart | 3 +- .../shared/product_details_app_bar.dart | 65 ++++++++----------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart index 44eb3e09..5d7f10e0 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart @@ -41,10 +41,9 @@ class _CartOrderPageState extends State { final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; AppScaffold appScaffold; return NetworkBaseView( - // baseViewModel: model, isLoading: isLoading, isLocalLoader: true, - child: AppScaffold( + child: appScaffold = AppScaffold( appBarTitle: TranslationBase.of(context).shoppingCart, isShowAppBar: true, isPharmacy: true, diff --git a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart index b9612925..6dc571d6 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart @@ -25,19 +25,9 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { final bool isInWishList; final Function addToCartFunction; + ProductAppBar({Key key, this.product, this.model, this.addToWishlistFunction, this.quantity, this.deleteFromWishlistFunction, this.isInWishList, this.addToCartFunction}) : super(key: key); - ProductAppBar( - {Key key, - this.product, - this.model, - this.addToWishlistFunction, - this.quantity, - this.deleteFromWishlistFunction, - this.isInWishList, this.addToCartFunction}) - : super(key: key); - - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); @override Widget build(BuildContext context) { @@ -75,25 +65,29 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { onPress: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), + MaterialPageRoute(builder: (context) => CartOrderPage()), ); }), - - if(Provider.of(context, listen: false).cartResponse.quantityCount !=0) - Positioned( - top:0, right: -1.0, - child: Container( - decoration: BoxDecoration( - color: Colors.red[800], - borderRadius: BorderRadius.circular(15), - + if (Provider.of(context, listen: false).cartResponse.quantityCount != 0) + Positioned( + top: 0, + right: -1.0, + child: Container( + decoration: BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.only(left: 5, right: 4.5), + height: 18, + child: Center( + child: Texts( + Provider.of(context, listen: false).cartResponse.quantityCount.toString(), + style: "caption", + medium: true, + color: Colors.white, + )), ), - padding: EdgeInsets.only(left: 5, right: 4.5), - height: 18, - child: Center(child: Texts(Provider.of(context, listen: false).cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)), - ), - ) + ) ], ), SizedBox( @@ -135,16 +129,12 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { onTap: () async { if (quantity > 0) { { - await addToCartFunction( - quantity: quantity, - itemID: itemID, - model: model); + await addToCartFunction(quantity: quantity, itemID: itemID, model: model); Navigator.of(context).pop(); } } else { - AppToast.showErrorToast( - message: "you should add quantity"); + AppToast.showErrorToast(message: "you should add quantity"); } }), ListTile( @@ -153,9 +143,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { color: !isInWishList ? Colors.white : Colors.red[800], ), title: Text( - isInWishList - ? TranslationBase.of(context).removeFromWishlist - : TranslationBase.of(context).addToWishlist, + isInWishList ? TranslationBase.of(context).removeFromWishlist : TranslationBase.of(context).addToWishlist, ), onTap: () async { if (isInWishList) @@ -170,8 +158,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { TranslationBase.of(context).compare, ), onTap: () { - Provider.of(context, listen: false) - .addItem(specificationData); + Provider.of(context, listen: false).addItem(specificationData); Navigator.of(context).pop(); }, ),