fix order and orderdetails

merge-requests/206/head
Fatimah Alshammari 4 years ago
parent ddf032bb47
commit d328c74fc4

@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="115.115" height="115.114" viewBox="0 0 115.115 115.114">
<g id="box_2_" data-name="box (2)" transform="translate(0 -0.002)">
<path id="Path_1371" data-name="Path 1371" d="M134.442,152.513l-32.349-1.2,0,0L76,160.011l40.47,13.49,40.47-13.49Z" transform="translate(-58.912 -117.291)" fill="#fff"/>
<path id="Path_1372" data-name="Path 1372" d="M216.469,30.237A20.235,20.235,0,1,1,196.234,10,20.234,20.234,0,0,1,216.469,30.237Z" transform="translate(-136.429 -7.752)" fill="#c72525"/>
<path id="Path_1373" data-name="Path 1373" d="M172.426,256.019,131.972,250,96,256.97v36.2l35.973,13.49,40.47-13.49v-37.1Z" transform="translate(-74.416 -193.792)" fill="#ffd474"/>
<g id="Group_1210" data-name="Group 1210" transform="translate(2.248 15.902)">
<path id="Path_1374" data-name="Path 1374" d="M339.847,78.112,335.939,95.77l22.5,7.5L373.275,88.43Z" transform="translate(-262.657 -76.45)" fill="#e8ab22"/>
<path id="Path_1375" data-name="Path 1375" d="M256,203.492l11.975,14.967,43.334-13.618L296.469,190Z" transform="translate(-200.69 -163.184)" fill="#e8ab22"/>
<path id="Path_1376" data-name="Path 1376" d="M33.839,205.8l40.47,13.49,9.479-15.8L43.318,190Z" transform="translate(-28.479 -163.184)" fill="#e8ab22"/>
<path id="Path_1377" data-name="Path 1377" d="M48.416,70.722,10,82.7,24.838,97.54l26.092-8.7,0,0Z" transform="translate(-9.999 -70.722)" fill="#e8ab22"/>
</g>
<path id="Path_1378" data-name="Path 1378" d="M148.247,374.5A2.248,2.248,0,1,0,146,372.25,2.249,2.249,0,0,0,148.247,374.5Z" transform="translate(-113.174 -286.812)"/>
<path id="Path_1379" data-name="Path 1379" d="M14.256,43.069,5.68,57.362A2.248,2.248,0,0,0,6.9,60.652L19.335,64.8v34.58a2.248,2.248,0,0,0,1.459,2.105c7.605,2.852,35.864,13.45,36.015,13.5a2.24,2.24,0,0,0,1.438.02l.02-.006,40.47-13.49a2.249,2.249,0,0,0,1.537-2.133V63.872L113.54,59.7a2.248,2.248,0,0,0,.916-3.735L101.206,42.72l13.249-13.249a2.248,2.248,0,0,0-.927-3.738L81.265,15.775a22.486,22.486,0,0,0-42.317-1.693L1.578,25.735a2.249,2.249,0,0,0-.92,3.736Zm3.831,2.355,36.1,12.033L47.078,69.306l-36.1-12.033Zm24.275-8.758a22.477,22.477,0,0,0,33.876,1.162L90.916,42.72,57.557,53.84,24.2,42.72ZM23.832,66.3c24.765,8.211,23.556,7.961,24.246,7.961a2.249,2.249,0,0,0,1.928-1.092l5.3-8.838v45.3L23.832,97.82V66.3Zm71.947,31.46L59.8,109.749V62.619l7.971,9.962a2.249,2.249,0,0,0,2.43.74l25.573-8.036Zm12.875-41.231L70.325,68.571l-9-11.247L97.419,45.293ZM97.419,40.148l-18.33-6.109a22.548,22.548,0,0,0,3.2-11.553c0-.571-.024-1.141-.067-1.709l26.417,8.154ZM59.8,4.5A17.963,17.963,0,0,1,77.792,22.485,17.984,17.984,0,0,1,59.8,40.472,17.987,17.987,0,1,1,59.8,4.5ZM37.561,19.225a22.669,22.669,0,0,0-.239,3.26,22.348,22.348,0,0,0,2.492,10.29l-22.12,7.373L6.467,28.921Z"/>
<path id="Path_1380" data-name="Path 1380" d="M185.216,387.573l5,1.875a2.248,2.248,0,1,0,1.579-4.21l-5-1.875a2.248,2.248,0,1,0-1.579,4.21Z" transform="translate(-142.442 -297.057)"/>
<path id="Path_1381" data-name="Path 1381" d="M162.524,416.981l-13.49-5.059a2.248,2.248,0,0,0-1.579,4.21l13.49,5.059a2.248,2.248,0,0,0,1.579-4.21Z" transform="translate(-113.171 -319.196)"/>
<path id="Icon_ionic-ios-close" data-name="Icon ionic-ios-close" d="M23.334,21.027l6.958-6.958a1.63,1.63,0,0,0-2.306-2.306l-6.958,6.958L14.07,11.763a1.63,1.63,0,1,0-2.306,2.306l6.958,6.958-6.958,6.958A1.63,1.63,0,0,0,14.07,30.29l6.958-6.958,6.958,6.958a1.63,1.63,0,1,0,2.306-2.306Z" transform="translate(38.674 1.065)" fill="#fff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -340,14 +340,6 @@ 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";
// pharmacy
const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
@ -355,7 +347,9 @@ const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_WISHLIST = "epharmacy/api/shopping_cart_items/";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS ="epharmacy/api/orders/";
const GET_ADDRESS ="epharmacy/api/Customers/272843?fields=addresses";
// Home Health Care
const HHC_GET_ALL_SERVICES =
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices";

@ -677,6 +677,10 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Are you sure! want to cancel this order ",
"ar": "هل انت متأكد تريد حذف هذا المنتج "
},
"orderNumber": {"en": "Order#: ", "ar": "الطلب: "},
"orderDate": {"en": "Date", "ar": "التاريخ:"},
"itemsNo": {"en": "items(s)", "ar": "عناصر"},
"noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"},
"TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"},
"Beforeusing": {

@ -0,0 +1,170 @@
import 'dart:convert';
PharmacyAddressesModel pharmacyAddressesModelFromJson(String str) => PharmacyAddressesModel.fromJson(json.decode(str));
String pharmacyAddressesModelToJson(PharmacyAddressesModel data) => json.encode(data.toJson());
class PharmacyAddressesModel {
PharmacyAddressesModel({
this.customers,
});
List<Customer> customers;
factory PharmacyAddressesModel.fromJson(Map<String, dynamic> json) => PharmacyAddressesModel(
customers: List<Customer>.from(json["customers"].map((x) => Customer.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"customers": List<dynamic>.from(customers.map((x) => x.toJson())),
};
}
class Customer {
Customer({
this.addresses,
});
List<Address> addresses;
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
addresses: List<Address>.from(json["addresses"].map((x) => Address.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"addresses": List<dynamic>.from(addresses.map((x) => x.toJson())),
};
}
class Address {
Address({
this.id,
this.firstName,
this.lastName,
this.email,
this.company,
this.countryId,
this.country,
this.stateProvinceId,
this.city,
this.address1,
this.address2,
this.zipPostalCode,
this.phoneNumber,
this.faxNumber,
this.customerAttributes,
this.createdOnUtc,
this.province,
this.latLong,
});
String id;
FirstName firstName;
LastName lastName;
Email email;
dynamic company;
int countryId;
Country country;
dynamic stateProvinceId;
City city;
String address1;
String address2;
String zipPostalCode;
String phoneNumber;
dynamic faxNumber;
String customerAttributes;
DateTime createdOnUtc;
dynamic province;
String latLong;
factory Address.fromJson(Map<String, dynamic> json) => Address(
id: json["id"],
firstName: firstNameValues.map[json["first_name"]],
lastName: lastNameValues.map[json["last_name"]],
email: emailValues.map[json["email"]],
company: json["company"],
countryId: json["country_id"],
country: countryValues.map[json["country"]],
stateProvinceId: json["state_province_id"],
city: cityValues.map[json["city"]],
address1: json["address1"],
address2: json["address2"],
zipPostalCode: json["zip_postal_code"],
phoneNumber: json["phone_number"],
faxNumber: json["fax_number"],
customerAttributes: json["customer_attributes"],
createdOnUtc: DateTime.parse(json["created_on_utc"]),
province: json["province"],
latLong: json["lat_long"],
);
Map<String, dynamic> toJson() => {
"id": id,
"first_name": firstNameValues.reverse[firstName],
"last_name": lastNameValues.reverse[lastName],
"email": emailValues.reverse[email],
"company": company,
"country_id": countryId,
"country": countryValues.reverse[country],
"state_province_id": stateProvinceId,
"city": cityValues.reverse[city],
"address1": address1,
"address2": address2,
"zip_postal_code": zipPostalCode,
"phone_number": phoneNumber,
"fax_number": faxNumber,
"customer_attributes": customerAttributes,
"created_on_utc": createdOnUtc.toIso8601String(),
"province": province,
"lat_long": latLong,
};
}
enum City { RIYADH, AL_OYUN }
final cityValues = EnumValues({
"Al Oyun": City.AL_OYUN,
"Riyadh": City.RIYADH
});
enum Country { SAUDI_ARABIA }
final countryValues = EnumValues({
"Saudi Arabia": Country.SAUDI_ARABIA
});
enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM }
final emailValues = EnumValues({
"Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM,
"Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM
});
enum FirstName { TAMER, TAMER_FANASHEH }
final firstNameValues = EnumValues({
"TAMER": FirstName.TAMER,
"TAMER FANASHEH": FirstName.TAMER_FANASHEH
});
enum LastName { FANASHEH, MUSA }
final lastNameValues = EnumValues({
"FANASHEH": LastName.FANASHEH,
"MUSA": LastName.MUSA
});
class EnumValues<T> {
Map<String, T> map;
Map<T, String> reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
if (reverseMap == null) {
reverseMap = map.map((k, v) => new MapEntry(v, k));
}
return reverseMap;
}
}

File diff suppressed because it is too large Load Diff

@ -170,6 +170,38 @@ class BaseAppClient {
}
}
getPharmacy(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
Map<String, String> queryParams}) async {
String url = PHARMACY_BASE_URL + endPoint;
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
}
print("URL : $url");
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
}
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE);

@ -0,0 +1,24 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class PharmacyAddressesViewModel extends BaseViewModel {
PharmacyAddressService _PharmacyAddressService = locator<PharmacyAddressService>();
List<PharmacyAddressesModel> get address => _PharmacyAddressService.address;
Future getAddress() async {
setState(ViewState.Busy);
await _PharmacyAddressService.getAddress();
if (_PharmacyAddressService.hasError) {
error = _PharmacyAddressService.error;
setState(ViewState.Error);
} else {
}
}
}

@ -0,0 +1,39 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class OrderModelViewModel extends BaseViewModel {
OrderService _orderService = locator<OrderService>();
List<OrderModel> get order => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
Future getOrder(id, pageId) async {
setState(ViewState.Busy);
await _orderService.getOrder(id,pageId);
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
} else {
}
}
Future getOrderDetails(orderId) async {
setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(orderId);
if (_orderDetailsService.hasError) {
error = _orderDetailsService.error;
setState(ViewState.Error);
} else {
}
}
}

@ -4,6 +4,9 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_v
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:get_it/get_it.dart';
@ -86,6 +89,9 @@ import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'core/viewModels/qr_view_model.dart';
import 'core/viewModels/vaccine_view_model.dart';
import 'core/service/vaccine_service.dart';
import 'services/pharmacy_services/orderDetails_service.dart';
import 'services/pharmacy_services/pharmacyAddress_service.dart';
GetIt locator = GetIt.instance;
@ -142,6 +148,9 @@ void setupLocator() {
locator.registerLazySingleton(() => PharmacyModuleService());
locator.registerLazySingleton(() => OrderPreviewService());
locator.registerLazySingleton(() => OrderService());
locator.registerLazySingleton(() => PharmacyAddressService());
locator.registerLazySingleton(() => OrderDetailsService());
/// View Model
@ -173,6 +182,8 @@ void setupLocator() {
locator.registerFactory(() => ChildVaccinesViewModel());
locator.registerFactory(() => UserInformationViewModel());
locator.registerFactory(() => VaccinationTableViewModel());
locator.registerFactory(() => OrderModelViewModel());
locator.registerFactory(() => PharmacyAddressesViewModel());

@ -24,9 +24,9 @@ class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
@override
void initState() {
if (widget.onModelReady != null && authenticatedUserObject.isLogin) {
// if (widget.onModelReady != null && authenticatedUserObject.isLogin) {
widget.onModelReady(model);
}
// }
super.initState();
}

@ -489,7 +489,7 @@ class _HomePageState extends State<HomePage> {
),
DashboardItem(
onTap: () => Navigator.push(
context, FadePage(page: PharmacyPage())),
context, FadePage(page: OrderPage())),
child: Center(
child: Padding(

@ -1,3 +1,6 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -8,17 +11,26 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
class OrderPage extends StatefulWidget {
// orderList({this.customerId, this.pageId});
@override
_OrderPageState createState() => _OrderPageState();
}
class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMixin{
String customerId="";
String page_id="";
List delivered = [] ;
List processing = [];
List cancelled = [];
List pending = [];
TabController _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
// WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
super.initState();
_tabController = new TabController(length: 4, vsync: this,);
@ -26,54 +38,61 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
@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(),
return BaseView<OrderModelViewModel>(
onModelReady: (model) => model.getOrder(customerId, page_id),
builder: (_,model, wi )=> AppScaffold(
appBarTitle:(TranslationBase.of(context).order),
// backgroundColor: Colors.green ,
// centerTitle: true,
// title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)),
// backgroundColor: Colors.green,
isShowAppBar: true,
isPharmacy:true ,
body: Container(
child: Column(
children: [
TabBar(
tabs: [
Tab(text: TranslationBase.of(context).delivered),
// Tab(text: model.order.length.toString()),
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(model),
getProcessingOrder(model),
getPendingOrder(model),
getCancelledOrder(model),
],
controller: _tabController,
),
),
],
),
),
),
);
}
Widget getDeliveredOrder(){
Widget getDeliveredOrder(OrderModelViewModel model){
return Container(
width: MediaQuery.of(context).size.width,
child: SingleChildScrollView(
child: Column(
child: model.order.length != 0 && model.order[0].orderStatusId == 30
? SingleChildScrollView(
child: Column(
children:<Widget> [
ListView.builder(
scrollDirection: Axis.vertical,
@ -96,13 +115,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Order#:',
child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
child: Text('3183',
child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -115,13 +134,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Date',
child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
child: Text('Aug 12, 2020',
child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -156,24 +175,27 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
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(
Expanded(
child: 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],
style: BorderStyle.solid,
width: 5.0,
borderRadius: BorderRadius.circular(30.0)
),
child: Text(
model.order[0].orderStatus.toString(),
// TranslationBase.of(context).delivered,
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
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,
),
),
),
@ -186,14 +208,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
child: Text('564',
child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('SAR',
child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -212,7 +234,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('items(s)',
child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@ -238,14 +260,34 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
)
],
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pharmacy/empty_box.svg'),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noOrder,
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
),
);
}
Widget getProcessingOrder(){
Widget getProcessingOrder(OrderModelViewModel model){
return Container(
child: SingleChildScrollView(
child: Column(
child: model.order.length != 0 && model.order[0].orderStatusId == 20
? SingleChildScrollView(
child: Column(
children:<Widget> [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -259,13 +301,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Order#:',
child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
child: Text('3183',
child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -278,13 +320,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Date',
child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
child: Text('Aug 12, 2020',
child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -319,24 +361,27 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
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(
Expanded(
child: 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,
style: BorderStyle.solid,
width: 5.0,
borderRadius: BorderRadius.circular(30.0)
),
child: Text(
model.order[0].orderStatus.toString(),
// TranslationBase.of(context).processing,
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
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,
),
),
),
@ -349,14 +394,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
child: Text('564',
child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('SAR',
child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -375,7 +420,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('items(s)',
child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@ -396,15 +441,35 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
],
),
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pharmacy/empty_box.svg'),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noOrder,
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
),
);
}
Widget getPendingOrder(){
Widget getPendingOrder(OrderModelViewModel model){
return Container(
child: SingleChildScrollView(
child: Column(
children:<Widget> [
child: model.order.length != 0 && model.order[0].orderStatusId == 10
? SingleChildScrollView(
child: Column(
children:<Widget> [
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
@ -427,13 +492,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Order#:',
child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
child: Text('3183',
child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -446,13 +511,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Date',
child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
child: Text('Aug 12, 2020',
child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -487,27 +552,28 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
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,
Expanded(
child: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)
),
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,
),
),
),
child: Text(
model.order[0].orderStatus.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
), ),
Container(
margin: EdgeInsets.all(8.0),
child: Column(
@ -517,14 +583,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
child: Text('564',
child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('SAR',
child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -543,7 +609,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('items(s)',
child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@ -571,13 +637,34 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
)
],
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pharmacy/empty_box.svg'),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noOrder,
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
),
);
}
Widget getCancelledOrder(){
Widget getCancelledOrder(OrderModelViewModel model){
return Container(
child: SingleChildScrollView(
child: model.order.length != 0 && model.order[0].orderStatusId == 40
? SingleChildScrollView(
child: Column(
children:<Widget> [
ListView.builder(
@ -602,13 +689,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Order#:',
child: Text(TranslationBase.of(context).orderNumber,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
child: Text('3183',
child: Text(model.order[0].id.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -621,13 +708,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(right: 5),
child: Text('Date',
child: Text(TranslationBase.of(context).orderDate,
style: TextStyle(fontSize: 14.0,
),
),
),
Container(
child: Text('Aug 12, 2020',
child: Text(model.order[0].createdOnUtc.toString(),
style: TextStyle(fontSize: 14.0,
),
),
@ -662,27 +749,28 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
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,
Expanded(
child: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)
),
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,
),
),
),
child: Text(
model.order[0].orderStatus.toString(),
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(
@ -692,14 +780,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
children: [
Container(
margin: EdgeInsets.only(left: 5),
child: Text('564',
child: Text(model.order[0].orderTotal.toString(),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('SAR',
child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
),
),
@ -718,7 +806,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
Container(
margin: EdgeInsets.only(left: 5),
child: Text('items(s)',
child: Text(TranslationBase.of(context).itemsNo,
style: TextStyle(fontSize: 14.0,
),
),
@ -746,20 +834,32 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
)
],
),
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/pharmacy/empty_box.svg'),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noOrder,
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
),
);
}
}
getOrder() {
print("getOrder no4665");
OrderService service = new OrderService();
service.getOrder(AppGlobal.context).then((res) {
print(res);
});
}
// filterOrders() {
// for () {

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -17,7 +20,9 @@ class OrderDetailsPage extends StatefulWidget {
class _OrderDetailsPageState extends State<OrderDetailsPage> {
AppSharedPreferences sharedPref = AppSharedPreferences();
String customerId="";
String page_id="";
String orderId="3516";
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getOrderDetails());
@ -26,385 +31,388 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
@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:<Widget> [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
Container(
margin: EdgeInsets.fromLTRB(10.0, 15.0, 1.0, 5.0),
child: Row(
children: <Widget>[
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,
return BaseView<OrderModelViewModel>(
onModelReady:(model) => model.getOrderDetails(orderId),
builder: (_,model, wi )=> AppScaffold(
appBarTitle: (TranslationBase.of(context).orderDetail),
// title: Text(TranslationBase.of(context).orderDetail, style: TextStyle(color:Colors.white)),
// backgroundColor: Colors.green,
isShowAppBar: true,
isPharmacy:true ,
body: Container(
color: Colors.white,
child: SingleChildScrollView(
child: Column(
children:<Widget> [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
Container(
margin: EdgeInsets.fromLTRB(10.0, 15.0, 1.0, 5.0),
child: Row(
children: <Widget>[
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(
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,
style: BorderStyle.solid,
width: 5.0,
borderRadius: BorderRadius.circular(30.0)
),
child: Text(
TranslationBase.of(context).delivered,
style: TextStyle(
color: Colors.white,
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
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:<Widget> [
Text('NAME',
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
),
),
],
),
],
),
Container(
margin: EdgeInsets.only(left: 10.0, top: 13.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
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:<Widget> [
Text('Cloud Solutions',
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
color: Colors.grey,
),
),
),
],
],
),
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
Row(
children:<Widget> [
Text('Cloud Solutions',
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
color: Colors.grey,
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,
),
),
),
],
),
),
Row(
children:<Widget> [
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:<Widget> [
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,),
),
),
],
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
children:<Widget> [
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.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:<Widget> [
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,
),
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,
),
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,
Divider(
color: Colors.grey[350],
height: 20,
thickness: 8,
indent: 0,
endIndent: 0,
),
Row(
children:<Widget> [
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,
),
),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
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: <Widget>[
Container(
margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 13.0,
),
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,
),
),
Text('343.55',
style: TextStyle(fontSize: 13.0,
],
),
),
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:<Widget> [
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,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
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: <Widget>[
Container(
margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar,
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: <Widget>[
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,
Text('343.55',
style: TextStyle(fontSize: 13.0,
),
),
),
],
],
),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
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,
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
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: <Widget>[
Container(
margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar,
Container(
padding: EdgeInsets.only(bottom: 10.0),
margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
child: Row(
children: <Widget>[
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:<Widget> [
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,
),
Text('343.55',
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: <Widget>[
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:<Widget> [
Container(
margin: EdgeInsets.only(top: 5.0,left: 10.0 ),
child: Text(
TranslationBase.of(context).total,
style: TextStyle(
fontSize: 15.0,fontWeight: FontWeight.bold,
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
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: <Widget>[
Container(
margin: EdgeInsets.only(right: 5.0),
child: Text(TranslationBase.of(context).sar,
style: TextStyle(fontSize: 15.0,fontWeight: FontWeight.bold,
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0),
child: Row(
children: <Widget>[
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,
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,
],
),
InkWell(
onTap: (){
},
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,
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: () {
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");
},
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
),
),
),
),
),
),
],
),
],
),
),
),
),

@ -60,18 +60,18 @@ class _AddAddressState extends State<AddAddressPage> {
zoom: 13.0,
),
),
Align(
alignment: Alignment.topRight,
child: Column(
children:<Widget> [
button(_onMapTypeButtonPressed,Icons.map),
SizedBox(
height:16.0,
),
button(_onAddMarkerButtonPressed, Icons.add_location)
],
),
),
// Align(
// alignment: Alignment.topRight,
// child: Column(
// children:<Widget> [
// button(_onMapTypeButtonPressed,Icons.map),
// SizedBox(
// height:16.0,
// ),
// button(_onAddMarkerButtonPressed, Icons.add_location)
// ],
// ),
// ),
]
),
bottomSheet: InkWell(
@ -112,16 +112,16 @@ class _AddAddressState extends State<AddAddressPage> {
}
Widget button(Function function, IconData icon){
return FloatingActionButton(
onPressed: function,
materialTapTargetSize: MaterialTapTargetSize.padded,
backgroundColor: Colors.red,
child: Icon(
icon,
size: 18.0,
),);
}
// Widget button(Function function, IconData icon){
// return FloatingActionButton(
// onPressed: function,
// materialTapTargetSize: MaterialTapTargetSize.padded,
// backgroundColor: Colors.red,
// child: Icon(
// icon,
// size: 18.0,
// ),);
// }
}

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -23,7 +26,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage>{
@override
void initState(){
WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress());
// WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress());
super.initState();
selectedRadio=0;
@ -35,269 +38,273 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage>{
}
Widget build (BuildContext context){
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)),
backgroundColor: Colors.green,
),
body: Container(
child:SingleChildScrollView(
child: Column(
children:<Widget>[
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: 5 ,
itemBuilder: (context, index){
return Container(
child: Padding(
padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children:<Widget> [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
InkWell(
onTap: () {
setState(() {
_value = !_value;
});
},
child: Container(
margin: EdgeInsets.only(right: 20),
return BaseView<PharmacyAddressesViewModel>(
onModelReady: (model) => model.getAddress(),
builder: (_,model, wi )=> AppScaffold(
appBarTitle: "",
// centerTitle: true,
// title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)),
// backgroundColor: Colors.green,
isShowAppBar: true,
isPharmacy:true ,
body: Container(
child:SingleChildScrollView(
child: Column(
children:<Widget>[
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: 5 ,
itemBuilder: (context, index){
return Container(
child: Padding(
padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children:<Widget> [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
InkWell(
onTap: () {
setState(() {
_value = !_value;
});
},
child: Container(
margin: EdgeInsets.only(right: 20),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: _value
? Container(
child: SvgPicture.asset(
'assets/images/pharmacy/check_icon.svg',
height: 25,
width: 25,),
)
: Container(
child: SvgPicture.asset(
'assets/images/pharmacy/check_icon.svg',
height: 23,
width: 23,
color: Colors.transparent,
),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0
),
color: Colors.transparent,
borderRadius: BorderRadius.circular(50.0)
child: Padding(
padding: const EdgeInsets.all(5.0),
child: _value
? Container(
child: SvgPicture.asset(
'assets/images/pharmacy/check_icon.svg',
height: 25,
width: 25,),
)
: Container(
child: SvgPicture.asset(
'assets/images/pharmacy/check_icon.svg',
height: 23,
width: 23,
color: Colors.transparent,
),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0
),
color: Colors.transparent,
borderRadius: BorderRadius.circular(50.0)
),
),
),
),
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
Text('NAME',
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 5,),
Text('Address',
style: TextStyle(fontSize: 15.0, color: Colors.grey,
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
Text('NAME',
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold,
),
),
),
SizedBox(
height: 5,),
Row(
children:<Widget> [
Container(
margin: EdgeInsets.only(bottom: 8),
child: SvgPicture.asset(
'assets/images/pharmacy/mobile_number_icon.svg',
height: 13,),
SizedBox(
height: 5,),
Text('Address',
style: TextStyle(fontSize: 15.0, color: Colors.grey,
),
Container(
margin: EdgeInsets.only(left: 10, bottom: 8),
child: Text('588888778',
style: TextStyle(fontSize: 15.0,
),
SizedBox(
height: 5,),
Row(
children:<Widget> [
Container(
margin: EdgeInsets.only(bottom: 8),
child: SvgPicture.asset(
'assets/images/pharmacy/mobile_number_icon.svg',
height: 13,),
),
Container(
margin: EdgeInsets.only(left: 10, bottom: 8),
child: Text('588888778',
style: TextStyle(fontSize: 15.0,
),
),
),
),
],
),
SizedBox(
height: 15,),
Row(
children:<Widget> [
Column(
children: <Widget> [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return AddAddressPage();
}),
);
},
child: Row(
children:<Widget> [
Container(
margin: EdgeInsets.only(right:10, bottom: 15),
child: SvgPicture.asset(
'assets/images/pharmacy/edit_icon.svg',
height: 15,),
),
Container(
margin: EdgeInsets.only(right:5, bottom: 15),
padding: EdgeInsets.only(right: 10.0),
child: Text(TranslationBase.of(context).edit,
style: TextStyle(fontSize: 15.0,
color: Colors.blue,
),
],
),
SizedBox(
height: 15,),
Row(
children:<Widget> [
Column(
children: <Widget> [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return AddAddressPage();
}),
);
},
child: Row(
children:<Widget> [
Container(
margin: EdgeInsets.only(right:10, bottom: 15),
child: SvgPicture.asset(
'assets/images/pharmacy/edit_icon.svg',
height: 15,),
),
decoration: BoxDecoration(
border: Border(
right: BorderSide(
color: Colors.grey,
width: 1.0,
Container(
margin: EdgeInsets.only(right:5, bottom: 15),
padding: EdgeInsets.only(right: 10.0),
child: Text(TranslationBase.of(context).edit,
style: TextStyle(fontSize: 15.0,
color: Colors.blue,
),
),
),
),
],
),
decoration: BoxDecoration(
border: Border(
right: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
),
),
],
),
),
),
],
),
Column(
children: <Widget> [
InkWell(
onTap: () {
],
),
Column(
children: <Widget> [
InkWell(
onTap: () {
// confirmDelete(snapshot.data[index]["id"]);
confirmDelete("address");
},
child: Row(
children:<Widget> [
Container(
margin: EdgeInsets.only(left: 15, right: 10, bottom: 15),
child: SvgPicture.asset(
'assets/images/pharmacy/delete_red_icon.svg',
height: 15,),
),
Container(
margin: EdgeInsets.only(bottom: 15),
child: Text(TranslationBase.of(context).delete,
style: TextStyle(fontSize: 15.0,
color: Colors.redAccent,
confirmDelete("address");
},
child: Row(
children:<Widget> [
Container(
margin: EdgeInsets.only(left: 15, right: 10, bottom: 15),
child: SvgPicture.asset(
'assets/images/pharmacy/delete_red_icon.svg',
height: 15,),
),
Container(
margin: EdgeInsets.only(bottom: 15),
child: Text(TranslationBase.of(context).delete,
style: TextStyle(fontSize: 15.0,
color: Colors.redAccent,
),
),
),
),
],
],
),
),
),
],
)
],
),
],
),
SizedBox(
height: 10,
),
],
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 6,
indent: 0,
endIndent: 0,
),
],
],
)
],
),
],
),
SizedBox(
height: 10,
),
],
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 6,
indent: 0,
endIndent: 0,
),
],
),
),
),
);
}
),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return AddAddressPage();
}),
);
},
child: Container(
margin: EdgeInsets.only(bottom: 100.0),
height: 50.0,
color: Colors.transparent,
);
}
),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return AddAddressPage();
}),
);
},
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 1.0
),
color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0)
),
child: Center(
child: Text(
TranslationBase.of(context).addAddress,
style: TextStyle(
margin: EdgeInsets.only(bottom: 100.0),
height: 50.0,
color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
fontWeight: FontWeight.bold,
style: BorderStyle.solid,
width: 1.0
),
color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0)
),
child: Center(
child: Text(
TranslationBase.of(context).addAddress,
style: TextStyle(
color: Colors.green,
fontWeight: FontWeight.bold,
),
),
),
),
),
),
),
],
],
),
),
),
),
bottomSheet: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return AddAddressPage();
}),
);
},
child: Container(
height: 50.0,
color: Colors.green,
bottomSheet: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return AddAddressPage();
}),
);
},
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,
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,
),
),
),
),
@ -347,11 +354,11 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage>{
}
getAllAddress() {
print("ADDRESSES");
PharmacyAddressService service = new PharmacyAddressService();
service.getAddress(AppGlobal.context).then((res) {
print(res);
});
// print("ADDRESSES");
// PharmacyAddressService service = new PharmacyAddressService();
// service.getAddress(AppGlobal.context).then((res) {
// print(res);
// });
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.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';
@ -16,24 +17,23 @@ class OrderDetailsService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getOrderDetails(BuildContext context ) async {
List<OrderModel> get orderDetails => orderDetails;
List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
dynamic localRes;
String URL;
URL = GET_ORDER_DETAILS;
await baseAppClient.get(URL,
onSuccess: (response, statusCode) async {
localRes = response;
Future getOrderDetails(orderId) async {
print("step 1");
hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId,
onSuccess: (dynamic response, int statusCode) {
_orderList.clear();
response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
throw error;
hasError = true;
super.error = error;
});
return Future.value(localRes);
}
}

@ -5,34 +5,57 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
class OrderService extends BaseService{
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getOrder(BuildContext context ) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
dynamic localRes;
String URL;
URL = GET_ORDER;
await baseAppClient.get(URL,
onSuccess: (response, statusCode) async {
localRes = response;
List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList;
String url ="";
Future getOrder(custmerId, page_id) async {
print("step 1");
hasError = false;
url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId";
print(url);
await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) {
_orderList.clear();
response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item));
});
print(response);
}, onFailure: (String error, int statusCode) {
throw error;
hasError = true;
super.error = error;
});
return Future.value(localRes);
}
// Future<Map> getOrder(BuildContext context ) async {
//
// if (await this.sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(
// await this.sharedPref.getObject(USER_PROFILE));
// authUser = data;
// }
//
// dynamic localRes;
// String URL;
// URL = GET_ORDER;
//
// await baseAppClient.get(URL,
// onSuccess: (response, statusCode) async {
// localRes = response;
// }, onFailure: (String error, int statusCode) {
// throw error;
// });
// return Future.value(localRes);
// }
}

@ -5,36 +5,32 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart';
class PharmacyAddressService extends BaseService{
List<PharmacyAddressesModel> get address => address;
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getAddress(BuildContext context ) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
dynamic localRes;
String URL;
List<PharmacyAddressesModel> _addressList = List();
List<PharmacyAddressesModel> get reviewList => _addressList;
// URL = GET_ADDRESS+'272843?fields=addresses';
URL = GET_ADDRESS;
await baseAppClient.get(URL,
onSuccess: (response, statusCode) async {
localRes = response;
Future getAddress() async {
print("step 1");
hasError = false;
await baseAppClient.getPharmacy(GET_ORDER,
onSuccess: (dynamic response, int statusCode) {
_addressList.clear();
response['customers'].forEach((item) {
_addressList.add(PharmacyAddressesModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
throw error;
hasError = true;
super.error = error;
});
return Future.value(localRes);
}
}
}}

@ -760,6 +760,10 @@ class TranslationBase {
String get orderLog => localizedValues['OrderLog'][locale.languageCode];
// String get infoLab => localizedValues['info-lab'][locale.languageCode];
// String get infoRadiology => localizedValues['info-radiology'][locale.languageCode];
String get orderNumber => localizedValues['orderNumber'][locale.languageCode];
String get orderDate => localizedValues['orderDate'][locale.languageCode];
String get itemsNo => localizedValues['itemsNo'][locale.languageCode];
String get noOrder => localizedValues['noOrder'][locale.languageCode];
// pharmacy module
// String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode];

Loading…
Cancel
Save