Merge branch 'development' into pharmacy-Fatima

# Conflicts:
#	lib/pages/pharmacy/profile/profile.dart
merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
commit 0f22a50a5d

@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 28 compileSdkVersion 30
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cloud.diplomaticquarterapp" applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true

@ -68,12 +68,12 @@ class HMGUtils {
} }
} }
fun getGeoZonesFromPreference(context: Context):List<GeoZoneModel>{ fun getGeoZonesFromPreference(context: Context): List<GeoZoneModel> {
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
val json = pref.getString(PREF_KEY_HMG_ZONES,"[]") val json = pref.getString(PREF_KEY_HMG_ZONES,"[]")
val geoZones = GeoZoneModel().listFrom(json) val geoZones = json?.let { GeoZoneModel().listFrom(it) }
return geoZones return geoZones!!
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

@ -329,7 +329,7 @@ const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_ORDER = "orders?"; const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "epharmacy/api/orders/"; const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";

@ -177,6 +177,7 @@ const Map localizedValues = {
'ar': 'ابحث عن الدواء هنا' 'ar': 'ابحث عن الدواء هنا'
}, },
'description': {'en': 'Description', 'ar': 'الوصف'}, 'description': {'en': 'Description', 'ar': 'الوصف'},
'howToUse': {'en': 'How to Use', 'ar': 'طريقة الأستخدام'},
'price': {'en': 'Price', 'ar': 'السعر'}, 'price': {'en': 'Price', 'ar': 'السعر'},
'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'}, 'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'},
'pleaseEnterMedicineName': { 'pleaseEnterMedicineName': {

@ -29,6 +29,9 @@ class Orders {
int orderStatusId; int orderStatusId;
String orderStatus; String orderStatus;
String orderStatusn; String orderStatusn;
bool canCancel;
bool canRefund;
dynamic customerId;
Orders( Orders(
{this.id, {this.id,
@ -37,7 +40,10 @@ class Orders {
this.createdOnUtc, this.createdOnUtc,
this.orderStatusId, this.orderStatusId,
this.orderStatus, this.orderStatus,
this.orderStatusn}); this.orderStatusn,
this.canCancel,
this.canRefund,
this.customerId,});
Orders.fromJson(Map<String, dynamic> json) { Orders.fromJson(Map<String, dynamic> json) {
try { try {
@ -48,6 +54,9 @@ class Orders {
orderStatusId = json['order_status_id']; orderStatusId = json['order_status_id'];
orderStatus = json['order_status']; orderStatus = json['order_status'];
orderStatusn = json['order_statusn']; orderStatusn = json['order_statusn'];
canCancel = json['can_cancel'];
canRefund = json['can_refund'];
customerId = json['customer_id'];
}catch(e){ }catch(e){
print(e); print(e);
} }

@ -21,7 +21,7 @@ class PrescriptionService extends BaseService {
hasError = false; hasError = false;
url = PRESCRIPTION; url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url); print("Print PRESCRIPTION url" + url);
await baseAppClient.getPharmacy(url, await baseAppClient.get(url,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear(); _prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((item) { response['PatientPrescriptionList'].forEach((item) {

@ -18,15 +18,12 @@ import '../base_view_model.dart';
class OrderModelViewModel extends BaseViewModel { class OrderModelViewModel extends BaseViewModel {
OrderService _orderService = locator<OrderService>(); OrderService _orderService = locator<OrderService>();
List<Orders> get orders => _orderService.orderList; List<Orders> get orders => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>(); OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderListModel => _orderDetailsService.orderList;
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
CancelOrderService _cancelOrderService = locator<CancelOrderService>(); CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList; List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
@ -53,9 +50,9 @@ class OrderModelViewModel extends BaseViewModel {
} }
} }
Future getOrderDetails(orderId) async { Future getOrderDetails(OrderId) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(orderId); await _orderDetailsService.getOrderDetails(OrderId);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {
error = _orderDetailsService.error; error = _orderDetailsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -78,11 +78,19 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
), ),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return InkWell(
height: 2.0, onTap: (){
width: 10.0, setState(() {
child: Image.asset( currentTab = 0;
'assets/images/pharmacy_logo.png', pageController.jumpToPage(0);
});
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
), ),
); );
}, },
@ -135,6 +143,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [ children: [
// TODO mosa_comeback
PharmacyPage(), PharmacyPage(),
PharmacyCategorisePage(), PharmacyCategorisePage(),
// OffersCategorisePage(), // OffersCategorisePage(),

@ -32,7 +32,7 @@ class LoginType extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/DQ/dq_logo_icon.png', 'assets/images/DQ/logo.png',
height: 90, height: 90,
width: 90, width: 90,
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -36,7 +37,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset('assets/images/DQ/dq_logo_icon.png', Image.asset('assets/images/DQ/logo.png',
height: 90, width: 90), height: 90, width: 90),
Text( Text(
TranslationBase.of(context).welcome, TranslationBase.of(context).welcome,
@ -75,7 +76,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
LOGIN_TYPE, LOGIN_TYPE,
), ),
}, },
color: Color(0xFF40ACC9), color: Color(0xFFc5272c),
textColor: Colors.white, textColor: Colors.white,
)) ))
], ],

@ -279,6 +279,31 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(
child: Text(
languageID == 'ar'
? widget.product.shortDescriptionn
: widget.product.shortDescription,
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
),
),
SizedBox(
height: 10,
),
Container(
child: Text(
TranslationBase.of(context).howToUse,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
SizedBox(
height: 10,
),
Container( Container(
child: Text( child: Text(
languageID == 'ar' languageID == 'ar'

@ -19,26 +19,21 @@ class CartOrderPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
PreferredSizeWidget appBarWidget = final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppBarWidget(TranslationBase.of(context).shoppingCart, null, true);
final height = mediaQuery.size.height -
appBarWidget.preferredSize.height -
mediaQuery.padding.top;
return BaseView<OrderPreviewViewModel>( return BaseView<OrderPreviewViewModel>(
onModelReady: (model) => model.getOrderPreviewData(), onModelReady: (model) => model.getOrderPreviewData(),
builder: (_, model, wi) => ChangeNotifierProvider.value( builder: (_, model, wi) => ChangeNotifierProvider.value(
value: model.cartResponse, value: model.cartResponse,
child: AppScaffold( child: AppScaffold(
title: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
isPharmacy: true, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
appBarWidget: appBarWidget,
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null || body: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0) model.cartResponse.shoppingCarts.length == 0)
? Container( ? Container(
height: height * 0.85, height: height * 0.85,
width: double.infinity, width: double.infinity,
@ -179,7 +174,29 @@ class CartOrderPage extends StatelessWidget {
), ),
), ),
) )
: Container(), : Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'There is no data',
style: TextStyle(fontSize: 30),
),
)
],
),
),
bottomSheet: Container( bottomSheet: Container(
height: !(model.cartResponse.shoppingCarts == null || height: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0) model.cartResponse.shoppingCarts.length == 0)

@ -24,11 +24,9 @@ class OrderPreviewPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
PreferredSizeWidget appBarWidget =
AppBarWidget("${TranslationBase.of(context).checkOut}", null, true);
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - final height = mediaQuery.size.height -
appBarWidget.preferredSize.height - 60 -
mediaQuery.padding.top; mediaQuery.padding.top;
return BaseView<OrderPreviewViewModel>( return BaseView<OrderPreviewViewModel>(
@ -36,11 +34,10 @@ class OrderPreviewPage extends StatelessWidget {
builder: (_, model, wi) => ChangeNotifierProvider.value( builder: (_, model, wi) => ChangeNotifierProvider.value(
value: model.paymentCheckoutData, value: model.paymentCheckoutData,
child: AppScaffold( child: AppScaffold(
title: "${TranslationBase.of(context).checkOut}", appBarTitle: "${TranslationBase.of(context).checkOut}",
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
appBarWidget: appBarWidget,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(

@ -34,7 +34,6 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true);
languages.clear(); languages.clear();
languages.add(IdNamePair(1, TranslationBase.of(context).arabic)); languages.add(IdNamePair(1, TranslationBase.of(context).arabic));
languages.add(IdNamePair(2, TranslationBase.of(context).english)); languages.add(IdNamePair(2, TranslationBase.of(context).english));
@ -49,19 +48,18 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
return BaseView<LacumRegistrationViewModel>( return BaseView<LacumRegistrationViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: "Register Lakum", appBarTitle:
"${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}",
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBarWidget: appBarWidget,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
height: mediaQuery.size.height - height:
appBarWidget.preferredSize.height - mediaQuery.size.height - 60 - mediaQuery.padding.top,
mediaQuery.padding.top,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

@ -36,24 +36,22 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true);
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) => model.setLakumData( onModelReady: (model) => model.setLakumData(
widget.lacumInformation, widget.lacumGroupInformation), widget.lacumInformation, widget.lacumGroupInformation),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: "Lakum", appBarTitle: "${TranslationBase.of(context).lakum}",
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBarWidget: appBarWidget,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
height: mediaQuery.size.height - height: mediaQuery.size.height -
appBarWidget.preferredSize.height - 60 -
mediaQuery.padding.top, mediaQuery.padding.top,
child: _buildSettingScreen(mediaQuery, model), child: _buildSettingScreen(mediaQuery, model),
), ),

@ -32,17 +32,15 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true);
return BaseView<LacumTranferViewModel>( return BaseView<LacumTranferViewModel>(
onModelReady: (model) => model.setLakumData( onModelReady: (model) => model.setLakumData(
widget.lacumInformation, widget.lacumGroupInformation), widget.lacumInformation, widget.lacumGroupInformation),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: "Lakum", appBarTitle: "${TranslationBase.of(context).lakum}",
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBarWidget: appBarWidget,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
width: double.infinity, width: double.infinity,

@ -19,21 +19,14 @@ class LakumTermsConditions extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
final mediaQuery = MediaQuery.of(context);
PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true);
double height = mediaQuery.size.height -
appBarWidget.preferredSize.height -
mediaQuery.padding.top;
return BaseView<LacumRegistrationViewModel>( return BaseView<LacumRegistrationViewModel>(
onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(), onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: "Register Lakum", appBarTitle: "${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}",
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
appBarWidget: appBarWidget,
body: Container( body: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,

@ -28,7 +28,6 @@ class PharmacyPage extends StatelessWidget {
@override @override
void initState() { void initState() {
// print("model prescription " + model.prescriptionsList.length); // print("model prescription " + model.prescriptionsList.length);
// cancelOrderDetail(order) // cancelOrderDetail(order)
} }
@ -49,8 +48,8 @@ class PharmacyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
GridViewButtons(model), // GridViewButtons(model),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row( child: Row(
@ -78,179 +77,182 @@ class PharmacyPage extends StatelessWidget {
], ],
), ),
), ),
// model.getPrescription(),
Container( Container(
padding: padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
height: MediaQuery.of(context).size.height * 0.30, height: MediaQuery.of(context).size.height * 0.30,
// width: 200.0, // width: 200.0,
// height: MediaQuery.of(context).size.height / 4 + 20, // height: MediaQuery.of(context).size.height / 4 + 20,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getPrescription(),
builder: (_, model, wi) => model.prescriptionsList.length != 0
// model.getPrescription(); // model.getPrescription();
child: ListView.builder( ? ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
// itemCount: 4, // itemCount: 4,
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
// width: 160.0, // width: 160.0,
height: MediaQuery.of(context).size.height * 0.6, height: MediaQuery.of(context).size.height * 0.6,
padding: EdgeInsets.only(bottom: 5.0, left: 5.0), padding: EdgeInsets.only(bottom: 5.0, left: 5.0),
margin: EdgeInsets.only(right: 10.0), margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.grey, color: Colors.grey,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 1.0, width: 1.0,
), ),
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.0)), borderRadius: BorderRadius.circular(10.0)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Column(children: [ Column(children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.0, top: 10.0,
left: 10.0, left: 10.0,
right: 3.0, right: 3.0,
bottom: 15.0, bottom: 15.0,
), ),
child: Image.network( child: Image.network(
model.prescriptionsList[index] model.prescriptionsList[index]
.doctorImageURL, .doctorImageURL,
width: 60, width: 60,
height: 60, height: 60,
),
), ),
), ]),
]), Column(
Column(
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 1), margin: EdgeInsets.only(left: 1),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15.0, right: 15.0), left: 15.0, right: 15.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0,
),
color: Colors.green, color: Colors.green,
style: BorderStyle.solid, borderRadius:
width: 4.0, BorderRadius.circular(
30.0)),
child: Text(
model.prescriptionsList[index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
), ),
color: Colors.green, )),
borderRadius: Row(children: <Widget>[
BorderRadius.circular( Image.asset(
30.0)), 'assets/images/Icon-awesome-calendar.png',
child: Text( width: 30,
height: 30,
),
Text(
model.prescriptionsList[index] model.prescriptionsList[index]
.isInOutPatientDescription .appointmentDate
.toString(), .toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), ),
)), )
Row(children: <Widget>[ ]),
Image.asset( ],
'assets/images/Icon-awesome-calendar.png', ),
width: 30, ],
height: 30, ),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index]
.doctorTitle
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
), ),
Text( Text(
model.prescriptionsList[index] model.prescriptionsList[index]
.appointmentDate .doctorName
.toString(), .toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
// fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
)
]),
],
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index]
.doctorTitle
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
), ),
), ]),
Text( ),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index] model.prescriptionsList[index]
.doctorName .clinicDescription
.toString(), .toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.green,
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index]
.clinicDescription
.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
),
), ),
), ),
), ],
], ),
), Row(
Row( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Container(
Container( margin: EdgeInsets.only(left: 5),
margin: EdgeInsets.only(left: 5), child: Align(
child: Align( alignment: Alignment.topLeft,
alignment: Alignment.topLeft, child: RatingBar.readOnly(
child: RatingBar.readOnly(
// initialRating: productRate, // initialRating: productRate,
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star,
),
), ),
), )
) ]),
]), ]),
]), );
); })
}), : Container(),
),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row( child: Row(

@ -165,7 +165,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -378,7 +378,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -770,7 +770,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -987,7 +987,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -19,15 +20,15 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
dynamic languageID; dynamic languageID;
class OrderDetailsPage extends StatefulWidget { class OrderDetailsPage extends StatefulWidget {
Orders orderModel;
OrderModel orderDetails;
OrderDetailsPage({@required this.orderModel, this.orderDetails}); Orders orderModel;
OrderDetailsPage({@required this.orderModel});
// Orders orderModel;
// OrderModel orderModelDetails;
// OrderDetailsPage({@required this.orderModel, this.orderModelDetails});
@override @override
_OrderDetailsPageState createState() => _OrderDetailsPageState(); _OrderDetailsPageState createState() => _OrderDetailsPageState();
@ -39,9 +40,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
// AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
String orderId = "";
String customerId; String customerId;
List<OrderModel> orderList = []; List<OrderModel> ordersList = [];
List<OrderModel> cancelledOrderList = []; List<OrderModel> cancelledOrderList = [];
@ -59,6 +59,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
super.initState(); super.initState();
// print(widget.orderModel.orderItems.length); // print(widget.orderModel.orderItems.length);
getCancelOrder(widget.orderModel.id); getCancelOrder(widget.orderModel.id);
print("ID is"+widget.orderModel.id);
// cancelOrderDetail(order) // cancelOrderDetail(order)
} }
@ -110,8 +112,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
borderRadius: BorderRadius.circular(30.0)), borderRadius: BorderRadius.circular(30.0)),
child: Text( child: Text(
languageID == "ar" languageID == "ar"
? widget.orderModel.orderStatusn.toString(): ? model.orderListModel[0].orderStatusn.toString():
widget.orderModel.orderStatus.toString().substring(12) , model.orderListModel[0].orderStatus.toString().substring(12) ,
// TranslationBase.of(context).delivered, // TranslationBase.of(context).delivered,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -128,11 +130,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.orderDetails.shippingAddress.firstName model.orderListModel[0].shippingAddress.firstName
.toString() .toString()
.substring(10) + .substring(10) +
' ' + ' ' +
widget.orderDetails.shippingAddress.lastName model.orderListModel[0].shippingAddress.lastName
.toString() .toString()
.substring(9), .substring(9),
style: TextStyle( style: TextStyle(
@ -148,7 +150,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.orderDetails.shippingAddress.address1
model.orderListModel[0].shippingAddress.address1
.toString() .toString()
.substring(9), .substring(9),
style: TextStyle( style: TextStyle(
@ -165,14 +168,14 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.orderDetails.shippingAddress.address2 model.orderListModel[0].shippingAddress.address2
.toString() .toString()
.substring(9) + .substring(9) +
' ' + ' ' +
widget.orderDetails.shippingAddress.country model.orderListModel[0].shippingAddress.country
.toString() + .toString() +
' ' + ' ' +
widget.orderDetails.shippingAddress.zipPostalCode model.orderListModel[0].shippingAddress.zipPostalCode
.toString(), .toString(),
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
@ -195,7 +198,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container( Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text( child: Text(
widget.orderDetails.shippingAddress.phoneNumber model.orderListModel[0].shippingAddress.phoneNumber
.toString(), .toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
@ -234,7 +237,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
Container( Container(
child: flutterImage.Image.asset( child: flutterImage.Image.asset(
widget.orderDetails.shippingRateComputationMethodSystemName != model.orderListModel[0].shippingRateComputationMethodSystemName !=
"Shipping.Aramex" "Shipping.Aramex"
? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
@ -286,7 +289,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container( Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Text( child: Text(
widget.orderDetails.paymentName.toString().substring(12), model.orderListModel[0].paymentName.toString().substring(12),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -322,23 +325,23 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount:widget.orderDetails.orderItems.length, itemCount:model.orderListModel[0].orderItems.length,
itemBuilder: (context, index){ itemBuilder: (context, index){
return Container( return Container(
child: productTile(productName: widget.orderDetails.orderItems[index].product.name.toString(), child: productTile(productName: model.orderListModel[0].orderItems[index].product.name.toString(),
productPrice: widget.orderDetails.orderItems[index].product.price.toString(), productPrice: model.orderListModel[0].orderItems[index].product.price.toString(),
productRate: widget.orderDetails.orderItems[index].product.approvedRatingSum.toDouble(), productRate: model.orderListModel[0].orderItems[index].product.approvedRatingSum.toDouble(),
productReviews:widget.orderDetails.orderItems[index].product.approvedTotalReviews, productReviews:model.orderListModel[0].orderItems[index].product.approvedTotalReviews,
totalPrice: "${(widget.orderDetails.orderItems[index].product.price totalPrice: "${(model.orderListModel[0].orderItems[index].product.price
* widget.orderDetails.orderItems[index].quantity).toStringAsFixed(2)}", * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: widget.orderDetails.orderItems[index].quantity.toString(), qyt: model.orderListModel[0].orderItems[index].quantity.toString(),
isOrderDetails:true, isOrderDetails:true,
imgs: widget.orderDetails.orderItems[index].product.images != null && imgs: model.orderListModel[0].orderItems[index].product.images != null &&
widget.orderDetails.orderItems[index].product.images.length != 0 model.orderListModel[0].orderItems[index].product.images.length != 0
? widget.orderDetails.orderItems[index].product.images [0].src.toString() ? model.orderListModel[0].orderItems[index].product.images [0].src.toString()
: null, : null,
status: widget.orderDetails.orderStatusId, status: model.orderListModel[0].orderStatusId,
product: widget.orderDetails.orderItems[index].product, product: model.orderListModel[0].orderItems[index].product,
), ),
); );
}), }),
@ -387,7 +390,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderDetails.orderSubtotalExclTax.toString(), model.orderListModel[0].orderSubtotalExclTax.toString(),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -425,7 +428,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderDetails.orderShippingExclTax.toString(), model.orderListModel[0].orderShippingExclTax.toString(),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -463,7 +466,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderDetails.orderTax.toString(), model.orderListModel[0].orderTax.toString(),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -501,7 +504,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderModel.orderTotal.toString(), model.orderListModel[0].orderTotal.toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -512,7 +515,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
], ],
), ),
widget.orderModel.orderStatusId == 10 model.orderListModel[0].orderStatusId == 10
? InkWell( ? InkWell(
onTap: () { onTap: () {
model.makeOrder(); model.makeOrder();
@ -548,7 +551,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
? InkWell( ? InkWell(
onTap: () { onTap: () {
presentConfirmDialog(model, presentConfirmDialog(model,
widget.orderModel.id); //(widget.orderModel.id)); widget.orderModel.id);
// model.orderListModel[0].id//(widget.orderModel.id));
// //
}, },
child: Container( child: Container(
@ -595,17 +599,17 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
getCancelOrder(dataIsCancel) { getCancelOrder(dataIsCancel) {
if (widget.orderDetails.canCancel && widget.orderDetails.canRefund) { if (widget.orderModel.canCancel && widget.orderModel.canRefund) {
setState(() { setState(() {
isCancel = true; isCancel = true;
isRefund = false; isRefund = false;
}); });
} else if (widget.orderDetails.canCancel) { } else if (widget.orderModel.canCancel) {
setState(() { setState(() {
isCancel = true; isCancel = true;
isRefund = false; isRefund = false;
}); });
} else if (widget.orderDetails.canRefund) { } else if (widget.orderModel.canRefund) {
setState(() { setState(() {
isCancel = false; isCancel = false;
isRefund = true; isRefund = true;
@ -634,7 +638,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OrderPage( builder: (context) => OrderPage(
customerID: widget.orderDetails.customerId.toString())), // customerID: model.ordersList[0].customerId.toString()
customerID: widget.orderModel.customerId.toString())),
); );
}), }),
cancelFunction: () => {}); cancelFunction: () => {});
@ -643,7 +648,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
getCanceledOrder(order) { getCanceledOrder(order) {
Navigator.pop(context); Navigator.pop(context);
if (widget.orderDetails.canCancel && widget.orderDetails.canRefund == false) { if (widget.orderModel.canCancel && widget.orderModel.canRefund == false) {
// getCanceledOrder(order); // getCanceledOrder(order);
// AppToast.showSuccessToast(message: "Request Sent Successfully"); // AppToast.showSuccessToast(message: "Request Sent Successfully");
// Navigator.push(context, // Navigator.push(context,

@ -49,11 +49,9 @@ class _AddAddressPageState extends State<AddAddressPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
PreferredSizeWidget appBarWidget = AppBarWidget(
"${TranslationBase.of(context).changeAddress}", null, true);
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - final height = mediaQuery.size.height -
appBarWidget.preferredSize.height - 60 -
mediaQuery.padding.top; mediaQuery.padding.top;
return BaseView<PharmacyAddressesViewModel>( return BaseView<PharmacyAddressesViewModel>(
@ -62,7 +60,6 @@ class _AddAddressPageState extends State<AddAddressPage> {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBarWidget: appBarWidget,
body: Container( body: Container(
height: height * 1, height: height * 1,
child: PickupLocationFromMap( child: PickupLocationFromMap(

@ -12,14 +12,12 @@ import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
class PharmacyAddressesPage extends StatefulWidget { class PharmacyAddressesPage extends StatefulWidget {
@override @override
_PharmacyAddressesState createState() => _PharmacyAddressesState(); _PharmacyAddressesState createState() => _PharmacyAddressesState();
} }
class _PharmacyAddressesState extends State<PharmacyAddressesPage> { class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
void navigateToAddressPage( void navigateToAddressPage(
BuildContext ctx, PharmacyAddressesViewModel model, Addresses address) { BuildContext ctx, PharmacyAddressesViewModel model, Addresses address) {
Navigator.push( Navigator.push(
@ -31,12 +29,8 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
PreferredSizeWidget appBarWidget = AppBarWidget(
"${TranslationBase.of(context).changeAddress}", null, true);
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
appBarWidget.preferredSize.height -
mediaQuery.padding.top;
return BaseView<PharmacyAddressesViewModel>( return BaseView<PharmacyAddressesViewModel>(
onModelReady: (model) => model.getAddressesList(), onModelReady: (model) => model.getAddressesList(),
@ -46,7 +40,6 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
isPharmacy: true, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBarWidget: appBarWidget,
body: Container( body: Container(
height: height * 0.90, height: height * 0.90,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -115,8 +108,8 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
handler: () { handler: () {
model.saveSelectedAddressLocally( model.saveSelectedAddressLocally(
model.addresses[model.selectedAddressIndex]); model.addresses[model.selectedAddressIndex]);
Navigator.pop(context, Navigator.pop(
model.addresses[model.selectedAddressIndex]); context, model.addresses[model.selectedAddressIndex]);
}, },
), ),
), ),

File diff suppressed because it is too large Load Diff

@ -16,21 +16,20 @@ class OrderDetailsService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
// String url ="";
List<OrderModel> get orderDetails => orderDetails; // List<OrderModel> get orderDetails => ordeDetails;
List<OrderModel> _orderList = List(); List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList; List<OrderModel> get orderList => _orderList;
Future getOrderDetails(orderId) async { Future getOrderDetails(OrderId) async {
print("step 2" + orderId);
print("this is what i need"+GET_ORDER_DETAILS + orderId);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item)); _orderList.add(OrderModel.fromJson(item));
print(response);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -22,7 +22,7 @@ class OrderService extends BaseService{
hasError = false; 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=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=$pageId&limit=200&customer_id=$customerId"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count&page=$pageId&limit=200&customer_id=$customerId"; url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId";
print(url); print(url);
await baseAppClient.getPharmacy(url, await baseAppClient.getPharmacy(url,

@ -264,6 +264,7 @@ class TranslationBase {
localizedValues['pharmaciesList'][locale.languageCode]; localizedValues['pharmaciesList'][locale.languageCode];
String get description => localizedValues['description'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode];
String get howToUse => localizedValues['howToUse'][locale.languageCode];
String get price => localizedValues['price'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode];

@ -168,20 +168,28 @@ class LineChartCurvedState extends State<LineChartCurved> {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
try{
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;}
catch(e){
print(e);
}
}); });
return max.roundToDouble(); return max.roundToDouble();
} }
double getMinY() { double getMinY() {
double min = double.parse(widget.labResult[0].resultValue); double min = 0;
try{
min = double.parse(widget.labResult[0].resultValue);
widget.labResult.forEach((element) { widget.labResult.forEach((element) {
double resultValueDouble = double.parse(element.resultValue); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });}catch(e){
print(e);
}
int value = min.toInt(); int value = min.toInt();
return value.toDouble(); return value.toDouble();
@ -190,8 +198,14 @@ class LineChartCurvedState extends State<LineChartCurved> {
List<LineChartBarData> getData() { List<LineChartBarData> getData() {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
for (int index = 0; index < widget.labResult.length; index++) { for (int index = 0; index < widget.labResult.length; index++) {
try{
var resultValueDouble = double.parse(widget.labResult[index].resultValue); var resultValueDouble = double.parse(widget.labResult[index].resultValue);
spots.add(FlSpot(index.toDouble(), resultValueDouble)); spots.add(FlSpot(index.toDouble(), resultValueDouble));
}catch(e){
print(e);
spots.add(FlSpot(index.toDouble(), 0.0));
}
} }
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(

@ -77,7 +77,7 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[ children: <Widget>[
Container( Container(
child: child:
Image.asset('assets/images/DQ/DQ_logo.png'), Image.asset('assets/images/DQ/logo_big.png'),
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.imageSizeMultiplier * 4), SizeConfig.imageSizeMultiplier * 4),
), ),
@ -95,7 +95,7 @@ class _AppDrawerState extends State<AppDrawer> {
EdgeInsets.only(right: 0), EdgeInsets.only(right: 0),
child: Icon( child: Icon(
Icons.account_circle, Icons.account_circle,
color: Color(0xFF40ACC9), color: Color(0xFFc5272c),
size: 28, size: 28,
)), )),
Padding( Padding(
@ -105,7 +105,7 @@ class _AppDrawerState extends State<AppDrawer> {
user.firstName + user.firstName +
' ' + ' ' +
user.lastName, user.lastName,
color: Color(0xFF40ACC9), color: Color(0xFFc5272c),
)) ))
], ],
), ),
@ -124,7 +124,7 @@ class _AppDrawerState extends State<AppDrawer> {
": " + ": " +
user.patientID user.patientID
.toString(), .toString(),
color: Color(0xFF40ACC9), color: Color(0xFFc5272c),
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
1.5, 1.5,
@ -161,8 +161,8 @@ class _AppDrawerState extends State<AppDrawer> {
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).family, TranslationBase.of(context).family,
Icons.group, Icons.group,
textColor: Color(0xFF40ACC9), textColor: Color(0xFFc5272c),
iconColor: Color(0xFF40ACC9), iconColor: Color(0xFFc5272c),
bottomLine: false, bottomLine: false,
sideArrow: true, sideArrow: true,
), ),
@ -225,7 +225,7 @@ class _AppDrawerState extends State<AppDrawer> {
Icons Icons
.account_circle, .account_circle,
color: Color( color: Color(
0xFF40ACC9), 0xFFc5272c),
size: size:
24, 24,
), ),
@ -273,15 +273,15 @@ class _AppDrawerState extends State<AppDrawer> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Icon(Icons.account_circle, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), child: Icon(Icons.account_circle, color: result.responseID == user.patientID ? Color(0xFFc5272c) : Colors.black),
), ),
Expanded( Expanded(
flex: 7, flex: 7,
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 5, right: 5), padding: EdgeInsets.only(left: 5, right: 5),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFFc5272c) : Colors.black),
AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFFc5272c) : Colors.black),
]))), ]))),
], ],
)))) ))))

@ -46,7 +46,6 @@ class AppScaffold extends StatelessWidget {
final Color backgroundColor; final Color backgroundColor;
final double preferredSize; final double preferredSize;
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final PreferredSizeWidget appBarWidget;
final List<ImagesInfo> imagesInfo; final List<ImagesInfo> imagesInfo;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
@ -69,25 +68,18 @@ class AppScaffold extends StatelessWidget {
this.backgroundColor, this.backgroundColor,
this.preferredSize = 0.0, this.preferredSize = 0.0,
this.appBarIcons, this.appBarIcons,
this.appBarWidget,
this.image, this.image,
this.infoList, this.imagesInfo}); this.infoList, this.imagesInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
AppGlobal.context = context;
PreferredSizeWidget appBar;
return Scaffold( return Scaffold(
backgroundColor: backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar? AppBarWidget( appBar: isShowAppBar? AppBarWidget(
appBarTitle, appBarTitle:appBarTitle,
appBarIcons, appBarIcons:appBarIcons,
isShowAppBar,
isPharmacy: isPharmacy, isPharmacy: isPharmacy,
isShowDecPage: isShowDecPage, isShowDecPage: isShowDecPage,
image: image, image: image,
@ -95,22 +87,17 @@ class AppScaffold extends StatelessWidget {
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage) isShowDecPage)
? NotAutPage( ? NotAutPage(
title: appBarTitle, title: title ?? appBarTitle,
description: description, description: description,
infoList: infoList, infoList: infoList,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
) )
: baseViewModel != null : baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(), child: body,
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: buildBodyWidget(), : body,
bottomSheet: bottomSheet,
//floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
// floatingActionButton: FloatingSearchButton(),
); );
} }
@ -118,12 +105,6 @@ class AppScaffold extends StatelessWidget {
return isLoading ? AppLoaderWidget() : Container(); return isLoading ? AppLoaderWidget() : Container();
} }
buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[
body, /*FloatingSearchButton()*/
]);
}
} }
class AppBarWidget extends StatelessWidget with PreferredSizeWidget { class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
@ -132,13 +113,12 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
final String appBarTitle; final String appBarTitle;
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final bool isShowAppBar;
final bool isPharmacy; final bool isPharmacy;
final bool isShowDecPage; final bool isShowDecPage;
final String image; final String image;
AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar, AppBarWidget({this.appBarTitle, this.appBarIcons,
{this.isPharmacy = true, this.isShowDecPage = true, this.image}); this.isPharmacy = true, this.isShowDecPage = true, this.image});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -147,8 +127,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
Widget buildAppBar(BuildContext context) { Widget buildAppBar(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return isShowAppBar return AppBar(
? AppBar(
elevation: 0, elevation: 0,
backgroundColor: backgroundColor:
isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
@ -194,10 +173,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
), ),
if (appBarIcons != null) ...appBarIcons if (appBarIcons != null) ...appBarIcons
], ],
)
: Container(
height: 0,
width: 0,
); );
} }

Loading…
Cancel
Save