|
|
|
@ -1,35 +1,26 @@
|
|
|
|
|
|
|
|
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,
|
|
|
|
@ -39,14 +30,12 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
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(
|
|
|
|
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(
|
|
|
|
@ -55,10 +44,11 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
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: [
|
|
|
|
@ -70,9 +60,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
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(
|
|
|
|
SizedBox(
|
|
|
|
@ -82,37 +70,32 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
launch("tel://"+phone);
|
|
|
|
launch("tel://" + phone);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
'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,
|
|
|
|
TranslationBase.of(context).phone,
|
|
|
|
|
|
|
|
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(
|
|
|
|
SizedBox(
|
|
|
|
width: 30,
|
|
|
|
width: 30,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text("+966 " + " -11- 2833400",
|
|
|
|
"+966 " + " -11- 2833400",
|
|
|
|
|
|
|
|
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(
|
|
|
|
SizedBox(
|
|
|
|
@ -134,27 +117,21 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
width: 20,
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text(TranslationBase.of(context).whatsApp,
|
|
|
|
TranslationBase.of(context).whatsApp,
|
|
|
|
|
|
|
|
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(
|
|
|
|
SizedBox(
|
|
|
|
width: 30,
|
|
|
|
width: 30,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text("+966 " + " 558434444",
|
|
|
|
"+966 " + " 558434444",
|
|
|
|
|
|
|
|
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(
|
|
|
|
SizedBox(
|
|
|
|
@ -166,7 +143,8 @@ 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(
|
|
|
|
@ -185,9 +163,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
color: Colors.grey[700],
|
|
|
|
color: Colors.grey[700],
|
|
|
|
fontSize: 16,
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
letterSpacing:-0.68
|
|
|
|
letterSpacing: -0.68)),
|
|
|
|
)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -200,7 +176,8 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
children: <Widget>[
|
|
|
|
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',
|
|
|
|
iconSize: 48,
|
|
|
|
iconSize: 48,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
@ -211,7 +188,8 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
icon: new Image.asset('assets/images/new-design/twitter.png'),
|
|
|
|
icon: new Image.asset(
|
|
|
|
|
|
|
|
'assets/images/new-design/twitter.png'),
|
|
|
|
tooltip: 'Twitter',
|
|
|
|
tooltip: 'Twitter',
|
|
|
|
iconSize: 48,
|
|
|
|
iconSize: 48,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
@ -221,7 +199,8 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
icon: new Image.asset('assets/images/pharmacy/instagram.png'),
|
|
|
|
icon: new Image.asset(
|
|
|
|
|
|
|
|
'assets/images/pharmacy/instagram.png'),
|
|
|
|
tooltip: 'Instagram',
|
|
|
|
tooltip: 'Instagram',
|
|
|
|
iconSize: 48,
|
|
|
|
iconSize: 48,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
@ -230,9 +209,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
]),
|
|
|
|
]
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -241,28 +218,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 ="+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 {
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
// android
|
|
|
|
// android
|
|
|
|
if( await canLaunch(whatsappURL_android)){
|
|
|
|
// if (await canLaunch(whatsappURL_android)) {
|
|
|
|
await launch(whatsappURL_android);
|
|
|
|
await launch(whatsappURL_android);
|
|
|
|
}else{
|
|
|
|
// } else {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|