fix desing

merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
parent bc49d0d7c0
commit dbe74b3eb4

@ -37,96 +37,98 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Container(
mainAxisAlignment: MainAxisAlignment.start, color: Color(0xffF7F7F7),
children: [ child: Column(
SizedBox( mainAxisAlignment: MainAxisAlignment.start,
height: 10, children: [
), SizedBox(
widget.item.rxMessage != null height: 10,
? Container(
// width: widget.item.rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0,
width: double.infinity,
height: 40,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffD02127),
// color: Colors.red[700]
// borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
), ),
child: Row( widget.item.rxMessage != null
children: [ ? Container(
Padding( // width: widget.item.rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0,
padding: const EdgeInsets.only(left: 8, right: 8), width: double.infinity,
child: Icon( height: 40,
Icons.warning, padding: EdgeInsets.all(4),
color: Colors.white, decoration: BoxDecoration(
color: Color(0xffD02127),
// color: Colors.red[700]
// 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,
),
), ),
), Text(
Text( projectViewModel.isArabic ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(),
projectViewModel.isArabic ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(), style: TextStyle(color: Colors.white,
style: TextStyle(color: Colors.white, // regular: true,
// regular: true, fontSize: 17,
fontSize: 17, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, // textAlign: TextAlign.center,
// textAlign: TextAlign.center, )
) ),
), ],
], )
) )
) : Container(),
: 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( Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0), margin: EdgeInsets.only(top: 10.0, right: 10.0),
padding: EdgeInsets.only(left: 11.0, right: 11.0, top: 0, bottom: 0), padding: EdgeInsets.only(left: 11.0, right: 11.0, top: 0, bottom: 0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( 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,
color: getStatusBackgroundColor(), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),),
borderRadius: BorderRadius.circular(30.0)), //color: widget.isStockAvailable ? Colors.white : Colors.red,
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.isStockAvailable && widget.customerId != null ?IconButton(
?IconButton( iconSize: 25,
iconSize: 25, icon:Icon(Icons.notifications_active),
icon:Icon(Icons.notifications_active), color: new Color(0xff2E303A),
color: new Color(0xff2E303A), onPressed: ()
onPressed: () { widget.notifyMeWhenAvailable(context, widget.item.id);},
{ widget.notifyMeWhenAvailable(context, widget.item.id);},
): IconButton( ): IconButton(
icon: Icon(!widget.isInWishList ? Icons.favorite_border : Icons.favorite), icon: Icon(!widget.isInWishList ? Icons.favorite_border : Icons.favorite),
color: !widget.isInWishList ? Color(0xff2E303A) : Color(0xffD02127), color: !widget.isInWishList ? Color(0xff2E303A) : Color(0xffD02127),
onPressed: () async { onPressed: () async {
{ {
if (widget.customerId != null) { if (widget.customerId != null) {
if (!widget.isInWishList) { if (!widget.isInWishList) {
await widget.addToWishlistFunction(widget.item.id); await widget.addToWishlistFunction(widget.item.id);
} else {
await widget.deleteFromWishlistFunction(widget.item.id);
}
} else { } else {
await widget.deleteFromWishlistFunction(widget.item.id); return;
} }
} else { setState(() {});
return;
} }
setState(() {}); },
} )
},
)
// BorderedButton( // BorderedButton(
// TranslationBase.of(context).notifyMe, // TranslationBase.of(context).notifyMe,
// hasBorder: true, // hasBorder: true,
@ -171,73 +173,73 @@ 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 ? widget.item.namen : widget.item.name, style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16),
style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16), ),
), ),
), ),
),
),
Padding(
padding: const EdgeInsets.only(left: 8,right: 8),
child: Container(
margin: EdgeInsets.only(left: 5, right: 5),
child: Align(
alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft,
child: Text( TranslationBase.of(context).sar+ " " +
widget.item.price.toString(),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 19),),
),
), ),
Padding(
padding: const EdgeInsets.only(left: 8,right: 8),
child: Container(
margin: EdgeInsets.only(left: 5, right: 5),
child: Align(
alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft,
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,
child: Row( child: Row(
children: [ children: [
Container( Container(
child: Align( child: Align(
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
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),
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star_border, emptyIcon: Icons.star_border,
), ),
SizedBox( SizedBox(
width: 10, width: 10,
), ),
// Texts( // Texts(
// "${widget.item.approvedRatingSum}", // "${widget.item.approvedRatingSum}",
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
// fontSize: 12, // fontSize: 12,
// ), // ),
SizedBox( SizedBox(
width: 30, width: 30,
), ),
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,
), ),
// if (widget.item.rxMessage != null) // if (widget.item.rxMessage != null)
// Row( // Row(
// children: [ // children: [
@ -247,17 +249,18 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
// ), // ),
// ], // ],
// ) // )
], ],
),
), ),
), ),
), ],
], ),
),
SizedBox(
height: 30,
), ),
), ],
SizedBox( ),
height: 30,
),
],
); );
} }

Loading…
Cancel
Save