Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into Fatima-New-Design

# Conflicts:
#	lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart
#	lib/pages/pharmacy/pharmacyContacts.dart
merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
commit ff7146e259

@ -808,7 +808,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,
) )),
),
), ),
); );
} }
} }

File diff suppressed because it is too large Load Diff

@ -45,10 +45,21 @@ class FooterWidget extends StatefulWidget {
class _FooterWidgetState extends State<FooterWidget> { class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80; double quantityUI = 80;
bool showUI = false; bool showUI = false;
static final GlobalKey<FormState> _key = GlobalKey<FormState>();
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@override
void initState() {
super.initState();
if (!isBuyNowDisable() || !isAddToCartDisable()) {
quantityUI = 160;
showUI = true;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -71,8 +82,11 @@ class _FooterWidgetState extends State<FooterWidget> {
height: quantityUI, height: quantityUI,
child: Column( child: Column(
children: [ children: [
showUI !showUI
? Container( ? Container(
height: 10,
)
: Container(
width: double.infinity, width: double.infinity,
height: 100, height: 100,
color: Colors.white, color: Colors.white,
@ -89,11 +103,10 @@ class _FooterWidgetState extends State<FooterWidget> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).productQuantity, TranslationBase.of(context).productQuantity,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF575757) color: Color(0xFF575757)),
),
), ),
InkWell( InkWell(
child: Icon(Icons.close, color: Colors.black), child: Icon(Icons.close, color: Colors.black),
@ -127,8 +140,11 @@ class _FooterWidgetState extends State<FooterWidget> {
color: Colors.white, color: Colors.white,
), ),
child: TextField( child: TextField(
decoration: InputDecoration( key: _key,
labelText: ' Quantity # '), keyboardType: TextInputType.number,
textAlign: TextAlign.center,
decoration:
InputDecoration(hintText: ' Quantity # '),
onChanged: (text) { onChanged: (text) {
if (int.tryParse(text) == null) { if (int.tryParse(text) == null) {
text = ''; text = '';
@ -152,9 +168,6 @@ class _FooterWidgetState extends State<FooterWidget> {
], ],
), ),
), ),
)
: Container(
height: 10,
), ),
Container( Container(
height: 58, height: 58,
@ -227,8 +240,7 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 4.0), margin: EdgeInsets.symmetric(vertical: 4.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart, label: TranslationBase.of(context).addToCart,
disabled: isAddToCartDisable(), disabled: isAddToCartDisable(),
@ -244,8 +256,9 @@ class _FooterWidgetState extends State<FooterWidget> {
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderRadius: 6, borderRadius: 6,
disableColor:Color(0xFFD6D6D6), disableColor: Color(0xFFD6D6D6),
textColor: isAddToCartDisable()?Color(0xFFACACAC):Colors.white, textColor:
isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white,
color: Color(0xFF535353), color: Color(0xFF535353),
), ),
), ),
@ -254,14 +267,11 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 4.0), margin: EdgeInsets.symmetric(vertical: 4.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow, label: TranslationBase.of(context).buyNow,
fontSize: 15, fontSize: 15,
disabled: isBuyNowDisable(), disabled: isBuyNowDisable(),
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -272,7 +282,8 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
} }
}, },
textColor: isBuyNowDisable()?Color(0xFFACACAC):Colors.white, textColor:
isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderRadius: 6, borderRadius: 6,
disableColor: Color(0xFFD6D6D6), disableColor: Color(0xFFD6D6D6),
@ -287,20 +298,16 @@ 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.quantity > widget.quantityLimit) ||
widget.item.isRx; widget.item.isRx;
} }
bool isAddToCartDisable(){ bool isAddToCartDisable() {
return (!widget.isAvailable && widget.quantity > 0) || return (!widget.isAvailable && widget.quantity > 0) ||
widget.quantity > widget.quantityLimit || widget.quantity > widget.quantityLimit ||
widget.item.isRx; widget.item.isRx;
} }
void setUserValues(value) async { void setUserValues(value) async {

@ -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,
), ),

@ -276,7 +276,7 @@ class ProductTileItem extends StatelessWidget {
// Expanded( // Expanded(
RatingBar.readOnly( RatingBar.readOnly(
initialRating: item.approvedRatingSum.toDouble(), initialRating: item.approvedRatingSum.toDouble(),
size: 15.0, size: 13.0,
filledColor: Color(0XFFD02127), filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), emptyColor: Color(0XFFD02127),
isHalfAllowed: true, isHalfAllowed: true,
@ -292,7 +292,7 @@ class ProductTileItem extends StatelessWidget {
), ),
SizedBox( SizedBox(
width: 10.0, width: 9.0,
), ),
Icon( Icon(
Icons.arrow_forward, Icons.arrow_forward,

@ -1,268 +1,240 @@
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,
isBottomBar: true, body: Column(
body:Column( children: [
children: [ Card(
Card( elevation: 2,
elevation: 2, shape: RoundedRectangleBorder(
shape: RoundedRectangleBorder( side: BorderSide(color: Colors.grey[300], width: 2),
side: BorderSide( borderRadius: BorderRadius.circular(10),
color: Colors.grey[300], width: 2), ),
borderRadius: BorderRadius.circular(10), margin: EdgeInsets.symmetric(
), horizontal: 8,
margin: EdgeInsets.symmetric( vertical: 8,
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(TranslationBase.of(context).contactUsTime,
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,
), ),
child: Container( ),
margin: EdgeInsets.all(10), SizedBox(
padding:EdgeInsets.fromLTRB(5,15,5,15), width: 20,
decoration: BoxDecoration( ),
borderRadius: BorderRadius.all( Text(TranslationBase.of(context).phone,
Radius.circular(15),), 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,
), ),
child: Column( ),
children: [ SizedBox(
Padding( width: 20,
padding: const EdgeInsets.all(8.0), ),
child: Container( Text(TranslationBase.of(context).whatsApp,
child: Text(TranslationBase.of(context).contactUsTime, style: TextStyle(
style: TextStyle( color: Colors.grey[700],
color: Colors.grey[700], fontSize: 16,
fontSize: 16, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, letterSpacing: -0.68)),
letterSpacing:-0.68 SizedBox(
) width: 30,
), ),
), Text("+966 " + " 558434444",
), style: TextStyle(
SizedBox( color: Colors.grey[700],
height: 35, fontSize: 16,
), fontWeight: FontWeight.w600,
Row( letterSpacing: -0.68)),
children: <Widget>[ ],
InkWell( ),
onTap: () { SizedBox(
launch("tel://"+phone); height: 30,
}, ),
child: SvgPicture.asset( Padding(
'assets/images/pharmacy/call.svg', padding: const EdgeInsets.all(5.0),
width: 20, child: Row(
height: 20, children: <Widget>[
),), InkWell(
SizedBox( onTap: () {
width: 20, MapsLauncher.launchCoordinates(
), double.parse(latitude),
Text( double.parse(longitude));
TranslationBase.of(context).phone, },
style: TextStyle( child: SvgPicture.asset(
color: Colors.grey[700], 'assets/images/pharmacy/location.svg',
fontSize: 16, width: 20,
fontWeight: FontWeight.w600, height: 20,
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(
TranslationBase.of(context).contactUsLocation,
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(
TranslationBase.of(context).contactUsLocation,
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 ="+966558434444"; 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