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

merge-update-with-lab-changes
haroon amjad 4 years ago
commit 0b4e674097

File diff suppressed because it is too large Load Diff

@ -45,10 +45,19 @@ 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();
quantityUI = 160;
showUI = true;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -71,8 +80,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 +101,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 +138,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 +166,6 @@ class _FooterWidgetState extends State<FooterWidget> {
], ],
), ),
), ),
)
: Container(
height: 10,
), ),
Container( Container(
height: 58, height: 58,
@ -227,8 +238,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: 5.0), margin: EdgeInsets.symmetric(vertical: 5.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart, label: TranslationBase.of(context).addToCart,
disabled: isAddToCartDisable(), disabled: isAddToCartDisable(),
@ -244,8 +254,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,13 +265,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: 5.0), margin: EdgeInsets.symmetric(vertical: 5.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();
@ -271,7 +280,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),
@ -286,20 +296,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 {

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

Loading…
Cancel
Save