pharmacy home dsign

merge-update-with-lab-changes
hussam al-habibeh 4 years ago
parent 01a56da151
commit 3c97122308

@ -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,202 +77,210 @@ 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), margin: EdgeInsets.all(7),
splashColor: Theme.of(context).primaryColor, decoration: BoxDecoration(
child: Container( border: Border.all(color: Colors.grey.shade300, width: 0.2),
margin: EdgeInsets.all(7), borderRadius: BorderRadius.circular(10),
decoration: BoxDecoration( color: Colors.white,
border: Border.all(color: Colors.grey.shade300, width: 0.5), boxShadow: [
borderRadius: BorderRadius.circular(8)), BoxShadow(
padding: EdgeInsets.symmetric(horizontal: 4), color: Color(0xffF1F1F1),
width: MediaQuery.of(context).size.width / 2.8, spreadRadius: 4,
child: Column( blurRadius: 5.5,
crossAxisAlignment: CrossAxisAlignment.start, offset: Offset(0, 3), // changes position of shadow
children: [ ),
// Stack( ],
// children: [ ),
// Container( padding: EdgeInsets.symmetric(horizontal: 4),
// margin: EdgeInsets.fromLTRB(0, 0, 0, 0), width: MediaQuery.of(context).size.width / 2.8,
// alignment: Alignment.center, child: Column(
// child: (item.images != null && item.images.length > 0) crossAxisAlignment: CrossAxisAlignment.start,
// ? Image.network( children: [
// item.images[0].src, // Stack(
// fit: BoxFit.cover, // children: [
// height: itemHeight / 2, // Container(
// ) // margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
// : Image.asset( // alignment: Alignment.center,
// "assets/images/no_image.png", // child: (item.images != null && item.images.length > 0)
// fit: BoxFit.cover, // ? Image.network(
// height: itemHeight / 2, // item.images[0].src,
// ), // fit: BoxFit.cover,
// ), // height: itemHeight / 2,
// ], // )
// ), // : Image.asset(
// "assets/images/no_image.png",
// fit: BoxFit.cover,
// height: itemHeight / 2,
// ),
// ),
// ],
// ),
Container( Container(
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.3,
padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
color: Colors.white,
child: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.width * 0.3, height: double.infinity,
padding: clipBehavior: Clip.antiAlias,
EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14), decoration: containerRadiusWithGradientServices(0,
color: Colors.white, lightColor: Colors.transparent,
child: InkWell( darkColor: Colors.transparent),
onTap: () {}, child: Stack(
child: Container( children: [
width: double.infinity, Container(
height: double.infinity, width: double.infinity,
clipBehavior: Clip.antiAlias, height: double.infinity,
decoration: containerRadiusWithGradientServices(33, //clipBehavior: Clip.antiAlias,
lightColor: Colors.transparent, // decoration: projectProvider.isArabic
darkColor: Colors.transparent), // ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent)
child: Stack( // : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green),
children: [ child: Stack(
Container( children: [
width: double.infinity, Container(
height: double.infinity, decoration: BoxDecoration(
//clipBehavior: Clip.antiAlias, border: Border.all(
// decoration: projectProvider.isArabic color: Colors.grey.shade300, width: 1.1),
// ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) borderRadius: BorderRadius.only(
// : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), topRight: Radius.circular(
child: Stack( item.rxMessage != null &&
children: [ projectProvider.isArabic
Container( ? 20
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), : 8),
alignment: Alignment.center, bottomLeft: Radius.circular(8),
child: (item.images != null && bottomRight: Radius.circular(8),
item.images.length > 0) topLeft: Radius.circular(item.rxMessage != null &&
? Image.network( !projectProvider.isArabic
item.images[0].src, ? 25
fit: BoxFit.cover, : 8),
height: itemHeight / 2,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: itemHeight / 2,
),
), ),
], ),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
? Padding(
padding: EdgeInsets.all(12.0),
child: Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: itemHeight / 2,
),
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: itemHeight / 2,
),
), ),
), ],
if (item.rxMessage != null) ),
projectProvider.isArabic ),
? Positioned( if (item.rxMessage != null)
right: -16, projectProvider.isArabic
top: 2, ? Positioned(
child: Transform.rotate( right: -16,
angle: math.pi / 4, top: 2,
child: Container( child: Transform.rotate(
padding: EdgeInsets.only( angle: math.pi / 4,
left: 18, right: 18, top: 6, bottom: 3), child: Container(
color: CustomColors.accentColor, padding: EdgeInsets.only(
child: Padding( left: 18, right: 18, top: 6, bottom: 3),
padding: EdgeInsets.all(2.0), color: CustomColors.accentColor,
child: Text( child: Padding(
"الوصفة\n مطلوبة", padding: EdgeInsets.all(2.0),
style: TextStyle( child: Text(
color: Colors.white, "الوصفة\n مطلوبة",
fontSize: 7.5, style: TextStyle(
height: 0.8, color: Colors.white,
fontWeight: FontWeight.bold, fontSize: 7.5,
letterSpacing: -0.27, height: 0.8,
), fontWeight: FontWeight.bold,
), letterSpacing: -0.27,
), ),
), ),
), ),
) ),
: Positioned( ),
left: -24, )
top: 2, : Positioned(
child: Transform.rotate( left: -24,
angle: -math.pi / 4, top: 2,
child: Container( child: Transform.rotate(
padding: EdgeInsets.only( angle: -math.pi / 4,
left: 18, right: 18, top: 6, bottom: 3), child: Container(
color: CustomColors.accentColor, padding: EdgeInsets.only(
child: Text( left: 18, right: 18, top: 6, bottom: 3),
"\n E-Prescription \n Is required", color: CustomColors.accentColor,
style: TextStyle( child: Text(
color: Colors.white, "\n E-Prescription \n Is required",
fontSize: 7.5, style: TextStyle(
//letterSpacing: -0.27, color: Colors.white,
height: 1.2, fontSize: 7.5,
fontWeight: FontWeight.w600, //letterSpacing: -0.27,
), height: 1.2,
), fontWeight: FontWeight.w600,
), ),
), ),
), ),
], ),
), ),
), ],
), ),
), ),
),
// Padding( Padding(
// padding: EdgeInsets.fromLTRB(1, 1, 1, 1), padding: const EdgeInsets.symmetric(horizontal: 10.0),
// child: Container( child: Container(
// width: item.rxMessage != null height: MediaQuery.of(context).size.height * 0.075,
// ? 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: const EdgeInsets.symmetric(horizontal: 4.0),
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,
), ),
), ),
Expanded( ),
child: Container( SizedBox(
margin: EdgeInsets.symmetric( height: 7.0,
horizontal: 4, ),
vertical: 0, Expanded(
), child: Container(
child: Column( margin: EdgeInsets.symmetric(
crossAxisAlignment: CrossAxisAlignment.start, horizontal: 4,
mainAxisAlignment: MainAxisAlignment.end, vertical: 0,
children: [ ),
Padding( child: Column(
padding: const EdgeInsets.only(top: 2, bottom: 2), crossAxisAlignment: CrossAxisAlignment.start,
child: Texts( //mainAxisAlignment: MainAxisAlignment.end,
"SAR ${item.price}", children: [
fontWeight: FontWeight.w600, Padding(
fontSize: 14, padding:
), const EdgeInsets.symmetric(horizontal: 10, vertical: 2),
child: Texts(
"SAR ${item.price}",
fontWeight: FontWeight.bold,
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,15 +308,15 @@ class ProductTileItem extends StatelessWidget {
// ), // ),
], ],
), ),
], ),
), ],
), ),
), ),
SizedBox( ),
height: 5, SizedBox(
), 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