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

Haroon new design

See merge request Cloud_Solution/diplomatic-quarter!563
merge-update-with-lab-changes
haroon amjad 4 years ago
commit b76183040c

@ -806,7 +806,7 @@ const Map localizedValues = {
"HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '}, "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '},
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Refill Order & Delivery", "ar": "إعادة طلب و توصيل"}, "ResendOrder": {"en": "Re-Order & Delivery", "ar": "إعادة طلب و توصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"}, "Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطريقة"}, "Way": {"en": "Way", "ar": "الطريقة"},
"Average": {"en": "Average", "ar": "متوسط"}, "Average": {"en": "Average", "ar": "متوسط"},

@ -490,6 +490,7 @@ class BaseAppClient {
}) async { }) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
print("body: $body");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
@ -502,6 +503,8 @@ class BaseAppClient {
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers); 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) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {

@ -94,6 +94,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
this.appointHistory = widget.appointment; this.appointHistory = widget.appointment;
}); });
requestPermissions(); requestPermissions();
event.controller.stream.listen((p) {
if (p['isIOSFeedback'] == 'true') {
if (this.mounted) {
this.titleController.value = p['data'];
}
}
});
super.initState(); super.initState();
} }
@ -538,9 +545,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
messageController.text += reconizedWord + '\n';
RoboSearch.closeAlertDialog(context); RoboSearch.closeAlertDialog(context);
speech.stop(); speech.stop();
messageController.text = reconizedWord + '\n';
}); });
} }
} }

@ -389,7 +389,9 @@ class _Register extends State<Register> {
Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex))), Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex))),
} }
else else
{AppToast.showErrorToast(message: result ? result : TranslationBase.of(context).somethingWentWrong)} {
AppToast.showErrorToast(message: result != null ? result : TranslationBase.of(context).somethingWentWrong),
}
}); });
} }
} }

@ -18,28 +18,25 @@ dynamic languageID;
class ClinicPackagesPage extends StatefulWidget { class ClinicPackagesPage extends StatefulWidget {
List<PackagesResponseModel> products; List<PackagesResponseModel> products;
ClinicPackagesPage({@required this.products}); ClinicPackagesPage({@required this.products});
@override @override
_ClinicPackagesPageState createState() => _ClinicPackagesPageState(); _ClinicPackagesPageState createState() => _ClinicPackagesPageState();
} }
class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage>{ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage> {
AppScaffold appScaffold; AppScaffold appScaffold;
List<PackagesResponseModel> get _products => widget.products; List<PackagesResponseModel> get _products => widget.products;
PackagesViewModel viewModel; PackagesViewModel viewModel;
onProductCartClick(PackagesResponseModel product) async { onProductCartClick(PackagesResponseModel product) async {
if(viewModel.service.customer == null) if (viewModel.service.customer == null) viewModel.service.customer = await CreateCustomerDialogPage(context: context).show();
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); 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); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
@ -47,9 +44,8 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
} }
} }
@override @override
void afterFirstLayout(BuildContext context) async{ void afterFirstLayout(BuildContext context) async {
// appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
} }
@ -58,13 +54,11 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PackagesViewModel>( return BaseView<PackagesViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model){ onModelReady: (model) {
viewModel = model; viewModel = model;
}, },
builder: (_, model, wi) => appScaffold = AppScaffold( builder: (_, model, wi) => appScaffold = AppScaffold(
@ -76,22 +70,25 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
isOfferPackages: true, isOfferPackages: true,
showOfferPackagesCart: true, showOfferPackagesCart: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Padding( body: Padding(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(12),
child: StaggeredGridView.countBuilder( child: StaggeredGridView.countBuilder(
crossAxisCount:4, crossAxisCount: 4,
itemCount: _products.length, itemCount: _products.length,
itemBuilder: (BuildContext context, int index) => new Container( itemBuilder: (BuildContext context, int index) => new Container(
color: Colors.transparent, 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), staggeredTileBuilder: (int index) => StaggeredTile.fit(2),
mainAxisSpacing: 20, mainAxisSpacing: 20,
crossAxisSpacing: 10, crossAxisSpacing: 10,
) )),
),
), ),
); );
} }
} }

@ -30,13 +30,8 @@ class FooterWidget extends StatefulWidget {
int quantity; int quantity;
bool isOverQuantity; bool isOverQuantity;
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item,
this.quantityLimit, this.item, {this.quantity, this.isOverQuantity = false, this.addToCartFunction, this.addToShoppingCartFunction, this.model});
{this.quantity,
this.isOverQuantity = false,
this.addToCartFunction,
this.addToShoppingCartFunction,
this.model});
@override @override
_FooterWidgetState createState() => _FooterWidgetState(); _FooterWidgetState createState() => _FooterWidgetState();
@ -47,15 +42,16 @@ class _FooterWidgetState extends State<FooterWidget> {
bool showUI = false; bool showUI = false;
static final GlobalKey<FormState> _key = GlobalKey<FormState>(); static final GlobalKey<FormState> _key = GlobalKey<FormState>();
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
quantityUI = 160; if (!isBuyNowDisable() || !isAddToCartDisable()) {
showUI = true; quantityUI = 160;
showUI = true;
}
} }
@override @override
@ -100,11 +96,7 @@ class _FooterWidgetState extends State<FooterWidget> {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(TranslationBase.of(context).productQuantity, fontSize: 15, fontWeight: FontWeight.bold, color: Color(0xFF575757)),
TranslationBase.of(context).productQuantity,
fontSize: 15,
fontWeight: FontWeight.bold,
color: Color(0xFF575757)),
), ),
InkWell( InkWell(
child: Icon(Icons.close, color: Colors.black), child: Icon(Icons.close, color: Colors.black),
@ -126,11 +118,7 @@ class _FooterWidgetState extends State<FooterWidget> {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++) QuantityBox(label: i, onTapFunc: onChangeValue, isSelected: widget.quantity == i),
QuantityBox(
label: i,
onTapFunc: onChangeValue,
isSelected: widget.quantity == i),
Container( Container(
width: 100, width: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -141,16 +129,14 @@ class _FooterWidgetState extends State<FooterWidget> {
key: _key, key: _key,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
textAlign: TextAlign.center, textAlign: TextAlign.center,
decoration: decoration: InputDecoration(hintText: ' Quantity # '),
InputDecoration(hintText: ' Quantity # '),
onChanged: (text) { onChanged: (text) {
if (int.tryParse(text) == null) { if (int.tryParse(text) == null) {
text = ''; text = '';
} else { } else {
setState(() { setState(() {
widget.quantity = int.parse(text); widget.quantity = int.parse(text);
if (widget.quantity >= if (widget.quantity >= widget.quantityLimit) {
widget.quantityLimit) {
widget.isOverQuantity = true; widget.isOverQuantity = true;
} else { } else {
widget.isOverQuantity = false; widget.isOverQuantity = false;
@ -247,16 +233,12 @@ class _FooterWidgetState extends State<FooterWidget> {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
} else } else
await widget.addToCartFunction( await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderRadius: 6, borderRadius: 6,
disableColor: Color(0xFFD6D6D6), disableColor: Color(0xFFD6D6D6),
textColor: textColor: isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white,
isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white,
color: Color(0xFF535353), color: Color(0xFF535353),
), ),
), ),
@ -274,14 +256,10 @@ class _FooterWidgetState extends State<FooterWidget> {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
} else { } else {
await widget.addToShoppingCartFunction( await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
} }
}, },
textColor: textColor: isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white,
isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderRadius: 6, borderRadius: 6,
disableColor: Color(0xFFD6D6D6), disableColor: Color(0xFFD6D6D6),
@ -297,15 +275,11 @@ class _FooterWidgetState extends State<FooterWidget> {
} }
bool isBuyNowDisable() { bool isBuyNowDisable() {
return (!widget.isAvailable && widget.quantity > 0) || return (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx;
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx;
} }
bool isAddToCartDisable() { bool isAddToCartDisable() {
return (!widget.isAvailable && widget.quantity > 0) || return (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx;
widget.quantity > widget.quantityLimit ||
widget.item.isRx;
} }
void setUserValues(value) async { void setUserValues(value) async {
@ -320,9 +294,7 @@ class _FooterWidgetState extends State<FooterWidget> {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
.selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);

@ -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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -133,27 +132,32 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
), ),
if(model.isStockAvailable!= null && !model.isStockAvailable) if (model.isStockAvailable != null && !model.isStockAvailable)
Container( Container(
height: MediaQuery.of(context).size.height * .40, height: MediaQuery.of(context).size.height * .40,
color: Colors.white.withOpacity(0.6), color: Colors.white.withOpacity(0.6),
// child: AppText("Out of Stock"), // child: AppText("Out of Stock"),
), ),
if(model.isStockAvailable!= null && !model.isStockAvailable) if (model.isStockAvailable != null && !model.isStockAvailable)
Positioned( Positioned(
// bottom: 10, // bottom: 10,
top: MediaQuery.of(context).size.height *.088, top: MediaQuery.of(context).size.height * .088,
left: MediaQuery.of(context).size.width *.32, left: MediaQuery.of(context).size.width * .32,
child: Center( child: Center(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * .40, height: MediaQuery.of(context).size.height * .40,
// color: Colors.white.withOpacity(0.75), // color: Colors.white.withOpacity(0.75),
child: RotationTransition( child: RotationTransition(
turns: new AlwaysStoppedAnimation(310 / 360), 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 ,)), 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) if (widget.product.discountDescription != null) DiscountDescription(product: widget.product)
@ -233,7 +237,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).details, 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, color: Colors.white,
), ),
@ -264,7 +268,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).reviews, 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, color: Colors.white,
), ),
@ -279,7 +283,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Column( Column(
children: [ children: [
FlatButton( FlatButton(
onPressed: model.isStockAvailable !=null && model.isStockAvailable onPressed: model.isStockAvailable != null && model.isStockAvailable
? () async { ? () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getProductLocationData(widget.product.sku); await model.getProductLocationData(widget.product.sku);
@ -294,7 +298,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
: null, : null,
child: Text( child: Text(
TranslationBase.of(context).availability, 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, color: Colors.white,
), ),

@ -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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'dart:io' show Platform;
class pharmacyContactsPage extends StatefulWidget { class pharmacyContactsPage extends StatefulWidget {
@override @override
_pharmacyContactsPageState createState() => _pharmacyContactsPageState(); _pharmacyContactsPageState createState() => _pharmacyContactsPageState();
} }
class _pharmacyContactsPageState extends State<pharmacyContactsPage> { class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final latitude="24.704016"; final latitude = "24.704016";
final longitude="46.676691"; final longitude = "46.676691";
final phone="+966112833400"; final phone = "+966112833400";
final whatsApp="+699558434444"; final whatsApp = "+966558434444";
final whatappURL_android="whatsapp://send?phone="+whatsApp; final whatappURL_android = "whatsapp://send?phone=" + whatsApp;
final whatappURL_ios="https://wa.me/$whatsApp"; final whatappURL_ios = "https://wa.me/$whatsApp";
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).contactUs, appBarTitle: TranslationBase.of(context).contactUs,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false, showPharmacyCart: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
body:Column( body: Column(
children: [ children: [
Card( Card(
elevation: 2, elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(color: Colors.grey[300], width: 2),
color: Colors.grey[300], width: 2), borderRadius: BorderRadius.circular(10),
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: <Widget>[
InkWell(
onTap: () {
launch("tel://" + phone);
},
child: SvgPicture.asset(
'assets/images/pharmacy/call.svg',
width: 20,
height: 20,
), ),
margin: EdgeInsets.symmetric( ),
horizontal: 8, SizedBox(
vertical: 8, width: 20,
), ),
child: Container( Text(TranslationBase.of(context).phone, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
margin: EdgeInsets.all(10), SizedBox(
padding:EdgeInsets.fromLTRB(5,15,5,15), width: 30,
decoration: BoxDecoration( ),
borderRadius: BorderRadius.all( Text("+966 " + " -11- 2833400", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
Radius.circular(15),), ],
),
SizedBox(
height: 30,
),
Row(
children: <Widget>[
InkWell(
onTap: () {
// launch('whatsapp://send?phone='+whatsApp);
openWhatsApp();
},
child: SvgPicture.asset(
'assets/images/pharmacy/whatsapp.svg',
width: 20,
height: 20,
), ),
child: Column( ),
children: [ SizedBox(
Padding( width: 20,
padding: const EdgeInsets.all(8.0), ),
child: Container( Text(TranslationBase.of(context).whatsApp, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
child: Text("Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - -8:00 PM", SizedBox(
style: TextStyle( width: 30,
color: Colors.grey[700], ),
fontSize: 16, Text("+966 " + " 558434444", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
fontWeight: FontWeight.w600, ],
letterSpacing:-0.68 ),
) SizedBox(
), height: 30,
), ),
), Padding(
SizedBox( padding: const EdgeInsets.all(5.0),
height: 35, child: Row(
), children: <Widget>[
Row( InkWell(
children: <Widget>[ onTap: () {
InkWell( MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude));
onTap: () { },
launch("tel://"+phone); child: SvgPicture.asset(
}, 'assets/images/pharmacy/location.svg',
child: SvgPicture.asset( width: 20,
'assets/images/pharmacy/call.svg', height: 20,
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: <Widget>[
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: <Widget>[
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: <Widget>[
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,
),
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: <Widget>[
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{ openWhatsApp() async {
// bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS; // bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS;
var whatsapp ="+699558434444"; var whatsapp = "+966558434444";
var whatsappURL_android = "whatsapp://send?phone="+whatsapp; var whatsappURL_android = "whatsapp://send?phone=" + whatsapp;
var whatappURL_ios ="https://wa.me/$whatsapp"; var whatappURL_ios = "https://wa.me/$whatsapp";
if(Platform.isIOS){ if (Platform.isIOS) {
// for iOS phone only // for iOS phone only
if( await canLaunch(whatappURL_ios)){ // if (await canLaunch(whatappURL_ios)) {
await launch(whatappURL_ios, forceSafariVC: false); await launch(whatappURL_ios, forceSafariVC: false);
}else{ // } else {}
} } else {
// android
}else{ // if (await canLaunch(whatsappURL_android)) {
// android await launch(whatsappURL_android);
if( await canLaunch(whatsappURL_android)){ // } else {}
await launch(whatsappURL_android);
}else{
}
}
} }
}
} }

@ -47,7 +47,7 @@ class PackagesItemCardState extends State<PackagesItemCard> {
aspectRatio: 144 / 144, aspectRatio: 144 / 144,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(12.0), 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), SizedBox(height: 6),
@ -61,7 +61,7 @@ class PackagesItemCardState extends State<PackagesItemCard> {
color: Color(0xff2B353E), color: Color(0xff2B353E),
), ),
), ),
Text("Special discount for all HMG Employees and their first…", Text(widget.itemModel.shortDescription,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,

@ -54,9 +54,11 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart' show TargetPlatform;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_tts/flutter_tts.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
@ -896,17 +898,6 @@ class RoboSearch {
}); });
showAlertDialog(BuildContext context) { 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 // show the dialog
showDialog( showDialog(
context: context, context: context,
@ -918,7 +909,6 @@ class RoboSearch {
); );
}, },
); );
print(dialog);
} }
static closeAlertDialog(BuildContext context) { static closeAlertDialog(BuildContext context) {
@ -946,6 +936,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
var searchText; var searchText;
static StreamSubscription<dynamic> streamSubscription; static StreamSubscription<dynamic> streamSubscription;
static var isClosed = false; static var isClosed = false;
stt.SpeechToText speech = stt.SpeechToText();
@override @override
void initState() { void initState() {
@ -1006,6 +997,21 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
event.setValue({'startPopUp': 'true'}); 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() : SizedBox()
]), ]),
))); )));

Loading…
Cancel
Save