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

Fatima new design

See merge request Cloud_Solution/diplomatic-quarter!548
merge-update-with-lab-changes
haroon amjad 4 years ago
commit bbcba1fca0

@ -158,30 +158,30 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
SizedBox( SizedBox(
height: 6, height: 10,
),
Container(
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
child: Texts(
TranslationBase.of(context).specification,
fontSize: 15,
fontWeight: FontWeight.bold,
),
width: double.infinity,
),
// Divider(color: Colors.grey),
],
),
),
SizedBox(
height: 6,
), ),
// Container(
// color: Colors.white,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
// child: Texts(
// TranslationBase.of(context).specification,
// fontSize: 15,
// fontWeight: FontWeight.bold,
// ),
// width: double.infinity,
// ),
// // Divider(color: Colors.grey),
// ],
// ),
// ),
// SizedBox(
// height: 6,
// ),
Container( Container(
// width: 500, // width: 500,
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
@ -205,7 +205,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).details, TranslationBase.of(context).details,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14),
), ),
color: Colors.white, color: Colors.white,
), ),
@ -236,7 +236,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).reviews, TranslationBase.of(context).reviews,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14),
), ),
color: Colors.white, color: Colors.white,
), ),
@ -266,7 +266,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
: null, : null,
child: Text( child: Text(
TranslationBase.of(context).availability, TranslationBase.of(context).availability,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14),
), ),
color: Colors.white, color: Colors.white,
), ),

@ -37,37 +37,108 @@ 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(
color: Color(0xffF7F7F7),
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
widget.item.rxMessage != null
? 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(
children: [
Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: Icon(
Icons.warning,
color: Colors.white,
),
),
Text(
projectViewModel.isArabic ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(),
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),
Texts( Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0),
padding: EdgeInsets.only(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(),
borderRadius: BorderRadius.circular(30.0)),
child: Text(
widget.stockAvailability, widget.stockAvailability,
fontWeight: FontWeight.bold, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),),
fontSize: 15, //color: widget.isStockAvailable ? Colors.white : Colors.red,
color: widget.isStockAvailable ? Colors.green : 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
?BorderedButton( ?IconButton(
TranslationBase.of(context).notifyMe, iconSize: 25,
hasBorder: true, icon:Icon(Icons.notifications_active),
borderColor: Colors.green, color: new Color(0xff2E303A),
textColor: Colors.green, onPressed: ()
fontWeight: FontWeight.bold, { widget.notifyMeWhenAvailable(context, widget.item.id);},
vPadding: 6,
hPadding: 14, ): IconButton(
handler: () => widget.notifyMeWhenAvailable(context, widget.item.id), 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);
} else {
await widget.deleteFromWishlistFunction(widget.item.id);
}
} else {
return;
}
setState(() {});
}
},
) )
// BorderedButton(
// TranslationBase.of(context).notifyMe,
// hasBorder: true,
// borderColor: Colors.green,
// textColor: Colors.green,
// fontWeight: FontWeight.bold,
// vPadding: 6,
// hPadding: 14,
// handler: () => widget.notifyMeWhenAvailable(context, widget.item.id),
// )
// InkWell( // InkWell(
// onTap: () => widget.notifyMeWhenAvailable(context, widget.item.id), // onTap: () => widget.notifyMeWhenAvailable(context, widget.item.id),
// child: Row(children: [ // child: Row(children: [
@ -84,39 +155,53 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
// ) // )
// ]), // ]),
// ) // )
: IconWithBg( // : IconWithBg(
icon: !widget.isInWishList ? Icons.favorite_border : Icons.favorite, // icon: !widget.isInWishList ? Icons.favorite_border : Icons.favorite,
color: !widget.isInWishList ? Colors.white : Colors.red[800], // color: !widget.isInWishList ? Colors.white : Colors.red[800],
onPress: () async { // onPress: () 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 { // } else {
await widget.deleteFromWishlistFunction(widget.item.id); // await widget.deleteFromWishlistFunction(widget.item.id);
} // }
} else { // } else {
return; // return;
} // }
setState(() {}); // setState(() {});
} // }
}, // },
) // )
], ],
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.only(left: 8,right: 8, top: 1, bottom: 15),
child: Container( child: Container(
margin: EdgeInsets.only(left: 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.bold, fontSize: 15), 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),),
),
),
), ),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.95, widthFactor: 0.95,
@ -129,13 +214,13 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
children: [ children: [
RatingBar.readOnly( RatingBar.readOnly(
initialRating: double.parse(widget.item.approvedRatingSum.toString()), initialRating: double.parse(widget.item.approvedRatingSum.toString()),
size: 15.0, size: 18.0,
filledColor: Colors.yellow[700], filledColor: Color(0XFFD02127),
emptyColor: Colors.grey[400], emptyColor: Color(0XFFD02127),
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star_border,
), ),
SizedBox( SizedBox(
width: 10, width: 10,
@ -148,22 +233,22 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Texts( Text(
"(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})", "(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})",
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: [
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.red, fontSize: 10), // style: TextStyle(color: Colors.red, fontSize: 10),
), // ),
], // ],
) // )
], ],
), ),
), ),
@ -172,9 +257,16 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 30,
), ),
], ],
),
); );
} }
Color getStatusBackgroundColor() {
if (widget.isStockAvailable)
return Color(0xFF5AB145);
else return Color(0xFFD02127);
}
} }

Loading…
Cancel
Save