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

Haroon new design

See merge request Cloud_Solution/diplomatic-quarter!563
merge-requests/564/merge
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,12 +18,11 @@ 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> {
@ -32,10 +31,8 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
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);
@ -47,7 +44,6 @@ 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,10 +54,8 @@ 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) {
@ -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,16 +42,17 @@ 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();
if (!isBuyNowDisable() || !isAddToCartDisable()) {
quantityUI = 160; quantityUI = 160;
showUI = true; showUI = true;
} }
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -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';
@ -150,7 +149,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
// 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,
)),
), ),
), ),
), ),

@ -1,33 +1,24 @@
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";
@ -44,8 +35,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
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( margin: EdgeInsets.symmetric(
@ -57,7 +47,8 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(15),), Radius.circular(15),
),
), ),
child: Column( child: Column(
children: [ children: [
@ -65,13 +56,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( 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", 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( style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing:-0.68
)
),
), ),
), ),
SizedBox( SizedBox(
@ -87,31 +72,16 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
'assets/images/pharmacy/call.svg', 'assets/images/pharmacy/call.svg',
width: 20, width: 20,
height: 20, height: 20,
),), ),
),
SizedBox( SizedBox(
width: 20, width: 20,
), ),
Text( Text(TranslationBase.of(context).phone, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
TranslationBase.of(context).phone,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing:-0.68
)
),
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Text( Text("+966 " + " -11- 2833400", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
"+966 " + " -11- 2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing:-0.68
)
),
], ],
), ),
SizedBox( SizedBox(
@ -133,27 +103,11 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox( SizedBox(
width: 20, width: 20,
), ),
Text( Text(TranslationBase.of(context).whatsApp, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
TranslationBase.of(context).whatsApp,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing:-0.68
)
),
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Text( Text("+966 " + " 558434444", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)),
"+966 " + " 558434444",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing:-0.68
)
),
], ],
), ),
SizedBox( SizedBox(
@ -165,8 +119,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () {
MapsLauncher.launchCoordinates(double.parse(latitude), MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude));
double.parse(longitude));
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/pharmacy/location.svg', 'assets/images/pharmacy/location.svg',
@ -178,15 +131,8 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
width: 20, width: 20,
), ),
Expanded( Expanded(
child: Text( child: Text("P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia",
"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)),
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing:-0.68
)
),
), ),
], ],
), ),
@ -195,9 +141,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
height: 50, height: 50,
), ),
Center( Center(
child: Row( child: Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
IconButton( IconButton(
icon: new Image.asset('assets/images/new-design/facebook.png'), icon: new Image.asset('assets/images/new-design/facebook.png'),
tooltip: 'facebook', tooltip: 'facebook',
@ -229,9 +173,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
}); });
}, },
), ),
]),
]
),
) )
], ],
), ),
@ -240,28 +182,23 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
], ],
), ),
); );
} }
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 { } else {
// android // android
if( await canLaunch(whatsappURL_android)){ // if (await canLaunch(whatsappURL_android)) {
await launch(whatsappURL_android); await launch(whatsappURL_android);
}else{ // } 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