diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 8c32edfd..065f9f47 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -25,6 +25,8 @@
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:label="diplomaticquarterapp">
+
-
+
+
diff --git a/assets/images/pharmacy/Group 1206.svg b/assets/images/pharmacy/Group 1206.svg
new file mode 100644
index 00000000..ef8f7473
--- /dev/null
+++ b/assets/images/pharmacy/Group 1206.svg
@@ -0,0 +1,14 @@
+
diff --git a/assets/images/pharmacy/Group 1207.svg b/assets/images/pharmacy/Group 1207.svg
new file mode 100644
index 00000000..fd2ffd41
--- /dev/null
+++ b/assets/images/pharmacy/Group 1207.svg
@@ -0,0 +1,17 @@
+
diff --git a/assets/images/pharmacy/aramex_shipping_logo.svg b/assets/images/pharmacy/aramex_shipping_logo.svg
new file mode 100644
index 00000000..30cc03b8
--- /dev/null
+++ b/assets/images/pharmacy/aramex_shipping_logo.svg
@@ -0,0 +1,14 @@
+
diff --git a/assets/images/pharmacy/arrow_right.svg b/assets/images/pharmacy/arrow_right.svg
new file mode 100644
index 00000000..b4243287
--- /dev/null
+++ b/assets/images/pharmacy/arrow_right.svg
@@ -0,0 +1,6 @@
+
diff --git a/assets/images/pharmacy/credit_card_icon.svg b/assets/images/pharmacy/credit_card_icon.svg
new file mode 100644
index 00000000..9ba6c2bf
--- /dev/null
+++ b/assets/images/pharmacy/credit_card_icon.svg
@@ -0,0 +1,6 @@
+
diff --git a/assets/images/pharmacy/hmg_shipping_logo.svg b/assets/images/pharmacy/hmg_shipping_logo.svg
new file mode 100644
index 00000000..8e9db3d6
--- /dev/null
+++ b/assets/images/pharmacy/hmg_shipping_logo.svg
@@ -0,0 +1,17 @@
+
diff --git a/assets/images/pharmacy/quote_end.svg b/assets/images/pharmacy/quote_end.svg
new file mode 100644
index 00000000..083ff39a
--- /dev/null
+++ b/assets/images/pharmacy/quote_end.svg
@@ -0,0 +1,8 @@
+
diff --git a/assets/images/pharmacy/quote_start.svg b/assets/images/pharmacy/quote_start.svg
new file mode 100644
index 00000000..74216f14
--- /dev/null
+++ b/assets/images/pharmacy/quote_start.svg
@@ -0,0 +1,8 @@
+
diff --git a/assets/images/pharmacy/shipping_mark_icon.svg b/assets/images/pharmacy/shipping_mark_icon.svg
new file mode 100644
index 00000000..5cf9606b
--- /dev/null
+++ b/assets/images/pharmacy/shipping_mark_icon.svg
@@ -0,0 +1,16 @@
+
diff --git a/assets/images/pharmacy/shipping_truck_icon.svg b/assets/images/pharmacy/shipping_truck_icon.svg
new file mode 100644
index 00000000..8ffda974
--- /dev/null
+++ b/assets/images/pharmacy/shipping_truck_icon.svg
@@ -0,0 +1,34 @@
+
diff --git a/assets/images/pharmacy/success_review_icon.svg b/assets/images/pharmacy/success_review_icon.svg
new file mode 100644
index 00000000..f6951456
--- /dev/null
+++ b/assets/images/pharmacy/success_review_icon.svg
@@ -0,0 +1,24 @@
+
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 0e2cb367..dd6e612a 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -8,6 +8,8 @@ const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgwebservices.com/';
+const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
+
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Doctor
@@ -327,6 +329,11 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
//Pharmacy wishlist
const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
+//Pharmacy address
+const GET_ADDRESS = "https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses";
+//order + order details 'orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=' + page_id + '&limit=200&customer_id='+ custmerId,
+const GET_ORDER = "https://uat.hmgwebservices.com/epharmacy/api/orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
+const GET_ORDER_DETAILS = "https://uat.hmgwebservices.com/epharmacy/api/orders/3584";
const TIMER_MIN = 10;
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 9affe647..0440addb 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -622,4 +622,31 @@ const Map> localizedValues = {
"delete": {"en": "Delete", "ar": " حذف"},
"addAddress": {"en": "ADD A NEW ADDRESS", "ar": " اضافة عنوان جديد"},
"addNewAddress": {"en": "Add New Address", "ar": " اضافة عنوان جديد"},
+ "order": {"en": "My Order", "ar": " طلباتي"},
+ "delivered": {"en": "Delivered", "ar": " تم التوصيل"},
+ "pending": {"en": "Pending", "ar": " معلقة "},
+ "processing": {"en": "Processing", "ar": " تحت المعالجة"},
+ "cancelled": {"en": "Cancelled", "ar": " ملغي"},
+ "writeReview": {"en": "Write Review", "ar": " اكتب تقييمك"},
+ "shareReview": {"en": "SHARE REVIEW", "ar": " اكتب تقييمك"},
+ "backMyAccount": {"en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي"},
+ "reviewSuccessful": {"en": "Review Successful", "ar": " تقييم ناجح"},
+ "reviewShared": {"en": "Your review has been shared on product review section", "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج"},
+ "reviewComment": {"en": "Your reviews help other to choose better product", "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل"},
+ "shippingAddress": {"en": "SHIPPING ADDRESS", "ar": " عنوان الشحن"},
+ "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"},
+ "orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"},
+ "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"},
+ "subtotal": {"en": "Subtotal", "ar": " المجموع"},
+ "shipping": {"en": "Shipping", "ar": " الشحن"},
+ "vat": {"en": "VAT (15%)", "ar": "(15%) القيمة المضافة"},
+ "total": {"en": "TOTAL", "ar": " المجموع الكلي"},
+ "sar": {"en": "SAR", "ar": " ر.س "},
+ "payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "},
+ "cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "},
+ "confirmAddress": {"en": "CONFIRM ADDRESS ", "ar": " تأكيد العنوان "},
+ "confirmLocation": {"en": "CONFIRM LOCATION ", "ar": " تأكيد الموقع "},
+ "confirmDeleteMsg": {"en": "Are you sure! want to delete ", "ar": "هل انت متأكد تريد الحذف "},
+ "confirmDelete": {"en": "DELETE", "ar": "حذف"},
+ "confirmCancellation": {"en": "Are you sure! want to cancel this order ", "ar": "هل انت متأكد تريد حذف هذا المنتج "},
};
diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart
index d5493d99..348fec58 100644
--- a/lib/pages/landing/home_page.dart
+++ b/lib/pages/landing/home_page.dart
@@ -9,8 +9,12 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
+import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
+import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
+import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
+import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@@ -474,7 +478,7 @@ class _HomePageState extends State {
),
DashboardItem(
onTap: () => Navigator.push(
- context, FadePage(page: PharmacyAddressesPage())),
+ context, FadePage(page: OrderPage())),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
@@ -501,10 +505,6 @@ class _HomePageState extends State {
),
height: MediaQuery.of(context).size.width * 0.4,
imageName: 'al-habib_onlne_pharmacy_bg.png',
- onTap: () {
- Navigator.push(
- context, FadePage(page: WishlistPage()));
- },
),
DashboardItem(
child: Center(
diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart
new file mode 100644
index 00000000..bfbca83f
--- /dev/null
+++ b/lib/pages/pharmacy/order/Order.dart
@@ -0,0 +1,781 @@
+import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
+import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
+
+class OrderPage extends StatefulWidget {
+
+ @override
+ _OrderPageState createState() => _OrderPageState();
+}
+
+class _OrderPageState extends State with SingleTickerProviderStateMixin{
+ TabController _tabController;
+ AppSharedPreferences sharedPref = AppSharedPreferences();
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
+
+ super.initState();
+ _tabController = new TabController(length: 4, vsync: this,);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ centerTitle: true,
+ title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)),
+ backgroundColor: Colors.green,
+ ),
+ body: Container(
+ child: Column(
+ children: [
+ TabBar(
+ tabs: [
+ Tab(text: TranslationBase.of(context).delivered),
+ Tab(text: TranslationBase.of(context).processing),
+ Tab(text: TranslationBase.of(context).pending),
+ Tab(text: TranslationBase.of(context).cancelled),
+ ],
+ controller: _tabController,
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 10,
+ thickness: 6,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Expanded(
+ child: new TabBarView(
+ physics: NeverScrollableScrollPhysics(),
+ children: [
+ getDeliveredOrder(),
+ getProcessingOrder(),
+ getPendingOrder(),
+ getCancelledOrder(),
+ ],
+ controller: _tabController,
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget getDeliveredOrder(){
+ return Container(
+ width: MediaQuery.of(context).size.width,
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ ListView.builder(
+ scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: ScrollPhysics(),
+ itemCount: 2 ,
+ itemBuilder: (context, index){
+ return Container(
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.all(8.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Order#:',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('3183',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Date',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('Aug 12, 2020',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.all(8.0),
+ child: InkWell(
+ onTap: () {
+ Navigator.push(context,
+ MaterialPageRoute(builder: (context) => OrderDetailsPage()));
+ },
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/arrow_right.svg',
+ height: 20,
+ width: 20,),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 1,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ padding: EdgeInsets.only(left: 13.0, right: 13.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.blue[700],
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.blue[700],
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ TranslationBase.of(context).delivered,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ child: Column(
+// crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('564',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('SAR',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ child: Text('12',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('items(s)',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ ],
+ ),
+ );
+ }
+ )
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget getProcessingOrder(){
+ return Container(
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.all(8),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Order#:',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('3183',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Date',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('Aug 12, 2020',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.all(8),
+ child: InkWell(
+ onTap: () {
+ Navigator.push(context,
+ MaterialPageRoute(builder: (context) => OrderDetailsPage()));
+ },
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/arrow_right.svg',
+ height: 20,
+ width: 20,),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 1,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ padding: EdgeInsets.only(left: 13.0, right: 13.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.green,
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ TranslationBase.of(context).processing,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ child: Column(
+// crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('564',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('SAR',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ child: Text('12',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('items(s)',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget getPendingOrder(){
+ return Container(
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ ListView.builder(
+ scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: ScrollPhysics(),
+ itemCount: 2 ,
+ itemBuilder: (context, index){
+ return Container(
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.all(8.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Order#:',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('3183',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Date',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('Aug 12, 2020',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.all( 8.0),
+ child: InkWell(
+ onTap: () {
+ Navigator.push(context,
+ MaterialPageRoute(builder: (context) => OrderDetailsPage()));
+ },
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/arrow_right.svg',
+ height: 20,
+ width: 20,),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 1,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.all(8.0),
+ padding: EdgeInsets.only(left: 13.0, right: 13.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.orange[300],
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.orange[300],
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ TranslationBase.of(context).pending,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.all(8.0),
+ child: Column(
+// crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('564',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('SAR',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ child: Text('12',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('items(s)',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ ],
+ ),
+ ),
+
+ );
+ }
+ )
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget getCancelledOrder(){
+ return Container(
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ ListView.builder(
+ scrollDirection: Axis.vertical,
+ shrinkWrap: true,
+ physics: ScrollPhysics(),
+ itemCount: 2 ,
+ itemBuilder: (context, index){
+ return Container(
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.all( 8.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Order#:',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('3183',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5),
+ child: Text('Date',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('Aug 12, 2020',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.all(8.0),
+ child: InkWell(
+ onTap: () {
+ Navigator.push(context,
+ MaterialPageRoute(builder: (context) => OrderDetailsPage()));
+ },
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/arrow_right.svg',
+ height: 20,
+ width: 20,),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 1,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ padding: EdgeInsets.only(left: 10.0, right: 10.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.red[900],
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.red[900],
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ TranslationBase.of(context).cancelled,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
+ child: Column(
+// crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('564',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('SAR',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 5,),
+ Row(
+ children: [
+ Container(
+ child: Text('12',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('items(s)',
+ style: TextStyle(fontSize: 14.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ ],
+ ),
+ ),
+
+ );
+ }
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+
+getOrder() {
+ print("getOrder no4665");
+ OrderService service = new OrderService();
+ service.getOrder(AppGlobal.context).then((res) {
+ print(res);
+ });
+
+}
+
+// filterOrders() {
+// for () {
+// if (order.order_status_id === 30 || order.order_status_id === 997 || order.order_status_id === 994) { // complete
+// this.delivered.push(order);
+// } else if (order.order_status_id === 40 || order.order_status_id === 200 || order.order_status_id === 996) { // cancelled & order refunded
+// this.cancelled.push(order);
+// } else if (order.order_status_id === 10) { // Pending
+// this.pending.push(order);
+// } else if (order.order_status_id === 20 || order.order_status_id === 995 || order.order_status_id === 998 || order.order_status_id === 999) { // Processing
+// this.processing.push(order);
+// } else { // Processing & other all other status
+// this.other.push(order);
+// }
+// }
+//}
+
+
+
diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart
new file mode 100644
index 00000000..777ef1dd
--- /dev/null
+++ b/lib/pages/pharmacy/order/OrderDetails.dart
@@ -0,0 +1,467 @@
+
+import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart';
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
+
+
+
+class OrderDetailsPage extends StatefulWidget {
+
+ @override
+ _OrderDetailsPageState createState() => _OrderDetailsPageState();
+}
+
+class _OrderDetailsPageState extends State {
+ AppSharedPreferences sharedPref = AppSharedPreferences();
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback((_) => getOrderDetails());
+ super.initState();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ centerTitle: true,
+ title: Text(TranslationBase.of(context).orderDetail, style: TextStyle(color:Colors.white)),
+ backgroundColor: Colors.green,
+ ),
+ body: Container(
+ color: Colors.white,
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 15.0, 1.0, 5.0),
+ child: Row(
+ children: [
+ SvgPicture.asset(
+ 'assets/images/pharmacy/shipping_mark_icon.svg',
+ width: 28,
+ height: 28,),
+ Text(TranslationBase.of(context).shippingAddress,
+ style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 15.0, right: 10.0),
+ padding: EdgeInsets.only(left: 11.0, right: 11.0),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.blue,
+ style: BorderStyle.solid,
+ width: 5.0,
+ ),
+ color: Colors.blue,
+ borderRadius: BorderRadius.circular(30.0)
+ ),
+ child: Text(
+ TranslationBase.of(context).delivered,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 13.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 10.0, top: 13.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('NAME',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('Cloud Solutions',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ color: Colors.grey,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/mobile_number_icon.svg',
+ height: 13,),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
+ child: Text('588888778',
+ style: TextStyle(fontSize: 15.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 1,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 10.0, 5.0, 10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/shipping_truck_icon.svg',
+ height: 20,
+ width: 20,),
+ ),
+ Container(
+ margin: EdgeInsets.all(10.0),
+ child:Text(TranslationBase.of(context).shippedMethod,
+ style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/hmg_shipping_logo.svg',
+ height: 25,
+ width: 25,),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 10.0, 1.0, 10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/credit_card_icon.svg',
+ height: 20,
+ width: 20,),
+ ),
+ Container(
+ margin: EdgeInsets.all(10.0),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/credit_card_icon.svg',
+ height: 20,
+ width: 20,),
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
+ child:Text('Mada',
+ style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 15.0),
+ margin: EdgeInsets.only(left: 10.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(TranslationBase.of(context).orderDetail,
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,
+ productReviews:4, totalPrice: '10.00', qyt: '3',),
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(left: 10.0, top: 5.0),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(TranslationBase.of(context).orderSummary,
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(top: 5.0, left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).subtotal,
+ style: TextStyle(
+ fontSize: 13.0,
+ ),
+ ),
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ),
+ Text('343.55',
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(top: 5.0, left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).shipping,
+ style: TextStyle(
+ fontSize: 13.0,
+ ),
+ ),
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ),
+ Text('343.55',
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).vat,
+ style: TextStyle(
+ fontSize: 13.0,
+ ),
+ ),
+ ),
+ Container(
+ padding: EdgeInsets.only(bottom: 10.0),
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ),
+ Text('343.55',
+ style: TextStyle(fontSize: 13.0,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
+ child: Text(
+ TranslationBase.of(context).total,
+ style: TextStyle(
+ fontSize: 15.0,fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(right: 5.0),
+ child: Text(TranslationBase.of(context).sar,
+ style: TextStyle(fontSize: 15.0,fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Text('343.55',
+ style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ InkWell(
+ onTap: (){
+ },
+ child: Container(
+ margin: EdgeInsets.only(top: 20.0),
+ height: 50.0,
+ color: Colors.transparent,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.green,
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).payOnline,
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ InkWell(
+ onTap: () {
+// confirmDelete(snapshot.data[index]["id"]);
+ cancelOrder("id");
+ },
+ child: Container(
+ height: 50.0,
+ color: Colors.transparent,
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).cancelOrder,
+ style: TextStyle(
+ color: Colors.red[900],
+ fontWeight: FontWeight.bold,
+ decoration: TextDecoration.underline
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+ cancelOrder(id){
+ showDialog(
+ context: context,
+ builder: (BuildContext context)=> AlertDialog(
+ title: Text(TranslationBase.of(context).confirm,
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ ),),
+ content: Text(TranslationBase.of(context).confirmCancellation,
+ style: TextStyle(
+ color: Colors.grey,
+ ),),
+ actions:[
+ FlatButton(
+ child: Text(TranslationBase.of(context).cancel,
+ style: TextStyle(
+ color: Colors.red,
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ ),),
+ onPressed: (){
+ Navigator.pop(context);
+ },
+ ),
+ FlatButton(
+ child: Text(TranslationBase.of(context).ok,
+ style: TextStyle(
+ color: Colors.grey,
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ ),),
+ onPressed: (){
+// http.delete(""https://uat.hmgwebservices.com/epharmacy/api/orders/$id");
+ Navigator.push(context,
+ MaterialPageRoute(builder: (context)=> OrderDetailsPage()));
+ },
+ ),
+ ],
+ )
+ );
+ }
+}
+
+ getOrderDetails() {
+ print("getOrderDetails 5466");
+ OrderDetailsService service = new OrderDetailsService();
+ service.getOrderDetails(AppGlobal.context).then((res) {
+ print(res);
+ });
+ }
+
+
+ getPayOrder(){
+
+ }
diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart
new file mode 100644
index 00000000..9de67849
--- /dev/null
+++ b/lib/pages/pharmacy/order/ProductReview.dart
@@ -0,0 +1,312 @@
+import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
+import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
+import 'package:rating_bar/rating_bar.dart';
+import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart';
+
+class ProductReviewPage extends StatefulWidget {
+
+ @override
+ _ProductReviewPageState createState() => _ProductReviewPageState();
+}
+
+class _ProductReviewPageState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ centerTitle: true,
+ title: Text(TranslationBase.of(context).writeReview, style: TextStyle(color:Colors.white)),
+ backgroundColor: Colors.green,
+ ),
+ body: Container(
+ color: Colors.white,
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+// Container(
+// child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,
+// productReviews:4, ),
+// ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 10),
+ child: Image(
+ image:
+ AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'),
+ fit: BoxFit.cover,
+ width: 80,
+ height: 80,
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top :15.0, bottom: 15.0),
+ child: Column(
+ children: [
+ Row(
+ children: [
+ Text('medication name',
+ style: TextStyle(fontSize: 16.0,
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('90.00',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('SAR',
+ style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: EdgeInsets.all(5),
+ child: Align(
+ alignment: Alignment.topLeft,
+ child: RatingBar.readOnly(
+ initialRating: 3,
+ size: 15.0,
+ filledColor: Colors.yellow[700],
+ emptyColor: Colors.grey[500],
+ isHalfAllowed: true,
+ halfFilledIcon: Icons.star_half,
+ filledIcon: Icons.star,
+ emptyIcon: Icons.star,
+ ),
+ ),
+ ),
+ Container(
+ child: Text('4.9',
+ style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 5),
+ child: Text('10 (reviews)',
+ style: TextStyle(fontSize: 12.0,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey[350],
+ height: 20,
+ thickness: 8,
+ indent: 0,
+ endIndent: 0,
+ ),
+ Container(
+ margin: EdgeInsets.only( top: 12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ RatingBar(
+ // initialRating:
+ // this.doctor.actualDoctorRate.toDouble(),
+ size: 40.0,
+ filledColor: Colors.yellow[700],
+ emptyColor: Colors.grey[500],
+ isHalfAllowed: true,
+ halfFilledIcon: Icons.star_half,
+ filledIcon: Icons.star,
+ emptyIcon: Icons.star,
+ ),
+ ],
+ ),
+ ),
+ Container(
+ padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0),
+ child: Column(
+ children: [
+ TextFormField (
+ decoration: InputDecoration(
+ contentPadding: const EdgeInsets.symmetric(vertical: 60.0),
+ border: InputBorder.none,
+ hintText: 'Tell us more about product!',
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(5.0),
+ borderSide: BorderSide(width: 1, color: Colors.grey[400]),
+ ),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.all(Radius.circular(5.0)),
+ borderSide: BorderSide(color: Colors.grey[400], width: 1),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ InkWell(
+ onTap: () {
+
+ },
+ child: Container(
+ height: 50.0,
+ width: 400.0,
+ color: Colors.transparent,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.yellow[700],
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.yellow[700],
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).shareReview,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 16.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ //new screen is showing after submitting the review
+ Widget getReviewedProduct(){
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SvgPicture.asset(
+ 'assets/images/pharmacy/check_icon.svg',
+ width: 28,
+ height: 28,),
+ Container(
+ margin: EdgeInsets.only(left: 10.0),
+ child: Text(TranslationBase.of(context).reviewSuccessful,
+ style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.only(top:5.0, bottom: 20.0 ),
+ child: Text(TranslationBase.of(context).reviewShared,
+ style: TextStyle(fontSize: 15.0,
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(bottom: 30.0, top: 30.0 ),
+ child: SvgPicture.asset(
+ 'assets/images/pharmacy/success_review_icon.svg',
+ width: 100,
+ height: 100,),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 20.0, right: 20.0),
+ child: Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ SvgPicture.asset(
+ 'assets/images/pharmacy/quote_start.svg',
+ width: 15,
+ height: 15,),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(TranslationBase.of(context).reviewComment,
+ style: TextStyle(fontSize: 15.0,
+ ),
+ ),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ SvgPicture.asset(
+ 'assets/images/pharmacy/quote_end.svg',
+ width: 15,
+ height: 15,),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 20.0 ),
+ child: InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) {
+ return PharmacyProfilePage();
+ }),
+ );
+ },
+ child: Container(
+ height: 50.0, color: Colors.transparent,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.orange,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.transparent,
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(
+ TranslationBase.of(context).backMyAccount,
+ style: TextStyle(
+ color: Colors.orange,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart
index ac4bfb35..bc19e510 100644
--- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart
+++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart
@@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/style.dart';
-import 'package:flutter_svg/flutter_svg.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
class AddAddressPage extends StatefulWidget {
@override
@@ -10,48 +10,118 @@ class AddAddressPage extends StatefulWidget {
}
class _AddAddressState extends State {
+
+ void onMapCreated(controller){
+ setState(() {
+ mapController= controller;
+ });
+ }
+ void _getAddressFromLatLng() {}
+ _onMapTypeButtonPressed(){}
+ _onAddMarkerButtonPressed(){}
+
+ LatLng _initialPosition;
+ GoogleMapController mapController;
+ @override
+ void initState() {
+ // TODO: implement initState
+ _initialPosition = LatLng(24.662617030, 46.7334844);
+ super.initState();
+ }
+
+ void _onMapCreated(GoogleMapController controller) {
+ mapController = controller;
+ }
+
+
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
- title: Text(TranslationBase.of(context).addNewAddress, style: TextStyle(color:Colors.white)),
- backgroundColor: Colors.green,
+ title: Text(TranslationBase.of(context).addNewAddress, style: TextStyle(color:Colors.white)),
+ backgroundColor: Colors.green,
),
- body: Container(
- child: Column(
- children: [
- Container(
-
- ),
- Container(
- height: 50.0,
- width: 400.0,
- color: Colors.transparent,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: Colors.green,
- style: BorderStyle.solid,
- width: 1.0
- ),
- color: Colors.green,
- borderRadius: BorderRadius.circular(10.0)
- ),
- child: Center(
- child: Text(
- TranslationBase.of(context).save,
- style: TextStyle(
- color: Colors.white,
- fontSize: 20.0,
- fontWeight: FontWeight.bold,
- ),
- ),
+ body: Stack(
+ children: [
+ GoogleMap(
+ zoomControlsEnabled: true,
+ myLocationButtonEnabled: true,
+ myLocationEnabled: true,
+ onMapCreated: _onMapCreated,
+ onCameraMove: (object) {
+// widget.currentLat = object.target.latitude;
+// widget.currentLong = object.target.longitude;
+ },
+ onCameraIdle: _getAddressFromLatLng,
+ padding: EdgeInsets.only(bottom: 90.0),
+ initialCameraPosition: CameraPosition(
+ target: _initialPosition,
+ zoom: 13.0,
+ ),
+ ),
+ Align(
+ alignment: Alignment.topRight,
+ child: Column(
+ children: [
+ button(_onMapTypeButtonPressed,Icons.map),
+ SizedBox(
+ height:16.0,
),
- ),
+ button(_onAddMarkerButtonPressed, Icons.add_location)
+ ],
),
- ],
+ ),
+ ]
),
- ),
+ bottomSheet: InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) {
+ return AddAddressPage();
+ }),
+ );
+ },
+ child: Container(
+ height: 50.0,
+ color: Colors.green,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.green,
+ borderRadius: BorderRadius.circular(10.0)
+ ),
+ child: Center(
+ child: Text(TranslationBase.of(context).confirmLocation,
+ style: TextStyle(
+ color: Colors.white,
+ fontSize: 15.0,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
);
- }}
\ No newline at end of file
+ }
+
+
+ Widget button(Function function, IconData icon){
+ return FloatingActionButton(
+ onPressed: function,
+ materialTapTargetSize: MaterialTapTargetSize.padded,
+ backgroundColor: Colors.red,
+ child: Icon(
+ icon,
+ size: 18.0,
+ ),);
+ }
+
+}
+
diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
index 122fd0da..2de45546 100644
--- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
+++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
@@ -4,7 +4,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
-
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
class PharmacyAddressesPage extends StatefulWidget{
@override
@@ -15,8 +17,14 @@ class _PharmacyAddressesState extends State{
int selectedRadio;
bool _value = false;
+
+ AppSharedPreferences sharedPref = AppSharedPreferences();
+
+
@override
void initState(){
+ WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress());
+
super.initState();
selectedRadio=0;
}
@@ -41,11 +49,11 @@ class _PharmacyAddressesState extends State{
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
- itemCount: 2 ,
+ itemCount: 5 ,
itemBuilder: (context, index){
return Container(
child: Padding(
- padding:EdgeInsets.only(top:20.0, left:5.0, right:5.0, bottom:5.0,),
+ padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,),
child: Column(
children: [
Row(
@@ -174,6 +182,10 @@ class _PharmacyAddressesState extends State{
Column(
children: [
InkWell(
+ onTap: () {
+// confirmDelete(snapshot.data[index]["id"]);
+ confirmDelete("address");
+ },
child: Row(
children: [
Container(
@@ -230,6 +242,7 @@ class _PharmacyAddressesState extends State{
);
},
child: Container(
+ margin: EdgeInsets.only(bottom: 100.0),
height: 50.0,
color: Colors.transparent,
child: Container(
@@ -258,8 +271,99 @@ class _PharmacyAddressesState extends State{
),
),
),
+ bottomSheet: InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) {
+ return AddAddressPage();
+ }),
+ );
+ },
+ child: Container(
+ height: 50.0,
+ color: Colors.green,
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.green,
+ style: BorderStyle.solid,
+ width: 1.0
+ ),
+ color: Colors.green,
+ borderRadius: BorderRadius.circular(5.0)
+ ),
+ child: Center(
+ child: Text(TranslationBase.of(context).confirmAddress,
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
);
}
+ confirmDelete(address){
+ showDialog(
+ context: context,
+ builder: (BuildContext context)=> AlertDialog(
+ title: Text(TranslationBase.of(context).confirmDeleteMsg,
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ ),),
+ content: Text("address"),
+ actions:[
+ FlatButton(
+ child: Text(TranslationBase.of(context).cancel,
+ style: TextStyle(
+ color: Colors.red,
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ ),),
+ onPressed: (){
+ Navigator.pop(context);
+ },
+ ),
+ FlatButton(
+ child: Text(TranslationBase.of(context).confirmDelete,
+ style: TextStyle(
+ color: Colors.grey,
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ ),),
+ onPressed: (){
+// http.delete("https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses/$id");
+ Navigator.push(context,
+ MaterialPageRoute(builder: (context)=> PharmacyAddressesPage() ));
+ },
+ ),
+ ],
+ )
+ );
+ }
+}
+
+getAllAddress() {
+ print("ADDRESSES");
+ PharmacyAddressService service = new PharmacyAddressService();
+ service.getAddress(AppGlobal.context).then((res) {
+ print(res);
+ });
+
+}
+
+
+
+ getConfirmAddress(){
+
+ }
+ getEditAddress(){
+
+ }
+ getDeleteAddress(){
}
diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart
new file mode 100644
index 00000000..b8201dc6
--- /dev/null
+++ b/lib/services/pharmacy_services/orderDetails_service.dart
@@ -0,0 +1,39 @@
+
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/service/base_service.dart';
+import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
+import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:flutter/material.dart';
+
+
+class OrderDetailsService extends BaseService{
+
+ AppSharedPreferences sharedPref = AppSharedPreferences();
+ AppGlobal appGlobal = new AppGlobal();
+
+ AuthenticatedUser authUser = new AuthenticatedUser();
+ AuthProvider authProvider = new AuthProvider();
+
+ Future