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

Fatima new design

See merge request Cloud_Solution/diplomatic-quarter!548
merge-requests/549/merge
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(
mainAxisAlignment: MainAxisAlignment.start, color: Color(0xffF7F7F7),
children: [ child: Column(
SizedBox( mainAxisAlignment: MainAxisAlignment.start,
height: 10, children: [
), SizedBox(
FractionallySizedBox( height: 10,
widthFactor: 0.95, ),
child: Row( widget.item.rxMessage != null
mainAxisAlignment: MainAxisAlignment.spaceBetween, ? Container(
children: [ // width: widget.item.rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0,
Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20), width: double.infinity,
Texts( height: 40,
widget.stockAvailability, padding: EdgeInsets.all(4),
fontWeight: FontWeight.bold, decoration: BoxDecoration(
fontSize: 15, color: Color(0xffD02127),
color: widget.isStockAvailable ? Colors.green : Colors.red, // color: Colors.red[700]
), // borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
// SizedBox(width: 20), ),
if (widget.authenticatedUserObject.isLogin) child: Row(
!widget.isStockAvailable && widget.customerId != null children: [
?BorderedButton( Padding(
TranslationBase.of(context).notifyMe, padding: const EdgeInsets.only(left: 8, right: 8),
hasBorder: true, child: Icon(
borderColor: Colors.green, Icons.warning,
textColor: Colors.green, color: Colors.white,
fontWeight: FontWeight.bold, ),
vPadding: 6, ),
hPadding: 14, Text(
handler: () => widget.notifyMeWhenAvailable(context, widget.item.id), 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(
widthFactor: 0.95,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20),
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,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),),
//color: widget.isStockAvailable ? Colors.white : Colors.red,
),
),
// SizedBox(width: 20),
if (widget.authenticatedUserObject.isLogin)
!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: () 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,97 +155,118 @@ 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.only(left: 8,right: 8, top: 1, bottom: 15),
padding: const EdgeInsets.all(8.0), child: Container(
child: Container( margin: EdgeInsets.only(left: 5, right: 5),
margin: EdgeInsets.only(left: 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.bold, fontSize: 15), ),
), ),
), ),
), ),
), Padding(
FractionallySizedBox( padding: const EdgeInsets.only(left: 8,right: 8),
widthFactor: 0.95, child: Container(
child: Row( margin: EdgeInsets.only(left: 5, right: 5),
children: [ child: Align(
Container( alignment: projectViewModel.isArabic ? Alignment.topRight : Alignment.topLeft,
child: Align( child: Text( TranslationBase.of(context).sar+ " " +
alignment: Alignment.bottomLeft, widget.item.price.toString(),
child: Row( style: TextStyle(fontWeight: FontWeight.bold, fontSize: 19),),
children: [ ),
RatingBar.readOnly( ),
initialRating: double.parse(widget.item.approvedRatingSum.toString()),
size: 15.0, ),
filledColor: Colors.yellow[700], FractionallySizedBox(
emptyColor: Colors.grey[400], widthFactor: 0.95,
isHalfAllowed: true, child: Row(
halfFilledIcon: Icons.star_half, children: [
filledIcon: Icons.star, Container(
emptyIcon: Icons.star, child: Align(
), alignment: Alignment.bottomLeft,
SizedBox( child: Row(
width: 10, children: [
), RatingBar.readOnly(
initialRating: double.parse(widget.item.approvedRatingSum.toString()),
size: 18.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
SizedBox(
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,
), ),
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),
), // ),
], // ],
) // )
], ],
),
), ),
), ),
), ],
], ),
), ),
), SizedBox(
SizedBox( height: 30,
height: 10, ),
), ],
], ),
); );
} }
Color getStatusBackgroundColor() {
if (widget.isStockAvailable)
return Color(0xFF5AB145);
else return Color(0xFFD02127);
}
} }

Loading…
Cancel
Save