Merge branch 'hussam_pharmacy_fix' into 'development_new_design_2.0'

Hussam pharmacy fix

See merge request Cloud_Solution/diplomatic-quarter!553
merge-requests/554/merge
haroon amjad 4 years ago
commit 6c20bf50b5

@ -90,7 +90,9 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try { try {
String barcode = result; String barcode = result;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { await BaseAppClient()
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response); print(response);
var product = PharmacyProduct.fromJson(response["products"][0]); var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -100,7 +102,8 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
AppToast.showErrorToast(message: "Product not found"); AppToast.showErrorToast(message: "Product not found");
}); });
} catch (apiEx) { } catch (apiEx) {
AppToast.showErrorToast(message: "Something went wrong, please try again"); AppToast.showErrorToast(
message: "Something went wrong, please try again");
} }
} catch (barcodeEx) {} } catch (barcodeEx) {}
} }

@ -48,7 +48,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
isMainPharmacyPages: true, isMainPharmacyPages: true,
isPharmacy: true, isPharmacy: true,
isShowPharmacyAppbar: true, isShowPharmacyAppbar: true,
backgroundColor: Colors.white, backgroundColor: Color(0xffFEFEFE),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(

@ -77,14 +77,21 @@ class ProductTileItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return InkWell( return Container(
onTap: () => productOnClick(context),
splashColor: Theme.of(context).primaryColor,
child: Container(
margin: EdgeInsets.all(7), margin: EdgeInsets.all(7),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey.shade300, width: 0.5), border: Border.all(color: Colors.grey.shade300, width: 0.2),
borderRadius: BorderRadius.circular(8)), borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0xffF1F1F1),
spreadRadius: 4,
blurRadius: 5.5,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 2.8, width: MediaQuery.of(context).size.width / 2.8,
child: Column( child: Column(
@ -113,16 +120,13 @@ class ProductTileItem extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3,
padding: padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14),
color: Colors.white, color: Colors.white,
child: InkWell(
onTap: () {},
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(33, decoration: containerRadiusWithGradientServices(0,
lightColor: Colors.transparent, lightColor: Colors.transparent,
darkColor: Colors.transparent), darkColor: Colors.transparent),
child: Stack( child: Stack(
@ -137,14 +141,33 @@ class ProductTileItem extends StatelessWidget {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade300, width: 1.1),
borderRadius: BorderRadius.only(
topRight: Radius.circular(
item.rxMessage != null &&
projectProvider.isArabic
? 20
: 8),
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
topLeft: Radius.circular(item.rxMessage != null &&
!projectProvider.isArabic
? 25
: 8),
),
),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: (item.images != null && child: (item.images != null && item.images.length > 0)
item.images.length > 0) ? Padding(
? Image.network( padding: EdgeInsets.all(12.0),
child: Image.network(
item.images[0].src, item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: itemHeight / 2, height: itemHeight / 2,
),
) )
: Image.asset( : Image.asset(
"assets/images/no_image.png", "assets/images/no_image.png",
@ -208,41 +231,22 @@ class ProductTileItem extends StatelessWidget {
), ),
), ),
), ),
),
// Padding(
// padding: EdgeInsets.fromLTRB(1, 1, 1, 1),
// child: Container(
// width: item.rxMessage != null
// ? MediaQuery.of(context).size.width / 1.0
// : 0,
// padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
// decoration: BoxDecoration(
// color: Color(0xffb23838),
// ),
// child: item.rxMessage != null
// ? Texts(
// projectProvider.isArabic
// ? item.rxMessagen
// : item.rxMessage,
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// )
// : Texts(""),
// ),
// ),
// SizedBox(height: 4,),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Container(
height: MediaQuery.of(context).size.height * 0.075,
child: Texts( child: Texts(
projectProvider.isArabic ? item.namen : item.name, projectProvider.isArabic ? item.namen : item.name,
regular: true, //regular: true,
fontSize: 12, fontSize: 10,
fontWeight: FontWeight.w400, color: Color(0xff2B353E),
fontWeight: FontWeight.w500,
), ),
), ),
),
SizedBox(
height: 7.0,
),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
@ -251,28 +255,32 @@ class ProductTileItem extends StatelessWidget {
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top: 2, bottom: 2), padding:
const EdgeInsets.symmetric(horizontal: 10, vertical: 2),
child: Texts( child: Texts(
"SAR ${item.price}", "SAR ${item.price}",
fontWeight: FontWeight.w600, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 11,
color: Color(0xff2B353E),
), ),
), ),
Row( Padding(
padding: EdgeInsets.symmetric(horizontal: 5),
child: Row(
children: [ children: [
// Expanded( // Expanded(
RatingBar.readOnly( RatingBar.readOnly(
initialRating: item.approvedRatingSum.toDouble(), initialRating: item.approvedRatingSum.toDouble(),
size: 15.0, size: 15.0,
filledColor: Color(0xffD02127), filledColor: Color(0XFFD02127),
emptyColor: Colors.grey[500], 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,
), ),
Texts( Texts(
"(${item.approvedTotalReviews})", "(${item.approvedTotalReviews})",
@ -282,11 +290,12 @@ class ProductTileItem extends StatelessWidget {
), ),
SizedBox( SizedBox(
width: 20.0, width: 10.0,
), ),
Icon( Icon(
Icons.arrow_forward, Icons.arrow_forward,
size: 18, size: 15,
color: Color(0xff2D2F39),
), ),
// StarRating( // StarRating(
@ -299,16 +308,16 @@ class ProductTileItem extends StatelessWidget {
// ), // ),
], ],
), ),
),
], ],
), ),
), ),
), ),
SizedBox( SizedBox(
height: 5, height: 1,
), ),
], ],
), ),
),
); );
} }
} }

@ -29,7 +29,7 @@ class BestSellerWidget extends StatelessWidget {
)), )),
if (model.state != ViewState.BusyLocal) if (model.state != ViewState.BusyLocal)
Container( Container(
height: MediaQuery.of(context).size.height / 3 + 20, height: MediaQuery.of(context).size.height / 3 + 1,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => ProductTileItem( itemBuilder: (ctx, i) => ProductTileItem(
model.bestSellerProduct[i], model.bestSellerProduct[i],

@ -31,7 +31,12 @@ class MostViewedWidget extends StatelessWidget {
)), )),
if (model.state != ViewState.BusyLocal) if (model.state != ViewState.BusyLocal)
Container( Container(
height: MediaQuery.of(context).size.height / 3 + 20, decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade300, width: 0.1),
borderRadius: BorderRadius.circular(8),
),
height: MediaQuery.of(context).size.height / 3 + 1,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => ProductTileItem( itemBuilder: (ctx, i) => ProductTileItem(
model.mostViewedProducts[i], model.mostViewedProducts[i],

@ -31,7 +31,7 @@ class RecentlyViewedWidget extends StatelessWidget {
if (model.state != ViewState.BusyLocal) if (model.state != ViewState.BusyLocal)
Container( Container(
height: model.lastVisitedProducts.length > 0 height: model.lastVisitedProducts.length > 0
? MediaQuery.of(context).size.height / 3 + 20 ? MediaQuery.of(context).size.height / 3 + 1
: 0, : 0,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => ProductTileItem( itemBuilder: (ctx, i) => ProductTileItem(

@ -18,8 +18,9 @@ class ViewAllHomeWidget extends StatelessWidget {
children: [ children: [
Texts( Texts(
title, title,
color: Color(0xff2E303A),
bold: true, bold: true,
fontSize: 16, fontSize: 19,
), ),
InkWell( InkWell(
onTap: () { onTap: () {

Loading…
Cancel
Save