Merge branch 'development_new_design_2.0' into Fatima-New-Design

# Conflicts:
#	lib/pages/pharmacies/screens/product-details/product-name-and-price.dart
merge-requests/551/head
Fatimah Alshammari 3 years ago
commit 169ebac076

@ -546,8 +546,8 @@ const SUBSCRIBE_PRODUCT = "subscribe?";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "deletecustomeraddress";
const GET_ADDRESS = "Customers/";
const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";

@ -1734,4 +1734,7 @@ const Map localizedValues = {
"points": {"en": "Points", "ar": "نقاط"},
"availableBalance": {"en": "Available Balance", "ar": "الرصيد المتوفر"},
"ordersDashboard": {"en": "My Orders", "ar": "طلباتي"},
"productOutOfStock": {"en": "Out Of Stock", "ar": "إنتهى من المخزن"},
"productQuantity": {"en": "Quantity", "ar": "كمية"},
};

@ -66,12 +66,12 @@ class CustomerAddressesService extends BaseService {
class CustomerInfo {
bool isRegistered;
String userName;
dynamic userName;
dynamic password;
String email;
dynamic email;
dynamic errorMessage;
String mobileNumber;
int customerId;
dynamic mobileNumber;
dynamic customerId;
CustomerInfo({this.isRegistered, this.userName, this.password, this.email, this.errorMessage, this.mobileNumber, this.customerId});
@ -104,7 +104,7 @@ class AddressInfo {
String lastName;
String email;
dynamic company;
int countryId;
dynamic countryId;
String country;
dynamic stateProvinceId;
String city;

@ -75,7 +75,6 @@ class PharmacyAddressesViewModel extends BaseViewModel {
sendingAddress.faxNumber = user.faxNumber;
sendingAddress.customerAttributes = "";
sendingAddress.createdOnUtc = DateTime.now().toString();
if (editedAddress == null) {
///TODO Fatima*
@ -83,15 +82,21 @@ class PharmacyAddressesViewModel extends BaseViewModel {
} else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress);
}
if (_pharmacyAddressService.hasError) {
error = _pharmacyAddressService.error;
Utils.showErrorToast(error);
setState(ViewState.Error);
await _pharmacyAddressService.getAddresses();
setState(ViewState.Idle);
// setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future deleteAddresses(AddressInfo sendingAddress) async {

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart';
import '../../../../../locator.dart';
@ -28,8 +29,13 @@ class FooterWidget extends StatefulWidget {
int quantity;
bool isOverQuantity;
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item,
{this.quantity, this.isOverQuantity = false, this.addToCartFunction, this.addToShoppingCartFunction, this.model});
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity,
this.quantityLimit, this.item,
{this.quantity,
this.isOverQuantity = false,
this.addToCartFunction,
this.addToShoppingCartFunction,
this.model});
@override
_FooterWidgetState createState() => _FooterWidgetState();
@ -38,7 +44,8 @@ class FooterWidget extends StatefulWidget {
class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80;
bool showUI = false;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences();
@override
@ -74,7 +81,8 @@ class _FooterWidgetState extends State<FooterWidget> {
padding: const EdgeInsets.all(8.0),
child: Text(
TranslationBase.of(context).quantity,
style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle(
fontSize: 15, fontWeight: FontWeight.bold),
),
),
InkWell(
@ -97,7 +105,11 @@ class _FooterWidgetState extends State<FooterWidget> {
SizedBox(
width: 5,
),
for (int i = 1; i <= 10; i++) QuantityBox(label: i, onTapFunc: onChangeValue, isSelected: widget.quantity == i),
for (int i = 1; i <= 10; i++)
QuantityBox(
label: i,
onTapFunc: onChangeValue,
isSelected: widget.quantity == i),
Container(
width: 100,
decoration: BoxDecoration(
@ -105,14 +117,16 @@ class _FooterWidgetState extends State<FooterWidget> {
color: Colors.white,
),
child: TextField(
decoration: InputDecoration(labelText: ' Quantity # '),
decoration: InputDecoration(
labelText: ' Quantity # '),
onChanged: (text) {
if (int.tryParse(text) == null) {
text = '';
} else {
setState(() {
widget.quantity = int.parse(text);
if (widget.quantity >= widget.quantityLimit) {
if (widget.quantity >=
widget.quantityLimit) {
widget.isOverQuantity = true;
} else {
widget.isOverQuantity = false;
@ -133,31 +147,50 @@ class _FooterWidgetState extends State<FooterWidget> {
height: 20,
),
Container(
height: 55,
height: 58,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 90,
height: 60,
child: FlatButton(
child: Column(
child: Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Text(
AppText(
TranslationBase.of(context).productQuantity,
fontSize: 10,
),
Row(
children: [
AppText(
widget.quantity.toString(),
style: TextStyle(fontSize: 20),
fontSize: 16,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
),
Expanded(
flex: 5,
child: Text(
TranslationBase.of(context).quantityShortcut,
style: TextStyle(fontSize: 16),
Icon(Icons.keyboard_arrow_down,color: Color(0xFF2E303A),size: 25,)
],
),
],
),
SizedBox(
width: 10,
),
SizedBox(
height: 40,
width: 1,
child: Container(
color: Color(0xFFEFEFEF),
),
),
],
@ -184,17 +217,22 @@ class _FooterWidgetState extends State<FooterWidget> {
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,
disabled: (!widget.isAvailable && widget.quantity > 0) ||
widget.quantity > widget.quantityLimit ||
widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
login();
} else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
await widget.addToCartFunction(
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
},
fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50),
borderRadius: 3,
color: Color(0xFF4CAF50),
borderColor: Color(0xFF4CAF50).withOpacity(0.7),
borderRadius: 6,
color: Color(0xFF5AB145).withOpacity(0.7),
),
),
SizedBox(
@ -204,19 +242,28 @@ class _FooterWidgetState extends State<FooterWidget> {
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,
disabled: (!widget.isAvailable && widget.quantity > 0) ||
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
login();
} else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
await widget.addToShoppingCartFunction(
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
}
},
fontWeight: FontWeight.w600,
borderColor: Colors.grey[800],
borderRadius: 3,
borderColor: Colors.grey[800].withOpacity(0.7),
borderRadius: 6,
disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.isRx ? Colors.grey : Colors.grey[800],
color: !widget.isAvailable && widget.quantity > 0 ||
widget.quantity > widget.quantityLimit ||
widget.item.isRx
? Color(0xFF535353).withOpacity(0.7)
: Colors.grey[800],
),
),
],
@ -239,7 +286,9 @@ class _FooterWidgetState extends State<FooterWidget> {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
authService
.selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);

@ -13,6 +13,7 @@ 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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -121,13 +122,40 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Column(
children: [
if (widget.product.images.isNotEmpty)
Stack(
children: [
Container(
height: MediaQuery.of(context).size.height * .40,
child: Center(
child: Image.network(
widget.product.images[0].src.trim(),
fit: BoxFit.contain,
),
),
),
if(model.isStockAvailable!= null && !model.isStockAvailable)
Container(
height: MediaQuery.of(context).size.height * .40,
color: Colors.white.withOpacity(0.75),
// child: AppText("Out of Stock"),
),
if(model.isStockAvailable!= null && !model.isStockAvailable)
Positioned(
// bottom: 10,
top: MediaQuery.of(context).size.height *.088,
left: MediaQuery.of(context).size.width *.32,
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * .40,
// color: Colors.white.withOpacity(0.75),
child: RotationTransition(
turns: new AlwaysStoppedAnimation(310 / 360),
child: AppText(TranslationBase.of(context).productOutOfStock ,color:Color(0xFF000000).withOpacity(0.1),fontSize: projectViewModel.isArabic?40: 50, fontWeight: FontWeight.bold ,)),
),
),
),
],
),
if (widget.product.discountDescription != null) DiscountDescription(product: widget.product)
],
),
@ -251,7 +279,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Column(
children: [
FlatButton(
onPressed: model.isStockAvailable
onPressed: model.isStockAvailable !=null && model.isStockAvailable
? () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getProductLocationData(widget.product.sku);

@ -23,10 +23,17 @@ class ProductNameAndPrice extends StatefulWidget {
final bool isStockAvailable;
final String stockAvailability;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
ProductNameAndPrice(this.context, this.item,
{this.customerId, this.isInWishList, this.notifyMeWhenAvailable, this.addToWishlistFunction, this.deleteFromWishlistFunction, this.isStockAvailable = true, this.stockAvailability});
{this.customerId,
this.isInWishList,
this.notifyMeWhenAvailable,
this.addToWishlistFunction,
this.deleteFromWishlistFunction,
this.isStockAvailable = true,
this.stockAvailability});
@override
_ProductNameAndPriceState createState() => _ProductNameAndPriceState();
@ -66,17 +73,19 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
),
),
Text(
projectViewModel.isArabic ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(),
style: TextStyle(color: Colors.white,
projectViewModel.isArabic
? widget.item.rxMessagen.toString()
: widget.item.rxMessage.toString(),
style: TextStyle(
color: Colors.white,
// regular: true,
fontSize: 17,
fontWeight: FontWeight.w600, letterSpacing:-0.68
fontWeight: FontWeight.w600,
letterSpacing:-0.68
// textAlign: TextAlign.center,
)
),
)),
],
)
)
))
: Container(),
FractionallySizedBox(
widthFactor: 0.93,
@ -84,9 +93,11 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20),
if (widget.stockAvailability != null)
Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0),
padding: EdgeInsets.only(left: 11, right: 11,),
padding: EdgeInsets.only(
left: 11.0, right: 11.0, top: 0, bottom: 0),
decoration: BoxDecoration(
border: Border.all(
color: getStatusBackgroundColor(),
@ -95,32 +106,51 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
),
color: getStatusBackgroundColor(),
borderRadius: BorderRadius.circular(30.0)),
// child: Text(
// widget.stockAvailability,
// style: TextStyle(
// fontWeight: FontWeight.w600,
// fontSize: 11,
// color: Color(0xffFFFFFF),
// ),
// color: getStatusBackgroundColor(),
// borderRadius: BorderRadius.circular(30.0)),
child: Text(
widget.stockAvailability,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),letterSpacing:-0.44),
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),letterSpacing:-0.44)),
//color: widget.isStockAvailable ? Colors.white : Colors.red,
),
),
// SizedBox(width: 20),
if (widget.authenticatedUserObject.isLogin)
!widget.isStockAvailable && widget.customerId != null
// if (
widget.authenticatedUserObject.isLogin &&
widget.stockAvailability != null &&
!widget.isStockAvailable &&
widget.customerId != null
? IconButton(
iconSize: 25,
icon: Icon(Icons.notifications_active),
color: new Color(0xff2E303A),
onPressed: ()
{ widget.notifyMeWhenAvailable(context, widget.item.id);},
): IconButton(
icon: Icon(!widget.isInWishList ? Icons.favorite_border : Icons.favorite),
color: !widget.isInWishList ? Color(0xff2E303A) : Color(0xffD02127),
onPressed: () {
widget.notifyMeWhenAvailable(
context, widget.item.id);
},
)
: IconButton(
icon: Icon(!widget.isInWishList
? Icons.favorite_border
: Icons.favorite),
color: !widget.isInWishList
? Color(0xff2E303A)
: Color(0xffD02127),
onPressed: () async {
{
if (widget.customerId != null) {
if (!widget.isInWishList) {
await widget.addToWishlistFunction(widget.item.id);
await widget
.addToWishlistFunction(widget.item.id);
} else {
await widget.deleteFromWishlistFunction(widget.item.id);
await widget.deleteFromWishlistFunction(
widget.item.id);
}
} else {
return;
@ -177,31 +207,45 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
),
),
Padding(
padding: const EdgeInsets.only(left: 8,right: 8, top: 1, bottom: 12),
padding:
const EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 12),
child: Container(
margin: EdgeInsets.only(left: 10, right: 10),
child: Align(
alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft,
alignment: projectViewModel.isArabic
? Alignment.topRight
: Alignment.topLeft,
child: Text(
projectViewModel.isArabic ? widget.item.namen : widget.item.name,
style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16, letterSpacing:-0.96),
projectViewModel.isArabic
? widget.item.namen
: widget.item.name,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
letterSpacing: -0.96),
),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: Container(
margin: EdgeInsets.only(left: 10, right: 10),
child: Align(
alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft,
child: Text( TranslationBase.of(context).sar+ " " +
alignment: projectViewModel.isArabic
? Alignment.topRight
: Alignment.topLeft,
child: Text(
TranslationBase.of(context).sar +
" " +
widget.item.price.toString(),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 19, letterSpacing:-0.76),),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 19,
letterSpacing: -0.76),
),
),
),
),
FractionallySizedBox(
widthFactor: 0.95,
@ -214,7 +258,8 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
child: Row(
children: [
RatingBar.readOnly(
initialRating: double.parse(widget.item.approvedRatingSum.toString()),
initialRating: double.parse(
widget.item.approvedRatingSum.toString()),
size: 18.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
@ -236,7 +281,8 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
// ),
Text(
"(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})",
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 12),
style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 12),
),
SizedBox(
width: 70,
@ -268,6 +314,7 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
Color getStatusBackgroundColor() {
if (widget.isStockAvailable)
return Color(0xFF5AB145);
else return Color(0xFFD02127);
else
return Color(0xFFD02127);
}
}

@ -57,10 +57,11 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.start,
children: [
IconWithBg(
icon: Icons.arrow_back,
color: Colors.grey,
icon: Icons.arrow_back_ios,
color: Color(0xFF2B353E),
onPress: () {
Navigator.pop(context);
},
@ -74,7 +75,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
children: [
IconWithBg(
icon: Icons.shopping_cart,
color: Colors.grey[800],
color: Color(0xFF2B353E),
onPress: () {
Navigator.pushAndRemoveUntil(
locator<NavigationService>()
@ -112,7 +113,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
.quantityCount
.toString(),
style: "caption",
medium: true,
// medium: true,
color: Colors.white,
)),
),
@ -124,7 +125,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
),
IconWithBg(
icon: FontAwesomeIcons.ellipsisV,
color: Colors.grey,
color: Color(0xFF2B353E),
onPress: () {
settingModalBottomSheet(context);
},

@ -1,15 +1,23 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'dart:math' as math;
class ProductTileItem extends StatelessWidget {
final AppSharedPreferences sharedPref = AppSharedPreferences();
final PharmacyProduct item;
@ -54,7 +62,6 @@ class ProductTileItem extends StatelessWidget {
}
}
if (!isIdExist) {
if (lastVisited == "") {
// it means there is no lastVisited yet
@ -77,19 +84,63 @@ class ProductTileItem extends StatelessWidget {
margin: EdgeInsets.all(7),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey.shade300, width: 0.5),
borderRadius: BorderRadius.circular(8)
),
borderRadius: BorderRadius.circular(8)),
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 2.8,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
// Stack(
// children: [
// Container(
// margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
// alignment: Alignment.center,
// child: (item.images != null && item.images.length > 0)
// ? Image.network(
// item.images[0].src,
// fit: BoxFit.cover,
// height: itemHeight / 2,
// )
// : Image.asset(
// "assets/images/no_image.png",
// fit: BoxFit.cover,
// height: itemHeight / 2,
// ),
// ),
// ],
// ),
Container(
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.3,
padding:
EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14),
color: Colors.white,
child: InkWell(
onTap: () {},
child: Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(33,
lightColor: Colors.transparent,
darkColor: Colors.transparent),
child: Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
//clipBehavior: Clip.antiAlias,
// decoration: projectProvider.isArabic
// ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent)
// : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green),
child: Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
child: (item.images != null &&
item.images.length > 0)
? Image.network(
item.images[0].src,
fit: BoxFit.cover,
@ -101,15 +152,73 @@ class ProductTileItem extends StatelessWidget {
height: itemHeight / 2,
),
),
// Container(
],
),
),
if (item.rxMessage != null)
projectProvider.isArabic
? Positioned(
right: -16,
top: 2,
child: Transform.rotate(
angle: math.pi / 4,
child: Container(
padding: EdgeInsets.only(
left: 18, right: 18, top: 6, bottom: 3),
color: CustomColors.accentColor,
child: Padding(
padding: EdgeInsets.all(2.0),
child: Text(
"الوصفة\n مطلوبة",
style: TextStyle(
color: Colors.white,
fontSize: 7.5,
height: 0.8,
fontWeight: FontWeight.bold,
letterSpacing: -0.27,
),
),
),
),
),
)
: Positioned(
left: -24,
top: 2,
child: Transform.rotate(
angle: -math.pi / 4,
child: Container(
padding: EdgeInsets.only(
left: 18, right: 18, top: 6, bottom: 3),
color: CustomColors.accentColor,
child: Text(
"\n E-Prescription \n Is required",
style: TextStyle(
color: Colors.white,
fontSize: 7.5,
//letterSpacing: -0.27,
height: 1.2,
fontWeight: FontWeight.w600,
),
),
),
),
),
],
),
),
),
),
// Padding(
// padding: EdgeInsets.fromLTRB(1, 1, 1, 1),
// child: Container(
// width: item.rxMessage != null
// ? MediaQuery.of(context).size.width / 5
// ? MediaQuery.of(context).size.width / 1.0
// : 0,
// padding: EdgeInsets.all(4),
// padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
// decoration: BoxDecoration(
// color: Color(0xffb23838),
// borderRadius:
// BorderRadius.only(topLeft: Radius.circular(6)),
// ),
// child: item.rxMessage != null
// ? Texts(
@ -122,33 +231,8 @@ class ProductTileItem extends StatelessWidget {
// fontWeight: FontWeight.w400,
// )
// : Texts(""),
// )
],
),
Padding(
padding: EdgeInsets.fromLTRB(1,1,1,1),
child: Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 1.0
: 0,
padding: EdgeInsets.fromLTRB(8,2,8,2),
decoration: BoxDecoration(
color: Color(0xffb23838),
),
child: item.rxMessage != null
? Texts(
projectProvider.isArabic
? item.rxMessagen
: item.rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
: Texts(""),
),
),
// ),
// ),
// SizedBox(height: 4,),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
@ -183,7 +267,7 @@ class ProductTileItem extends StatelessWidget {
RatingBar.readOnly(
initialRating: item.approvedRatingSum.toDouble(),
size: 15.0,
filledColor: Colors.yellow[700],
filledColor: Color(0xffD02127),
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
@ -195,7 +279,16 @@ class ProductTileItem extends StatelessWidget {
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
),
SizedBox(
width: 20.0,
),
Icon(
Icons.arrow_forward,
size: 18,
),
// StarRating(
// totalAverage: item.approvedTotalReviews > 0
// ? (item.approvedRatingSum.toDouble() /
@ -210,7 +303,9 @@ class ProductTileItem extends StatelessWidget {
),
),
),
SizedBox(height: 5,),
SizedBox(
height: 5,
),
],
),
),

@ -31,12 +31,14 @@ class BestSellerWidget extends StatelessWidget {
Container(
height: MediaQuery.of(context).size.height / 3 + 20,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.bestSellerProduct[i], MediaQuery.of(context).size.height / 4 + 20),
itemBuilder: (ctx, i) => ProductTileItem(
model.bestSellerProduct[i],
MediaQuery.of(context).size.height / 4 + 20),
scrollDirection: Axis.horizontal,
itemCount: model.bestSellerProduct.length,
),
) else
)
else
Container(
height: 80,
child: Center(

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/final_products_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/material.dart';

@ -18,7 +18,8 @@ class RecentlyViewedWidget extends StatelessWidget {
builder: (_, model, wi) => NetworkBaseView(
isLocalLoader: true,
baseViewModel: model,
child: model.lastVisitedProducts.isNotEmpty ? Container(
child: model.lastVisitedProducts.isNotEmpty
? Container(
child: Column(
children: [
ViewAllHomeWidget(
@ -33,8 +34,10 @@ class RecentlyViewedWidget extends StatelessWidget {
? MediaQuery.of(context).size.height / 3 + 20
: 0,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.lastVisitedProducts[i], MediaQuery.of(context).size.height / 4 + 20),
itemBuilder: (ctx, i) => ProductTileItem(
model.lastVisitedProducts[i],
MediaQuery.of(context).size.height / 4 +
20),
scrollDirection: Axis.horizontal,
itemCount: model.lastVisitedProducts.length,
),
@ -53,7 +56,8 @@ class RecentlyViewedWidget extends StatelessWidget {
),
],
),
) : Container(),
)
: Container(),
));
}
}

@ -4,11 +4,9 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
class ViewAllHomeWidget extends StatelessWidget {
final String title;
final Widget navigationWidget;
ViewAllHomeWidget(this.title, this.navigationWidget);
@override
@ -23,22 +21,32 @@ class ViewAllHomeWidget extends StatelessWidget {
bold: true,
fontSize: 16,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
textColor: Colors.green,
fontWeight: FontWeight.bold,
vPadding: 6,
hPadding: 14,
handler: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
navigationWidget));
InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => navigationWidget));
},
child: Texts(
TranslationBase.of(context).viewAll,
color: Color(0xffD02127),
decoration: TextDecoration.underline,
fontWeight: FontWeight.w600,
fontSize: 12.0,
),
),
// BorderedButton(
// TranslationBase.of(context).viewAll,
// hasBorder: true,
// borderColor: Colors.green,
// textColor: Colors.green,
// fontWeight: FontWeight.bold,
// vPadding: 6,
// hPadding: 14,
// handler: () {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => navigationWidget));
// },
// ),
],
),
);

@ -34,8 +34,10 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
Navigator.push(
ctx,
FadePage(
page: AddAddressPage(address, (pickResult) {
page: AddAddressPage(address, (pickResult) async {
model.addEditAddress(pickResult, address);
await model.getAddressesList();
})));
}

@ -72,7 +72,10 @@ class PharmacyAddressService extends BaseService {
}
Future addCustomerAddress(AddressInfo address) async {
makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
await makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
// if(!hasError) {
selectedAddressIndex = addresses.length +1;
// }
}
Future editCustomerAddress(AddressInfo address) async {

@ -1117,6 +1117,7 @@ class TranslationBase {
String get myPrescription => localizedValues['myPrescription'][locale.languageCode];
String get quantity => localizedValues['quantity'][locale.languageCode];
String get productQuantity => localizedValues['productQuantity'][locale.languageCode];
String get conditionsHMG => localizedValues['conditionsHMG'][locale.languageCode];
@ -1827,6 +1828,7 @@ class TranslationBase {
String get needPrescription => localizedValues['needPrescription'][locale.languageCode];
String get outOfStockMsg => localizedValues['outOfStockMsg'][locale.languageCode];
String get productOutOfStock => localizedValues['productOutOfStock'][locale.languageCode];
String get noArabicLetters => localizedValues['noArabicLetters'][locale.languageCode];

@ -248,10 +248,10 @@ class _SecondaryButtonState extends State<SecondaryButton>
style: TextStyle(
color: widget.textColor,
fontSize: widget.small ? 12.0 : 14.0,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontFamily: projectViewModel.isArabic
? 'Cairo'
: 'WorkSans'
: 'Poppins'
),
),
)

@ -272,7 +272,7 @@ class _TextsState extends State<Texts> {
style: _getFontStyle().copyWith(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
fontFamily: projectViewModel.isArabic ? 'Poppins' : 'Poppins',
),
),
),

@ -60,11 +60,13 @@ class _AppTextState extends State<AppText> {
widget.data,
textAlign: widget.textAlign,
overflow: TextOverflow.clip,
style: TextStyle(
color: widget.color == null ? Theme.of(context).textTheme.bodyText1.color : widget.color,
fontWeight: widget.fontWeight,
fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2),
height: widget.height,
fontFamily: "Poppins",
letterSpacing: widget.letterSpacing,
// fontFamily: widget.fontFamily == null
// ? projectViewModel.isArabic

Loading…
Cancel
Save