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

merge-requests/472/head
haroon amjad 4 years ago
commit fa5fd8e323

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -760,6 +760,8 @@ const Map localizedValues = {
"location-permission": {"en": "Location", "ar": "تحديد المواقع"},
"needPrescription": {"en": "This product requires a prescription", "ar": " هذا المنتج يتطلب وصفة طبية"},
"outOfStockMsg": {"en": "You have added product which is out of stock now, Please remove that!", "ar": "لقد قمت بإضافة المنتج الذي نفذ من المخزون الآن. يرجى إزالة ذلك"},
"noArabicLetters": {"en": "It Is Not Allow to Use Arabic Letters", "ar": "غير مسموح باستخدام الحروف العربيه"},
"noOffersAvailable": {"en": "No Offers Available!", "ar": "لايوجد عروض حاليا"},
"accessibility": {"en": "Accessibility Mode", "ar": "وضع امكانية الوصول"},
"orderStatus": {"en": "Order Status", "ar": "حالة الطلب"},
"CancelOrder": {"en": "Cancel Order", "ar": "الغاء الطلب"},

@ -431,6 +431,7 @@ class BaseAppClient {
}
print("URL : $url");
var ss = json.encode(queryParams);
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {

@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Country.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import '../../../locator.dart';
@ -75,13 +77,17 @@ class PharmacyAddressesViewModel extends BaseViewModel {
sendingAddress.createdOnUtc = DateTime.now().toString();
if (editedAddress == null) {
///TODO Fatima*
await _pharmacyAddressService.addCustomerAddress(sendingAddress);
} else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress);
}
if (_pharmacyAddressService.hasError) {
error = _pharmacyAddressService.error;
Utils.showErrorToast(error);
setState(ViewState.Error);
} else {
setState(ViewState.Idle);

@ -120,43 +120,54 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
],
),
),
InkWell(
onTap: () async {
await model.deleteBabyOrders(newChild: deleteBaby);
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Icon(
Icons.arrow_forward,
size: 18,
),
mHeight(12),
InkWell(
onTap: () async {
await model.deleteBabyOrders(newChild: deleteBaby);
deleteBaby.babyID = model.babyInformationModelList[index].babyID;
deleteBaby.babyID = model.babyInformationModelList[index].babyID;
await model.deleteBabyOrders(newChild: deleteBaby);
if (model.isDeleted) {
AppToast.showSuccessToast(message: TranslationBase.of(context).recordDeleted);
Navigator.pop(context, model.isDeleted);
} else {
//TODO handling error
}
},
child: Container(
decoration: containerRadius(Colors.grey.withOpacity(0.2), 2000),
padding: EdgeInsets.only(left: 12, right: 12, top: 8, bottom: 8),
child: Row(
children: [
Image.asset(
'assets/images/new-design/garbage.png',
width: 16,
color: selectedColor,
),
mWidth(8),
Text(
TranslationBase.of(context).deleteView,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
letterSpacing: -0.33,
color: selectedColor,
),
await model.deleteBabyOrders(newChild: deleteBaby);
if (model.isDeleted) {
AppToast.showSuccessToast(message: TranslationBase.of(context).recordDeleted);
Navigator.pop(context, model.isDeleted);
} else {
//TODO handling error
}
},
child: Container(
decoration: containerRadius(Colors.grey.withOpacity(0.2), 2000),
padding: EdgeInsets.only(left: 12, right: 12, top: 8, bottom: 8),
child: Row(
children: [
Image.asset(
'assets/images/new-design/garbage.png',
width: 16,
color: selectedColor,
),
mWidth(8),
Text(
TranslationBase.of(context).deleteView,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
letterSpacing: -0.33,
color: selectedColor,
),
),
],
),
],
),
),
),
],
),
],
),

@ -3,7 +3,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -198,7 +198,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
vertical: 1,
// vertical: 2,
),
child: Container(
decoration: BoxDecoration(
@ -210,11 +211,17 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
color: Colors.white,
),
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
horizontal: 4,
),
width: MediaQuery.of(context).size.width / 3,
// width: MediaQuery.of(context)
// .size
// .width /
// 1,
// height: MediaQuery.of(context)
// .size
// .width /
// 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
@ -224,7 +231,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
children: [
Container(
margin: EdgeInsets
.fromLTRB(0, 16,
.fromLTRB(0, 1,
0, 0),
alignment: Alignment
.center,
@ -242,10 +249,68 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
height: 70,
),
),
Container(
// Container(
// width: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 2.8
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
// ),
// child: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? Texts(
// languageID ==
// 'ar'
// ? model
// .finalProducts[
// index]
// .rxMessagen
// : model
// .finalProducts[index]
// .rxMessage,
// color: Colors
// .white,
// regular:
// true,
// fontSize:
// 10,
// fontWeight:
// FontWeight
// .w600,
// )
// : Texts(""),
// ),
],
),
Container(
margin: EdgeInsets
.symmetric(
horizontal: 0,
vertical: 2,
),
width: model
.finalProducts[
index]
@ -255,19 +320,18 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
context)
.size
.width /
2.8
2.0
: 0,
padding:
EdgeInsets.all(
4),
EdgeInsets.fromLTRB(8,4,8,4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius
.circular(
6)),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
),
child: model
.finalProducts[
@ -296,8 +360,6 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
)
: Texts(""),
),
],
),
Container(
margin: EdgeInsets
.symmetric(
@ -439,205 +501,268 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
(BuildContext context, int index) {
return InkWell(
child: Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
left: 9.0,
top: 8.0,
right: 10.0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
left: 2.0,
top: 2.0,
right: 2.0,
),
),
),
),
Container(
margin: EdgeInsets
.fromLTRB(
0, 0, 0, 0),
alignment: Alignment
.center,
child:
Image.network(
model
.finalProducts[
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit
.contain,
height: 80,
Container(
// margin: EdgeInsets
// .fromLTRB(
// 8, 0, 8, 0),
alignment: Alignment
.center,
child:
Image.network(
model
.finalProducts[
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit
.contain,
height: 70,
),
),
),
],
],
),
// Column(
// children: [
// Container(
// width: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 5.3
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
// ),
// child: Texts(
// model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? model
// .finalProducts[
// index]
// .rxMessage
// : "",
// color:
// Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w600,
// ),
// ),
// ],
// ),
],
),
Container(
height: 130.0,
margin:
EdgeInsets.symmetric(
horizontal: 0,
vertical: 6,
),
Column(
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Container(
margin: EdgeInsets
.symmetric(
horizontal: 4,
vertical: 0,
),
width: model
.finalProducts[
index]
.rxMessage !=
null
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5.3
context)
.size
.width /
2.0
: 0,
padding:
EdgeInsets.all(
4),
EdgeInsets.all(
4),
decoration:
BoxDecoration(
BoxDecoration(
color: Color(
0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius
.circular(
6)),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
),
child: model
.finalProducts[
index]
.rxMessage !=
null
? Texts(
languageID ==
'ar'
? model
.finalProducts[
index]
.rxMessagen
: model
.finalProducts[index]
.rxMessage,
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w600,
)
: Texts(""),
),
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color:
Colors.white,
.finalProducts[
index]
.name,
regular: true,
fontSize: 10,
fontSize: 13.2,
fontWeight:
FontWeight
.w600,
FontWeight.w500,
maxLines: 5,
),
),
],
),
],
),
Container(
height: 100.0,
margin:
EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
model
.finalProducts[
index]
.name,
regular: true,
fontSize: 13.2,
fontWeight:
FontWeight.w500,
maxLines: 5,
SizedBox(
height: 8.0,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
),
),
),
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum.toDouble() /
model.finalProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
],
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum.toDouble() /
model.finalProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
],
),
),
),
widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(Icons.shopping_cart,
size: 18,
color: Colors.blue,),
onPressed: () async {
if(model.finalProducts[index].rxMessage == null){
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
FadePage(page: CartOrderPage()));
widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(Icons.shopping_cart,
size: 18,
color: Colors.blue,),
onPressed: () async {
if(model.finalProducts[index].rxMessage == null){
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
FadePage(page: CartOrderPage()));
}
else{
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
else{
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
//
}
}
),
):Container(),
],
),
):Container(),
],
),
),
),
onTap: () => {

@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';

@ -78,18 +78,18 @@ class _LiveCarePatmentPageState extends State<ClinicTimingsPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
flex: 2,
child: Text(
item.dayOfWeekStr,
style: TextStyle(
fontSize: 13,
letterSpacing: -0.42,
fontWeight: FontWeight.w600,
fontSize: 18,
letterSpacing: -0.72,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
flex: 3,
flex: 4,
child: Container(
width: double.infinity,
decoration: cardRadius(12),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/viewModels/offers_Categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
@ -698,9 +699,31 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
),
)
: Center(
child: Texts(
"SORRY , there's no listed offers now :(",
color: Colors.green,
))));
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(TranslationBase.of(context).noOffersAvailable,
// 'There is no data',
style: TextStyle(fontSize: 30),
),
)
],
),
// child: Texts(
// "SORRY , there's no listed offers now :(",
// color: Colors.green,
// )
)));
}
}

@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -1031,7 +1031,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
height: 70,
),
),
],
@ -1086,7 +1086,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 0,
vertical: 0,
),
child: Column(

@ -19,7 +19,7 @@ import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:provider/provider.dart';
import 'cart-page/cart-order-preview.dart';
import 'cart-order-preview.dart';
class CartOrderPage extends StatefulWidget {
@ -421,7 +421,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
fontSize: 14),
),
color: Color(0xFF4CAF50),
disabledColor:Color(0xFF4CAF50),
disabledColor:Color(0xFF848484),
// disabledColor: Color(0xff005aff),
)
// RaisedButton(

@ -53,9 +53,10 @@ class _PharmacyPageState extends State<PharmacyPage> {
children: <Widget>[
BannerPager(model),
PrescriptionsWidget(),
ShopByBrandWidget(),
// ShopByBrandWidget(),
RecentlyViewedWidget(),
BestSellerWidget(),
ShopByBrandWidget(),
],
),
),

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -128,92 +128,104 @@ class _FooterWidgetState extends State<FooterWidget> {
: Container(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 70,
height: 50,
child: FlatButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 4,
child: Text(
widget.quantity.toString(),
style: TextStyle(fontSize: 20),
Container(
height: 58,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 90,
height: 60,
child: FlatButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 4,
child: Text(
widget.quantity.toString(),
style: TextStyle(fontSize: 20),
),
),
),
Expanded(
flex: 5,
child: Text(
TranslationBase.of(context).quantityShortcut,
style: TextStyle(fontSize: 16),
Expanded(
flex: 5,
child: Text(
TranslationBase.of(context).quantityShortcut,
style: TextStyle(fontSize: 16),
),
),
),
],
],
),
onPressed: () {
setState(() {
if (showUI) {
quantityUI = 80;
showUI = false;
} else {
quantityUI = 160;
showUI = true;
}
});
},
),
onPressed: () {
setState(() {
if (showUI) {
quantityUI = 80;
showUI = false;
} else {
quantityUI = 160;
showUI = true;
}
});
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.45,
child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
},
fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50),
borderRadius: 3,
color: Color(0xFF4CAF50),
SizedBox(
width: 10,
),
),
SizedBox(
width: 5,
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
onTap: () async {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
Navigator.push(
context,
FadePage(page: CartOrderPage()),
);
},
fontWeight: FontWeight.w600,
borderColor: Colors.grey[800],
borderRadius: 3,
disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null ? Colors.grey : Colors.grey[800],
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
},
fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50),
borderRadius: 3,
color: Color(0xFF4CAF50),
),
),
SizedBox(
width: 5,
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
Navigator.push(
context,
FadePage(page: CartOrderPage()),
);}
},
fontWeight: FontWeight.w600,
borderColor: Colors.grey[800],
borderRadius: 3,
disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null ? Colors.grey : Colors.grey[800],
),
),
),
],
],
),
),
],
),
);
}

@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart';

@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -79,7 +79,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
borderRadius: BorderRadius.circular(15),
),
padding: EdgeInsets.only(left: 5, right: 4.5),
height: 18,
height: 19,
child: Center(
child: Texts(
orderPreviewViewModel.cartResponse.quantityCount.toString(),

@ -1,11 +1,14 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class SearchBrandsPage extends StatefulWidget {
@override
@ -23,7 +26,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
onModelReady: (model) => model.searchProducts(),
builder: (BuildContext context, model, Widget child) =>
PharmacyAppScaffold(
appBarTitle: 'Search',
appBarTitle: TranslationBase.of(context).search,
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
@ -44,24 +47,36 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
key: _formKey,
child: TextFields(
autoFocus: true,
hintText: 'Search',
hintText: TranslationBase.of(context).search,
fontSize: 19.0,
prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny(RegExp("[\u0621-\u064a-\ ]"))
],
validator: (value) {
RegExp regExp = RegExp('[\u0621-\u064a-\ ]');
if (value.isEmpty) {
TranslationBase.of(context).pleaseEnterProductName;
}else if (regExp.hasMatch(value)){
AppToast.showErrorToast(message: TranslationBase.of(context).noArabicLetters);
}
return null;
},
onSaved: (value) {
//searchMedicine(model, context);
},
onSubmit: (value) {
searchMedicine(model, context);
msg = 'No Result Found';
msg = TranslationBase.of(context).noResultFound;
},
controller: textController,
validator: (value) {
if (value.isEmpty) {
return 'please Enter Product Name';
}
return null;
},
// validator: (value) {
// if (value.isEmpty) {
// return 'please Enter Product Name';
// }
// return null;
// },
),
),
),
@ -70,7 +85,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
),
InkWell(
child: Texts(
'Cancel',
TranslationBase.of(context).cancel,
fontSize: 17.0,
fontWeight: FontWeight.w500,
),

@ -86,7 +86,7 @@ class ProductTileItem extends StatelessWidget {
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
? Image.network(
@ -100,17 +100,42 @@ class ProductTileItem extends StatelessWidget {
height: itemHeight / 2,
),
),
Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
// Container(
// width: item.rxMessage != null
// ? MediaQuery.of(context).size.width / 5
// : 0,
// padding: EdgeInsets.all(4),
// decoration: BoxDecoration(
// color: Color(0xffb23838),
// borderRadius:
// BorderRadius.only(topLeft: Radius.circular(6)),
// ),
// child: item.rxMessage != null
// ? Texts(
// projectProvider.isArabic
// ? item.rxMessagen
// : item.rxMessage,
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// )
// : Texts(""),
// )
],
),
Padding(
padding: EdgeInsets.fromLTRB(4,2,4,2),
child: Container(
// width: item.rxMessage != null
// ? MediaQuery.of(context).size.width / 5
// : 0,
// padding: EdgeInsets.fromLTRB(6,4,6,4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: item.rxMessage != null
child: item.rxMessage != null
? Texts(
projectProvider.isArabic
? item.rxMessagen
@ -121,12 +146,11 @@ class ProductTileItem extends StatelessWidget {
fontWeight: FontWeight.w400,
)
: Texts(""),
)
],
),
SizedBox(height: 8,),
),
),
// SizedBox(height: 4,),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6.0),
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Texts(
projectProvider.isArabic ? item.namen : item.name,
regular: true,
@ -137,7 +161,7 @@ class ProductTileItem extends StatelessWidget {
Expanded(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 4,
vertical: 0,
),
child: Column(
@ -145,7 +169,7 @@ class ProductTileItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
padding: const EdgeInsets.only(top: 2, bottom: 2),
child: Texts(
"SAR ${item.price}",
fontWeight: FontWeight.w600,

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart';
@ -11,6 +13,10 @@ import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class PrescriptionsWidget extends StatelessWidget {
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionViewModel>(
@ -20,7 +26,7 @@ class PrescriptionsWidget extends StatelessWidget {
}
},
allowAny: true,
builder: (_, model, wi) => model.prescriptionsList.length > 0
builder: (_, model, wi) => model.prescriptionsList.length > 0 && authenticatedUserObject.isLogin
? NetworkBaseView(
isLocalLoader: true,
baseViewModel: model,
@ -30,7 +36,7 @@ class PrescriptionsWidget extends StatelessWidget {
ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
Container(
margin: EdgeInsets.only(right: 10.0, left: 10.0),
height: MediaQuery.of(context).size.height * 0.18,
height: MediaQuery.of(context).size.height * 0.28,
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
@ -57,7 +63,7 @@ class PrescriptionsWidget extends StatelessWidget {
top: 10.0,
left: 10.0,
right: 10.0,
bottom: 15.0,
bottom: 10.0,
),
child: CircleAvatar(
radius: 30,
@ -79,7 +85,7 @@ class PrescriptionsWidget extends StatelessWidget {
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0,
width: 3.0,
),
color: Colors.green,
borderRadius: BorderRadius.circular(30.0)),
@ -179,7 +185,8 @@ class PrescriptionsWidget extends StatelessWidget {
),
),
)
: Container(),
: Container(
),
);
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
// import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -10,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'base/base_view.dart';
@ -55,6 +58,22 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
fontSize: 14.5,
prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny(
RegExp("[\u0621-\u064a-\ ]"))
],
validator: (value) {
RegExp regExp = RegExp('[\u0621-\u064a-\ ]');
if (value.isEmpty) {
TranslationBase.of(context)
.pleaseEnterProductName;
} else if (regExp.hasMatch(value)) {
AppToast.showErrorToast(
message: TranslationBase.of(context)
.noArabicLetters);
}
return null;
},
onSaved: (value) {
//searchMedicine(model, context);
},
@ -64,13 +83,13 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
msg = TranslationBase.of(context).noResultFound;
},
controller: textController,
validator: (value) {
if (value.isEmpty) {
// return 'please Enter Product Name';
return TranslationBase.of(context).pleaseEnterProductName;
}
return null;
},
// validator: (value) {
// if (value.isEmpty) {
//// return 'please Enter Product Name';
// return TranslationBase.of(context).pleaseEnterProductName;
// }
// return null;
// },
),
),
),

@ -3,7 +3,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -987,9 +987,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
],
),
Container(
height: 100.0,
height: 130.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 0,
vertical: 0,
),
child: Column(

@ -1767,6 +1767,10 @@ class TranslationBase {
String get outOfStockMsg => localizedValues['outOfStockMsg'][locale.languageCode];
String get noArabicLetters => localizedValues['noArabicLetters'][locale.languageCode];
String get noOffersAvailable => localizedValues['noOffersAvailable'][locale.languageCode];
String get requestID => localizedValues['requestID'][locale.languageCode];
String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode];

@ -1,6 +1,6 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';

Loading…
Cancel
Save