diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7e0f8166..3962781c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -806,7 +806,7 @@ const Map localizedValues = { "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, - "ResendOrder": {"en": "Refill Order & Delivery", "ar": "إعادة طلب و توصيل"}, + "ResendOrder": {"en": "Re-Order & Delivery", "ar": "إعادة طلب و توصيل"}, "Ports": {"en": "Ports", "ar": "المنافذ"}, "Way": {"en": "Way", "ar": "الطريقة"}, "Average": {"en": "Average", "ar": "متوسط"}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f9361e90..94492c6c 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -490,6 +490,7 @@ class BaseAppClient { }) async { String url = fullUrl; print("URL Query String: $url"); + print("body: $body"); if (await Utils.checkConnection()) { headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); @@ -502,6 +503,8 @@ class BaseAppClient { print("statusCode :$statusCode"); if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers); + print(response.body.toString()); + if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure('Error While Fetching data', statusCode); } else { diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 298e617e..e409b133 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -94,6 +94,13 @@ class _SendFeedbackPageState extends State { this.appointHistory = widget.appointment; }); requestPermissions(); + event.controller.stream.listen((p) { + if (p['isIOSFeedback'] == 'true') { + if (this.mounted) { + this.titleController.value = p['data']; + } + } + }); super.initState(); } @@ -538,9 +545,10 @@ class _SendFeedbackPageState extends State { if (result.finalResult == true) { setState(() { + messageController.text += reconizedWord + '\n'; RoboSearch.closeAlertDialog(context); speech.stop(); - messageController.text = reconizedWord + '\n'; + }); } } diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 11ed7c79..ea8ef803 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -389,7 +389,9 @@ class _Register extends State { Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex))), } else - {AppToast.showErrorToast(message: result ? result : TranslationBase.of(context).somethingWentWrong)} + { + AppToast.showErrorToast(message: result != null ? result : TranslationBase.of(context).somethingWentWrong), + } }); } } diff --git a/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart b/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart index 97daf27f..da983d56 100644 --- a/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart +++ b/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart @@ -18,28 +18,25 @@ dynamic languageID; class ClinicPackagesPage extends StatefulWidget { List products; + ClinicPackagesPage({@required this.products}); @override _ClinicPackagesPageState createState() => _ClinicPackagesPageState(); - - } -class _ClinicPackagesPageState extends State with AfterLayoutMixin{ +class _ClinicPackagesPageState extends State with AfterLayoutMixin { AppScaffold appScaffold; List get _products => widget.products; PackagesViewModel viewModel; - onProductCartClick(PackagesResponseModel product) async { - if(viewModel.service.customer == null) - viewModel.service.customer = await CreateCustomerDialogPage(context: context).show(); + if (viewModel.service.customer == null) viewModel.service.customer = await CreateCustomerDialogPage(context: context).show(); - if(viewModel.service.customer != null) { + if (viewModel.service.customer != null) { var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); - await viewModel.service.addProductToCart(request, context: context).then((response){ + await viewModel.service.addProductToCart(request, context: context).then((response) { // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); }).catchError((error) { utils.Utils.showErrorToast(error); @@ -47,9 +44,8 @@ class _ClinicPackagesPageState extends State with AfterLayo } } - @override - void afterFirstLayout(BuildContext context) async{ + void afterFirstLayout(BuildContext context) async { // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); } @@ -58,13 +54,11 @@ class _ClinicPackagesPageState extends State with AfterLayo super.initState(); } - @override Widget build(BuildContext context) { - return BaseView( allowAny: true, - onModelReady: (model){ + onModelReady: (model) { viewModel = model; }, builder: (_, model, wi) => appScaffold = AppScaffold( @@ -76,22 +70,25 @@ class _ClinicPackagesPageState extends State with AfterLayo isOfferPackages: true, showOfferPackagesCart: true, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, body: Padding( - padding: const EdgeInsets.all(5), + padding: const EdgeInsets.all(12), child: StaggeredGridView.countBuilder( - crossAxisCount:4, + crossAxisCount: 4, itemCount: _products.length, itemBuilder: (BuildContext context, int index) => new Container( color: Colors.transparent, - child: PackagesItemCard( itemContentPadding: 10,itemModel: _products[index], onCartClick: onProductCartClick,) - ), + child: PackagesItemCard( + itemContentPadding: 10, + itemModel: _products[index], + onCartClick: onProductCartClick, + )), staggeredTileBuilder: (int index) => StaggeredTile.fit(2), mainAxisSpacing: 20, crossAxisSpacing: 10, - ) - ), + )), ), ); } - } 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 ba6fbfa4..59c42343 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -30,13 +30,8 @@ class FooterWidget extends StatefulWidget { int quantity; bool isOverQuantity; - FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, - this.quantityLimit, this.item, - {this.quantity, - this.isOverQuantity = false, - this.addToCartFunction, - this.addToShoppingCartFunction, - this.model}); + FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item, + {this.quantity, this.isOverQuantity = false, this.addToCartFunction, this.addToShoppingCartFunction, this.model}); @override _FooterWidgetState createState() => _FooterWidgetState(); @@ -47,15 +42,16 @@ class _FooterWidgetState extends State { bool showUI = false; static final GlobalKey _key = GlobalKey(); - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); AppSharedPreferences sharedPref = new AppSharedPreferences(); @override void initState() { super.initState(); - quantityUI = 160; - showUI = true; + if (!isBuyNowDisable() || !isAddToCartDisable()) { + quantityUI = 160; + showUI = true; + } } @override @@ -100,11 +96,7 @@ class _FooterWidgetState extends State { children: [ Padding( padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).productQuantity, - fontSize: 15, - fontWeight: FontWeight.bold, - color: Color(0xFF575757)), + child: Texts(TranslationBase.of(context).productQuantity, fontSize: 15, fontWeight: FontWeight.bold, color: Color(0xFF575757)), ), InkWell( child: Icon(Icons.close, color: Colors.black), @@ -126,11 +118,7 @@ class _FooterWidgetState extends State { SizedBox( width: 5, ), - for (int i = 1; i <= 10; i++) - QuantityBox( - label: i, - onTapFunc: onChangeValue, - isSelected: widget.quantity == i), + for (int i = 1; i <= 10; i++) QuantityBox(label: i, onTapFunc: onChangeValue, isSelected: widget.quantity == i), Container( width: 100, decoration: BoxDecoration( @@ -141,16 +129,14 @@ class _FooterWidgetState extends State { key: _key, keyboardType: TextInputType.number, textAlign: TextAlign.center, - decoration: - InputDecoration(hintText: ' Quantity # '), + decoration: InputDecoration(hintText: ' Quantity # '), onChanged: (text) { if (int.tryParse(text) == null) { text = ''; } else { setState(() { widget.quantity = int.parse(text); - if (widget.quantity >= - widget.quantityLimit) { + if (widget.quantity >= widget.quantityLimit) { widget.isOverQuantity = true; } else { widget.isOverQuantity = false; @@ -247,16 +233,12 @@ class _FooterWidgetState extends State { if (!authenticatedUserObject.isLogin) { login(); } else - await widget.addToCartFunction( - quantity: widget.quantity, - itemID: widget.item.id, - model: widget.model); + await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); }, fontWeight: FontWeight.w600, borderRadius: 6, disableColor: Color(0xFFD6D6D6), - textColor: - isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white, + textColor: isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white, color: Color(0xFF535353), ), ), @@ -274,14 +256,10 @@ class _FooterWidgetState extends State { if (!authenticatedUserObject.isLogin) { login(); } else { - await widget.addToShoppingCartFunction( - quantity: widget.quantity, - itemID: widget.item.id, - model: widget.model); + await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); } }, - textColor: - isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white, + textColor: isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white, fontWeight: FontWeight.w600, borderRadius: 6, disableColor: Color(0xFFD6D6D6), @@ -297,15 +275,11 @@ class _FooterWidgetState extends State { } bool isBuyNowDisable() { - return (!widget.isAvailable && widget.quantity > 0) || - (widget.quantity > widget.quantityLimit) || - widget.item.isRx; + return (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx; } bool isAddToCartDisable() { - return (!widget.isAvailable && widget.quantity > 0) || - widget.quantity > widget.quantityLimit || - widget.item.isRx; + return (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx; } void setUserValues(value) async { @@ -320,9 +294,7 @@ class _FooterWidgetState extends State { Navigator.of(context).pushNamed(CONFIRM_LOGIN); } else { GifLoaderDialogUtils.showMyDialog(context); - authService - .selectDeviceImei(DEVICE_TOKEN) - .then((SelectDeviceIMEIRES value) { + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { GifLoaderDialogUtils.hideDialog(context); if (value != null) { setUserValues(value); diff --git a/lib/pages/pharmacies/screens/product-details/product-detail.dart b/lib/pages/pharmacies/screens/product-details/product-detail.dart index 52c1d64d..6799f30e 100644 --- a/lib/pages/pharmacies/screens/product-details/product-detail.dart +++ b/lib/pages/pharmacies/screens/product-details/product-detail.dart @@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -133,27 +132,32 @@ class __ProductDetailPageState extends State { ), ), ), - if(model.isStockAvailable!= null && !model.isStockAvailable) - Container( - height: MediaQuery.of(context).size.height * .40, - color: Colors.white.withOpacity(0.6), - // child: AppText("Out of Stock"), - ), - if(model.isStockAvailable!= null && !model.isStockAvailable) - Positioned( - // bottom: 10, - top: MediaQuery.of(context).size.height *.088, - left: MediaQuery.of(context).size.width *.32, - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * .40, - // color: Colors.white.withOpacity(0.75), - child: RotationTransition( - turns: new AlwaysStoppedAnimation(310 / 360), - child: AppText(TranslationBase.of(context).productOutOfStock ,color:Color(0xFF000000).withOpacity(0.19),fontSize: projectViewModel.isArabic?40: 50, fontWeight: FontWeight.bold ,)), + if (model.isStockAvailable != null && !model.isStockAvailable) + Container( + height: MediaQuery.of(context).size.height * .40, + color: Colors.white.withOpacity(0.6), + // child: AppText("Out of Stock"), + ), + if (model.isStockAvailable != null && !model.isStockAvailable) + Positioned( + // bottom: 10, + top: MediaQuery.of(context).size.height * .088, + left: MediaQuery.of(context).size.width * .32, + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * .40, + // color: Colors.white.withOpacity(0.75), + child: RotationTransition( + turns: new AlwaysStoppedAnimation(310 / 360), + child: AppText( + TranslationBase.of(context).productOutOfStock, + color: Color(0xFF000000).withOpacity(0.19), + fontSize: projectViewModel.isArabic ? 40 : 50, + fontWeight: FontWeight.bold, + )), + ), ), ), - ), ], ), if (widget.product.discountDescription != null) DiscountDescription(product: widget.product) @@ -233,7 +237,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).details, - style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.84), ), color: Colors.white, ), @@ -264,7 +268,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).reviews, - style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.84), ), color: Colors.white, ), @@ -279,7 +283,7 @@ class __ProductDetailPageState extends State { Column( children: [ FlatButton( - onPressed: model.isStockAvailable !=null && model.isStockAvailable + onPressed: model.isStockAvailable != null && model.isStockAvailable ? () async { GifLoaderDialogUtils.showMyDialog(context); await model.getProductLocationData(widget.product.sku); @@ -294,7 +298,7 @@ class __ProductDetailPageState extends State { : null, child: Text( TranslationBase.of(context).availability, - style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.84), ), color: Colors.white, ), diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart index 03a6c29d..c36c2eca 100644 --- a/lib/pages/pharmacy/pharmacyContacts.dart +++ b/lib/pages/pharmacy/pharmacyContacts.dart @@ -1,267 +1,204 @@ +import 'dart:io' show Platform; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'dart:io' show Platform; - - class pharmacyContactsPage extends StatefulWidget { - - - @override _pharmacyContactsPageState createState() => _pharmacyContactsPageState(); } -class _pharmacyContactsPageState extends State { - - - +class _pharmacyContactsPageState extends State { @override Widget build(BuildContext context) { - final latitude="24.704016"; - final longitude="46.676691"; - final phone="+966112833400"; - final whatsApp="+699558434444"; - final whatappURL_android="whatsapp://send?phone="+whatsApp; - final whatappURL_ios="https://wa.me/$whatsApp"; + final latitude = "24.704016"; + final longitude = "46.676691"; + final phone = "+966112833400"; + final whatsApp = "+966558434444"; + final whatappURL_android = "whatsapp://send?phone=" + whatsApp; + final whatappURL_ios = "https://wa.me/$whatsApp"; return AppScaffold( - appBarTitle: TranslationBase.of(context).contactUs, - isShowAppBar: true, - isShowDecPage: false, - isPharmacy: true, - showPharmacyCart: false, - showHomeAppBarIcon: false, - isMainPharmacyPages: true, - body:Column( - children: [ - Card( - elevation: 2, - shape: RoundedRectangleBorder( - side: BorderSide( - color: Colors.grey[300], width: 2), - borderRadius: BorderRadius.circular(10), + appBarTitle: TranslationBase.of(context).contactUs, + isShowAppBar: true, + isShowDecPage: false, + isPharmacy: true, + showPharmacyCart: false, + showHomeAppBarIcon: false, + isMainPharmacyPages: true, + body: Column( + children: [ + Card( + elevation: 2, + shape: RoundedRectangleBorder( + side: BorderSide(color: Colors.grey[300], width: 2), + borderRadius: BorderRadius.circular(10), + ), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 8, + ), + child: Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(15), + ), + ), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text("Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - -8:00 PM", + style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), + ), + ), + SizedBox( + height: 35, + ), + Row( + children: [ + InkWell( + onTap: () { + launch("tel://" + phone); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/call.svg', + width: 20, + height: 20, ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 8, - ), - child: Container( - margin: EdgeInsets.all(10), - padding:EdgeInsets.fromLTRB(5,15,5,15), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(15),), + ), + SizedBox( + width: 20, + ), + Text(TranslationBase.of(context).phone, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), + SizedBox( + width: 30, + ), + Text("+966 " + " -11- 2833400", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), + ], + ), + SizedBox( + height: 30, + ), + Row( + children: [ + InkWell( + onTap: () { + // launch('whatsapp://send?phone='+whatsApp); + openWhatsApp(); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/whatsapp.svg', + width: 20, + height: 20, ), - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Text("Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - -8:00 PM", - style: TextStyle( - color: Colors.grey[700], - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing:-0.68 - ) - ), - ), - ), - SizedBox( - height: 35, - ), - Row( - children: [ - InkWell( - onTap: () { - launch("tel://"+phone); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/call.svg', - width: 20, - height: 20, - ),), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).phone, - style: TextStyle( - color: Colors.grey[700], - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing:-0.68 - ) - ), - SizedBox( - width: 30, - ), - Text( - "+966 " + " -11- 2833400", - style: TextStyle( - color: Colors.grey[700], - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing:-0.68 - ) - ), - ], - ), - SizedBox( - height: 30, - ), - Row( - children: [ - InkWell( - onTap: () { - // launch('whatsapp://send?phone='+whatsApp); - openWhatsApp(); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/whatsapp.svg', - width: 20, - height: 20, - ), - ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).whatsApp, - style: TextStyle( - color: Colors.grey[700], - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing:-0.68 - ) - ), - SizedBox( - width: 30, - ), - Text( - "+966 " + " 558434444", - style: TextStyle( - color: Colors.grey[700], - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing:-0.68 - ) - ), - ], - ), - SizedBox( - height: 30, - ), - Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - children: [ - InkWell( - onTap: () { - MapsLauncher.launchCoordinates(double.parse(latitude), - double.parse(longitude)); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/location.svg', - width: 20, - height: 20, - ), - ), - SizedBox( - width: 20, - ), - Expanded( - child: Text( - "P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", - style: TextStyle( - color: Colors.grey[700], - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing:-0.68 - ) - ), - ), - ], - ), - ), - SizedBox( - height: 50, - ), - Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - IconButton( - icon: new Image.asset('assets/images/new-design/facebook.png'), - tooltip: 'facebook', - iconSize: 48, - onPressed: () { - setState(() { - launch("https://facebook.com/HMG"); - // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/twitter.png'), - tooltip: 'Twitter', - iconSize: 48, - onPressed: () { - setState(() { - launch("https://twitter.com/HMG"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/pharmacy/instagram.png'), - tooltip: 'Instagram', - iconSize: 48, - onPressed: () { - setState(() { - launch("https://instagram.com/HMG"); - }); - }, - ), - - ] - ), - ) - ], + ), + SizedBox( + width: 20, + ), + Text(TranslationBase.of(context).whatsApp, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), + SizedBox( + width: 30, + ), + Text("+966 " + " 558434444", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), + ], + ), + SizedBox( + height: 30, + ), + Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + children: [ + InkWell( + onTap: () { + MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude)); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/location.svg', + width: 20, + height: 20, ), ), + SizedBox( + width: 20, + ), + Expanded( + child: Text("P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", + style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), + ), + ], + ), + ), + SizedBox( + height: 50, + ), + Center( + child: Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ + IconButton( + icon: new Image.asset('assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 48, + onPressed: () { + setState(() { + launch("https://facebook.com/HMG"); + // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, ), - ], - ), + IconButton( + icon: new Image.asset('assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 48, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/pharmacy/instagram.png'), + tooltip: 'Instagram', + iconSize: 48, + onPressed: () { + setState(() { + launch("https://instagram.com/HMG"); + }); + }, + ), + ]), + ) + ], + ), + ), + ), + ], + ), ); - } - openWhatsApp() async{ - // bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS; - var whatsapp ="+699558434444"; - var whatsappURL_android = "whatsapp://send?phone="+whatsapp; - var whatappURL_ios ="https://wa.me/$whatsapp"; - if(Platform.isIOS){ - // for iOS phone only - if( await canLaunch(whatappURL_ios)){ - await launch(whatappURL_ios, forceSafariVC: false); - }else{ - } - - }else{ - // android - if( await canLaunch(whatsappURL_android)){ - await launch(whatsappURL_android); - }else{ - } - } - + openWhatsApp() async { + // bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS; + var whatsapp = "+966558434444"; + var whatsappURL_android = "whatsapp://send?phone=" + whatsapp; + var whatappURL_ios = "https://wa.me/$whatsapp"; + if (Platform.isIOS) { + // for iOS phone only + // if (await canLaunch(whatappURL_ios)) { + await launch(whatappURL_ios, forceSafariVC: false); + // } else {} + } else { + // android + // if (await canLaunch(whatsappURL_android)) { + await launch(whatsappURL_android); + // } else {} } + } } diff --git a/lib/widgets/offers_packages/PackagesOfferCard.dart b/lib/widgets/offers_packages/PackagesOfferCard.dart index 14b1aeb0..3bf66383 100644 --- a/lib/widgets/offers_packages/PackagesOfferCard.dart +++ b/lib/widgets/offers_packages/PackagesOfferCard.dart @@ -47,7 +47,7 @@ class PackagesItemCardState extends State { aspectRatio: 144 / 144, child: ClipRRect( borderRadius: BorderRadius.circular(12.0), - child: Image.network("https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), + child: Image.network(widget.itemModel.images.isNotEmpty ? widget.itemModel.images[0].src : "https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), ), ), SizedBox(height: 6), @@ -61,7 +61,7 @@ class PackagesItemCardState extends State { color: Color(0xff2B353E), ), ), - Text("Special discount for all HMG Employees and their first…", + Text(widget.itemModel.shortDescription, maxLines: 2, style: TextStyle( fontSize: 12.0, diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 8a9274be..b8752534 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -54,9 +54,11 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart' show TargetPlatform; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -896,17 +898,6 @@ class RoboSearch { }); showAlertDialog(BuildContext context) { - //AlertDialog alert = AlertDialog - // AlertDialog alert = AlertDialog(content: MyStatefulBuilder(dispose: () { - // print('dispose!!!!!!!!!!!!'); - // }) - // isClosed = true; - // streamSubscription.cancel(); - // }, builder: (BuildContext context, StateSetter setState) { - // //print(streamSubscription); - // }), - // ); - // show the dialog showDialog( context: context, @@ -918,7 +909,6 @@ class RoboSearch { ); }, ); - print(dialog); } static closeAlertDialog(BuildContext context) { @@ -946,6 +936,7 @@ class _MyStatefulBuilderState extends State { var searchText; static StreamSubscription streamSubscription; static var isClosed = false; + stt.SpeechToText speech = stt.SpeechToText(); @override void initState() { @@ -1006,6 +997,21 @@ class _MyStatefulBuilderState extends State { event.setValue({'startPopUp': 'true'}); }, )) + : SizedBox(), + searchText != 'null' && searchText != null && Theme.of(context).platform == TargetPlatform.iOS + ? Center( + child: DefaultButton( + TranslationBase.of(context).ok, + () { + RoboSearch.closeAlertDialog(context); + speech.stop(); + // event.setValue({"searchText": { + // 'isIOSFeedback':true, + // + // } + // }); + }, + )) : SizedBox() ]), )));