fix footer design

merge-requests/557/head
Elham Rababh 4 years ago
parent 1a90698a99
commit 8f044a635a

@ -57,7 +57,15 @@ class _FooterWidgetState extends State<FooterWidget> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(0.0), Radius.circular(0.0),
), ),
border: Border.all(color: Color(0xFF707070), width: 0), boxShadow: [
BoxShadow(
color: Color(0xFFCCCCCC),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(2, 2), // changes position of shadow
),
],
// border: Border.all(color: Color(0xFF707070), width: 0),
), ),
width: double.infinity, width: double.infinity,
height: quantityUI, height: quantityUI,
@ -219,12 +227,12 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 5.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart, label: TranslationBase.of(context).addToCart,
disabled: (!widget.isAvailable && widget.quantity > 0) || disabled: isAddToCartDisable(),
widget.quantity > widget.quantityLimit || fontSize: 15,
widget.item.isRx,
fontSize: 16,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -235,8 +243,9 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50).withOpacity(0.7),
borderRadius: 6, borderRadius: 6,
disableColor:Color(0xFFD6D6D6),
textColor: isAddToCartDisable()?Color(0xFFACACAC):Colors.white,
color: Color(0xFF535353), color: Color(0xFF535353),
), ),
), ),
@ -245,12 +254,13 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 5.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow, label: TranslationBase.of(context).buyNow,
fontSize: 16, fontSize: 15,
disabled: (!widget.isAvailable && widget.quantity > 0) || disabled: isBuyNowDisable(),
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -261,15 +271,11 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
} }
}, },
textColor: isBuyNowDisable()?Color(0xFFACACAC):Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Colors.grey[800].withOpacity(0.7),
borderRadius: 6, borderRadius: 6,
disableColor: Colors.grey[700], disableColor: Color(0xFFD6D6D6),
color: !widget.isAvailable && widget.quantity > 0 || color: Color(0xFF5AB145),
widget.quantity > widget.quantityLimit ||
widget.item.isRx
? Color(0xFF535353).withOpacity(0.7)
: Color(0xFF5AB145),
), ),
), ),
], ],
@ -280,6 +286,24 @@ class _FooterWidgetState extends State<FooterWidget> {
); );
} }
bool isBuyNowDisable(){
// return true;
return (!widget.isAvailable && widget.quantity > 0) ||
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx;
}
bool isAddToCartDisable(){
// return true;
return (!widget.isAvailable && widget.quantity > 0) ||
widget.quantity > widget.quantityLimit ||
widget.item.isRx;
}
void setUserValues(value) async { void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
} }

@ -200,9 +200,9 @@ class _SecondaryButtonState extends State<SecondaryButton>
width: MediaQuery.of(context).size.width * 2.2, width: MediaQuery.of(context).size.width * 2.2,
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, // shape: BoxShape.circle,
color: widget.disabled color: widget.disabled
? Colors.grey ? widget.disableColor ?? Colors.grey
: widget.color ?? Theme.of(context).buttonColor, : widget.color ?? Theme.of(context).buttonColor,
), ),
), ),
@ -212,8 +212,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
padding: widget.iconOnly padding: widget.iconOnly
? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.small ? 8.0 : 14.0, top: widget.small ? 8.0 : 12.0,
bottom: widget.small ? 6.0 : 14.0, bottom: widget.small ? 6.0 : 12.0,
left: 18.0, left: 18.0,
right: 18.0), right: 18.0),
child: Stack( child: Stack(
@ -246,8 +246,10 @@ class _SecondaryButtonState extends State<SecondaryButton>
bottom: widget.small ? 4.0 : 3.0), bottom: widget.small ? 4.0 : 3.0),
child: Text( child: Text(
widget.label, widget.label,
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : widget.fontSize??14.0, fontSize: widget.small ? 12.0 : widget.fontSize??14.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: projectViewModel.isArabic fontFamily: projectViewModel.isArabic

Loading…
Cancel
Save