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-requests/564/head
Fatimah Alshammari 4 years ago
commit ff7146e259

@ -808,7 +808,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": "متوسط"},

@ -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 {

@ -94,6 +94,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
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<SendFeedbackPage> {
if (result.finalResult == true) {
setState(() {
messageController.text += reconizedWord + '\n';
RoboSearch.closeAlertDialog(context);
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))),
}
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 {
List<PackagesResponseModel> products;
ClinicPackagesPage({@required this.products});
@override
_ClinicPackagesPageState createState() => _ClinicPackagesPageState();
}
class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage>{
class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage> {
AppScaffold appScaffold;
List<PackagesResponseModel> 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<ClinicPackagesPage> 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<ClinicPackagesPage> with AfterLayo
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<PackagesViewModel>(
allowAny: true,
onModelReady: (model){
onModelReady: (model) {
viewModel = model;
},
builder: (_, model, wi) => appScaffold = AppScaffold(
@ -76,22 +70,25 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> 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,
)
),
)),
),
);
}
}

File diff suppressed because it is too large Load Diff

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

@ -276,7 +276,7 @@ class ProductTileItem extends StatelessWidget {
// Expanded(
RatingBar.readOnly(
initialRating: item.approvedRatingSum.toDouble(),
size: 15.0,
size: 13.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
@ -292,7 +292,7 @@ class ProductTileItem extends StatelessWidget {
),
SizedBox(
width: 10.0,
width: 9.0,
),
Icon(
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/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<pharmacyContactsPage> {
class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
@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,
isBottomBar: 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,
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(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),
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: <Widget>[
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(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,
),),
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(
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,
),
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");
});
},
),
]),
)
],
),
),
),
],
),
);
}
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{
}
}
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 {}
}
}
}

@ -47,7 +47,7 @@ class PackagesItemCardState extends State<PackagesItemCard> {
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<PackagesItemCard> {
color: Color(0xff2B353E),
),
),
Text("Special discount for all HMG Employees and their first…",
Text(widget.itemModel.shortDescription,
maxLines: 2,
style: TextStyle(
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/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<MyStatefulBuilder> {
var searchText;
static StreamSubscription<dynamic> streamSubscription;
static var isClosed = false;
stt.SpeechToText speech = stt.SpeechToText();
@override
void initState() {
@ -1006,6 +997,21 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
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()
]),
)));

Loading…
Cancel
Save