fix product tile

merge-update-with-lab-changes
Mohammad Aljammal 4 years ago
parent cfe9e35c38
commit 8ecd4a24d8

@ -13,16 +13,16 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';

@ -672,7 +672,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
), ),
), ),
Container( Container(
height: MediaQuery.of(context).size.height / 4 + 20, height: MediaQuery.of(context).size.height / 4 + 22,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => itemBuilder: (ctx, i) =>
ProductTileItem(model.bestSellerProduct[i]), ProductTileItem(model.bestSellerProduct[i]),

@ -52,102 +52,99 @@ class ProductTileItem extends StatelessWidget {
return InkWell( return InkWell(
onTap: () => productOnClick(context), onTap: () => productOnClick(context),
splashColor: Theme.of(context).primaryColor, splashColor: Theme.of(context).primaryColor,
child: Card( child: Container(
elevation: 2, margin: EdgeInsets.all(7),
shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)), decoration: BoxDecoration(
margin: EdgeInsets.symmetric( border:Border.all(color: Colors.grey.shade300,width: 0.5),
horizontal: 8, borderRadius: BorderRadius.circular(8)
vertical: 0,
), ),
child: Container( padding: EdgeInsets.symmetric(horizontal: 4),
padding: EdgeInsets.symmetric(horizontal: 4), width: MediaQuery.of(context).size.width / 2.8,
width: MediaQuery.of(context).size.width / 3, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Stack(
Stack( children: [
children: [ Container(
Container( margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), alignment: Alignment.center,
alignment: Alignment.center, child: (item.images != null && item.images.length > 0)
child: (item.images != null && item.images.length > 0) ? Image.network(
? Image.network( item.images[0].src,
item.images[0].src, fit: BoxFit.cover,
fit: BoxFit.cover, height: 80,
height: 80, )
) : Image.asset(
: Image.asset( "assets/images/no_image.png",
"assets/images/no_image.png", fit: BoxFit.cover,
fit: BoxFit.cover, height: 80,
height: 80,
),
), ),
Container( ),
width: item.rxMessage != null Container(
? MediaQuery.of(context).size.width / 5 width: item.rxMessage != null
: 0, ? MediaQuery.of(context).size.width / 5
padding: EdgeInsets.all(4), : 0,
decoration: BoxDecoration( padding: EdgeInsets.all(4),
color: Color(0xffb23838), decoration: BoxDecoration(
borderRadius: color: Color(0xffb23838),
BorderRadius.only(topLeft: Radius.circular(6)), borderRadius:
), BorderRadius.only(topLeft: Radius.circular(6)),
child: item.rxMessage != null ? Texts( ),
projectProvider.isArabic ? item.rxMessagen : item.rxMessage, child: item.rxMessage != null
color: Colors.white, ? Texts(
regular: true, projectProvider.isArabic
fontSize: 10, ? item.rxMessagen
fontWeight: FontWeight.w400, : item.rxMessage,
): Texts(""), color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
) )
], : Texts(""),
)
],
),
SizedBox(height: 8,),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
), ),
Container( child: Column(
margin: EdgeInsets.symmetric( crossAxisAlignment: CrossAxisAlignment.start,
horizontal: 6, children: [
vertical: 0, Texts(
), projectProvider.isArabic ? item.namen : item.name,
child: Column( regular: true,
crossAxisAlignment: CrossAxisAlignment.start, fontSize: 12,
children: [ fontWeight: FontWeight.w400,
Texts( ),
projectProvider.isArabic ? item.namen : item.name, Padding(
regular: true, padding: const EdgeInsets.only(top: 4, bottom: 4),
fontSize: 12, child: Texts(
fontWeight: FontWeight.w400, "SAR ${item.price}",
fontWeight: FontWeight.w600,
fontSize: 14,
), ),
Padding( ),
padding: const EdgeInsets.only(top: 4, bottom: 4), Row(
child: Texts( children: [
"SAR ${item.price}", Expanded(
bold: true, child: StarRating(
fontSize: 14, totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
), ),
), ],
Row( ),
children: [ ],
Expanded( ),
child: StarRating( ),
totalAverage: item.approvedTotalReviews > 0 SizedBox(height: 5,),
? (item.approvedRatingSum.toDouble() / ],
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
),
/*Texts(
"(${item.approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),*/
],
),
],
),
)
],
),
), ),
), ),
); );

@ -30,7 +30,7 @@ class StarRating extends StatelessWidget {
) )
), ),
if (totalCount!=null) if (totalCount!=null)
SizedBox(width: 9.0), SizedBox(width: 5.0),
if (totalCount!=null) if (totalCount!=null)
Texts("("+totalCount.toString()+")", style: "overline", color: Colors.grey[400],) Texts("("+totalCount.toString()+")", style: "overline", color: Colors.grey[400],)
] ]

Loading…
Cancel
Save