merge conflict resolved

merge-update-with-lab-changes
hussam al-habibeh 4 years ago
parent 141e650276
commit 01a56da151

@ -23,10 +23,17 @@ class ProductNameAndPrice extends StatefulWidget {
final bool isStockAvailable; final bool isStockAvailable;
final String stockAvailability; final String stockAvailability;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
ProductNameAndPrice(this.context, this.item, 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 @override
_ProductNameAndPriceState createState() => _ProductNameAndPriceState(); _ProductNameAndPriceState createState() => _ProductNameAndPriceState();
@ -45,90 +52,107 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
widget.item.rxMessage != null widget.item.rxMessage != null
? Container( ? Container(
// width: widget.item.rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0, // width: widget.item.rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0,
width: double.infinity, width: double.infinity,
height: 40, height: 40,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffD02127), color: Color(0xffD02127),
// color: Colors.red[700] // color: Colors.red[700]
// borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), // borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: Icon(
Icons.warning,
color: Colors.white,
), ),
), child: Row(
Text( children: [
projectViewModel.isArabic ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(), Padding(
style: TextStyle(color: Colors.white, padding: const EdgeInsets.only(left: 8, right: 8),
// regular: true, child: Icon(
fontSize: 17, Icons.warning,
fontWeight: FontWeight.w600, color: Colors.white,
// textAlign: TextAlign.center, ),
) ),
), Text(
], projectViewModel.isArabic
) ? widget.item.rxMessagen.toString()
) : widget.item.rxMessage.toString(),
: Container(), style: TextStyle(
color: Colors.white,
// regular: true,
fontSize: 17,
fontWeight: FontWeight.w600,
// textAlign: TextAlign.center,
)),
],
))
: Container(),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.95, widthFactor: 0.95,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
// Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20), // Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20),
Container( if (widget.stockAvailability != null)
margin: EdgeInsets.only(top: 10.0, right: 10.0), Container(
padding: EdgeInsets.only(left: 11.0, right: 11.0, top: 0, bottom: 0), margin: EdgeInsets.only(top: 10.0, right: 10.0),
decoration: BoxDecoration( padding: EdgeInsets.only(
border: Border.all( left: 11.0, right: 11.0, top: 0, bottom: 0),
decoration: BoxDecoration(
border: Border.all(
color: getStatusBackgroundColor(),
style: BorderStyle.solid,
width: 5.0,
),
color: getStatusBackgroundColor(), color: getStatusBackgroundColor(),
style: BorderStyle.solid, borderRadius: BorderRadius.circular(30.0)),
width: 5.0, child: Text(
widget.stockAvailability,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 11,
color: Color(0xffFFFFFF),
), ),
color: getStatusBackgroundColor(), //color: widget.isStockAvailable ? Colors.white : Colors.red,
borderRadius: BorderRadius.circular(30.0)), ),
child: Text(
widget.stockAvailability,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),),
//color: widget.isStockAvailable ? Colors.white : Colors.red,
), ),
),
// SizedBox(width: 20), // SizedBox(width: 20),
if (widget.authenticatedUserObject.isLogin) if (widget.authenticatedUserObject.isLogin)
!widget.isStockAvailable && widget.customerId != null widget.stockAvailability != null &&
?IconButton( !widget.isStockAvailable &&
iconSize: 25, widget.customerId != null
icon:Icon(Icons.notifications_active), ? IconButton(
color: new Color(0xff2E303A), iconSize: 25,
onPressed: () icon: Icon(Icons.notifications_active),
{ widget.notifyMeWhenAvailable(context, widget.item.id);}, color: new Color(0xff2E303A),
onPressed: () {
): IconButton( widget.notifyMeWhenAvailable(
icon: Icon(!widget.isInWishList ? Icons.favorite_border : Icons.favorite), context, widget.item.id);
color: !widget.isInWishList ? Color(0xff2E303A) : Color(0xffD02127), },
onPressed: () async { )
{ : IconButton(
if (widget.customerId != null) { icon: Icon(!widget.isInWishList
if (!widget.isInWishList) { ? Icons.favorite_border
await widget.addToWishlistFunction(widget.item.id); : Icons.favorite),
} else { color: !widget.isInWishList
await widget.deleteFromWishlistFunction(widget.item.id); ? Color(0xff2E303A)
} : Color(0xffD02127),
} else { onPressed: () async {
return; {
} if (widget.customerId != null) {
setState(() {}); if (!widget.isInWishList) {
} await widget
}, .addToWishlistFunction(widget.item.id);
) } else {
await widget.deleteFromWishlistFunction(
widget.item.id);
}
} else {
return;
}
setState(() {});
}
},
)
// BorderedButton( // BorderedButton(
// TranslationBase.of(context).notifyMe, // TranslationBase.of(context).notifyMe,
// hasBorder: true, // hasBorder: true,
@ -177,31 +201,39 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 8,right: 8, top: 1, bottom: 15), padding:
const EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 15),
child: Container( child: Container(
margin: EdgeInsets.only(left: 5, right: 5), margin: EdgeInsets.only(left: 5, right: 5),
child: Align( child: Align(
alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft, alignment: projectViewModel.isArabic
? Alignment.topRight
: Alignment.topLeft,
child: Text( child: Text(
projectViewModel.isArabic ? widget.item.namen : widget.item.name, projectViewModel.isArabic
style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16), ? widget.item.namen
: widget.item.name,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16),
), ),
), ),
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 8,right: 8), padding: const EdgeInsets.only(left: 8, right: 8),
child: Container( child: Container(
margin: EdgeInsets.only(left: 5, right: 5), margin: EdgeInsets.only(left: 5, right: 5),
child: Align( child: Align(
alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft, alignment: projectViewModel.isArabic
child: Text( TranslationBase.of(context).sar+ " " + ? Alignment.topRight
widget.item.price.toString(), : Alignment.topLeft,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 19),), child: Text(
TranslationBase.of(context).sar +
" " +
widget.item.price.toString(),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 19),
),
), ),
), ),
), ),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.95, widthFactor: 0.95,
@ -213,7 +245,8 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
child: Row( child: Row(
children: [ children: [
RatingBar.readOnly( RatingBar.readOnly(
initialRating: double.parse(widget.item.approvedRatingSum.toString()), initialRating: double.parse(
widget.item.approvedRatingSum.toString()),
size: 18.0, size: 18.0,
filledColor: Color(0XFFD02127), filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), emptyColor: Color(0XFFD02127),
@ -235,7 +268,8 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
), ),
Text( Text(
"(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})", "(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})",
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 12), style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 12),
), ),
SizedBox( SizedBox(
width: 70, width: 70,
@ -267,6 +301,7 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
Color getStatusBackgroundColor() { Color getStatusBackgroundColor() {
if (widget.isStockAvailable) if (widget.isStockAvailable)
return Color(0xFF5AB145); return Color(0xFF5AB145);
else return Color(0xFFD02127); else
return Color(0xFFD02127);
} }
} }

Loading…
Cancel
Save