Merge branch 'hussam_pharmacy_fix' into 'development_new_design_2.0'

fix ontap on prodcut card

See merge request Cloud_Solution/diplomatic-quarter!554
merge-update-with-lab-changes
haroon amjad 4 years ago
commit 1a90698a99

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

Loading…
Cancel
Save