parent product and sub product update

merge-update-with-lab-changes
hussam al-habibeh 5 years ago
parent cb9d8cb9d9
commit 0a1db70229

@ -547,113 +547,256 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
thickness: 1.0, thickness: 1.0,
color: Colors.grey.shade400, color: Colors.grey.shade400,
), ),
styleOne == true model.parentProducts.isNotEmpty
? Container( ? styleOne == true
height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15, ? Container(
child: GridView.builder( height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15,
physics: NeverScrollableScrollPhysics(), child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( physics: NeverScrollableScrollPhysics(),
crossAxisCount: 2, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 0.5, crossAxisCount: 2,
mainAxisSpacing: 2.0, crossAxisSpacing: 0.5,
childAspectRatio: 0.9, mainAxisSpacing: 2.0,
), childAspectRatio: 0.9,
itemCount: model.parentProducts.length, ),
itemBuilder: (BuildContext context, int index) { itemCount: model.parentProducts.length,
return NetworkBaseView( itemBuilder: (BuildContext context, int index) {
baseViewModel: model, return NetworkBaseView(
child: InkWell( baseViewModel: model,
child: Card( child: InkWell(
color: model.parentProducts[index].discountName != null child: Card(
? Color(0xffFFFF00) color: model.parentProducts[index].discountName != null
: Colors.white, ? Color(0xffFFFF00)
elevation: 0, : Colors.white,
shape: Border( elevation: 0,
right: BorderSide( shape: Border(
color: Colors.grey.shade300, right: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
left: BorderSide( ),
color: Colors.grey.shade300, left: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
bottom: BorderSide( ),
color: Colors.grey.shade300, bottom: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
top: BorderSide( ),
color: Colors.grey.shade300, top: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
), ),
margin: EdgeInsets.symmetric( ),
horizontal: 8, margin: EdgeInsets.symmetric(
vertical: 4, horizontal: 8,
), vertical: 4,
child: Container( ),
decoration: BoxDecoration( child: Container(
borderRadius: BorderRadius.only( decoration: BoxDecoration(
topLeft: Radius.circular(110.0), borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
),
color: Colors.white,
),
padding: EdgeInsets.symmetric(horizontal: 0),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
if (model.parentProducts[index].discountName != null)
RotatedBox(
quarterTurns: 4,
child: Container(
decoration: BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
right: 5.0,
top: 20.0,
bottom: 5.0,
),
child: Texts(
'offer'.toUpperCase(),
color: Colors.red,
fontSize: 13.0,
fontWeight: FontWeight.w900,
),
),
transform: new Matrix4.rotationZ(5.837200),
),
),
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: Image.network(
model.parentProducts[index].images.isNotEmpty
? model.parentProducts[index].images[0].thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model.parentProducts[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
model.parentProducts[index].rxMessage != null
? model.parentProducts[index].rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.parentProducts[index].discountName != null)
Container(
width: double.infinity,
height: 13.0,
decoration: BoxDecoration(
color: Color(0xff5AB145),
),
child: Center(
child: Texts(
model.parentProducts[index].discountName,
regular: true,
color: Colors.white,
fontSize: 10.4,
),
),
),
Texts(
model.parentProducts[index].name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w700,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage:
model.parentProducts[index].approvedRatingSum > 0
? (model.parentProducts[index]
.approvedRatingSum
.toDouble() /
model.parentProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
),
),
],
),
), ),
color: Colors.white,
), ),
padding: EdgeInsets.symmetric(horizontal: 0), onTap: () => {
width: MediaQuery.of(context).size.width / 3, Navigator.push(
child: Column( context,
crossAxisAlignment: CrossAxisAlignment.start, FadePage(
page: ProductDetailPage(model.parentProducts[index]),
)),
},
));
},
),
)
: Container(
height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.122,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemCount: model.parentProducts.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: Card(
child: Row(
children: [ children: [
Stack( Stack(
children: [ children: [
if (model.parentProducts[index].discountName != null) Column(
RotatedBox( children: [
quarterTurns: 4, Container(
child: Container(
decoration: BoxDecoration(), decoration: BoxDecoration(),
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
right: 5.0, left: 9.0,
top: 20.0, top: 8.0,
bottom: 5.0, right: 10.0,
),
child: Texts(
'offer'.toUpperCase(),
color: Colors.red,
fontSize: 13.0,
fontWeight: FontWeight.w900,
), ),
), ),
transform: new Matrix4.rotationZ(5.837200),
), ),
), Container(
Container( margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), alignment: Alignment.center,
alignment: Alignment.center, child: Image.network(
child: Image.network( model.parentProducts[index].images.isNotEmpty
model.parentProducts[index].images.isNotEmpty ? model.parentProducts[index].images[0].thumb
? model.parentProducts[index].images[0].thumb : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', fit: BoxFit.contain,
fit: BoxFit.cover, height: 80,
height: 80, ),
), ),
],
), ),
Container( Column(
width: model.parentProducts[index].rxMessage != null children: [
? MediaQuery.of(context).size.width / 5 Container(
: 0, width: model.parentProducts[index].rxMessage != null
padding: EdgeInsets.all(4), ? MediaQuery.of(context).size.width / 5
decoration: BoxDecoration( : 0,
color: Color(0xffb23838), padding: EdgeInsets.all(4),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), decoration: BoxDecoration(
), color: Color(0xffb23838),
child: Texts( borderRadius:
model.parentProducts[index].rxMessage != null BorderRadius.only(topLeft: Radius.circular(6)),
? model.parentProducts[index].rxMessage ),
: "", child: Texts(
color: Colors.white, model.parentProducts[index].rxMessage != null
regular: true, ? model.parentProducts[index].rxMessage
fontSize: 10, : "",
fontWeight: FontWeight.w400, color: Colors.white,
), regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
), ),
], ],
), ),
@ -663,29 +806,24 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (model.parentProducts[index].discountName != null) SizedBox(
Container( height: 4.0,
width: double.infinity, ),
height: 13.0, Container(
decoration: BoxDecoration( width: MediaQuery.of(context).size.width * 0.65,
color: Color(0xff5AB145), child: Texts(
), model.parentProducts[index].name,
child: Center( regular: true,
child: Texts( fontSize: 13.2,
model.parentProducts[index].discountName, fontWeight: FontWeight.w500,
regular: true, maxLines: 5,
color: Colors.white,
fontSize: 10.4,
),
),
), ),
Texts( ),
model.parentProducts[index].name, SizedBox(
regular: true, height: 8.0,
fontSize: 12,
fontWeight: FontWeight.w700,
), ),
Padding( Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4), padding: const EdgeInsets.only(top: 4, bottom: 4),
@ -722,148 +860,43 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
], ],
), ),
), ),
), onTap: () => {
onTap: () => { Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: ProductDetailPage(model.parentProducts[index]),
page: ProductDetailPage(model.parentProducts[index]), )),
)), },
}, );
)); }),
}, )
), : Padding(
) padding: const EdgeInsets.all(12.0),
: Container( child: Container(
height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.122, child: Center(
child: ListView.builder( child: Column(
physics: NeverScrollableScrollPhysics(), mainAxisAlignment: MainAxisAlignment.center,
itemCount: model.parentProducts.length, children: [
itemBuilder: (BuildContext context, int index) { Padding(
return InkWell( padding: const EdgeInsets.all(8.0),
child: Card( child: Image.asset(
child: Row( 'assets/images/new-design/empty_box.png',
children: [ width: 100,
Stack( height: 100,
children: [ fit: BoxFit.cover,
Column(
children: [
Container(
decoration: BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
),
),
Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: Image.network(
model.parentProducts[index].images.isNotEmpty
? model.parentProducts[index].images[0].thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
],
),
Column(
children: [
Container(
width: model.parentProducts[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
model.parentProducts[index].rxMessage != null
? model.parentProducts[index].rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.65,
child: Texts(
model.parentProducts[index].name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage:
model.parentProducts[index].approvedRatingSum > 0
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model.parentProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
),
),
],
), ),
), ),
onTap: () => { Padding(
Navigator.push( padding: const EdgeInsets.all(8.0),
context, child: Text(
FadePage( 'There is no data',
page: ProductDetailPage(model.parentProducts[index]), style: TextStyle(fontSize: 30),
)), ),
}, )
); ],
}), ),
),
),
) )
], ],
), ),

@ -522,108 +522,246 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
thickness: 1.0, thickness: 1.0,
color: Colors.grey.shade400, color: Colors.grey.shade400,
), ),
styleOne == true model.subProducts.isNotEmpty
? Container( ? styleOne == true
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.15, ? Container(
child: GridView.builder( height: model.subProducts.length * MediaQuery.of(context).size.height * 0.15,
physics: NeverScrollableScrollPhysics(), child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( physics: NeverScrollableScrollPhysics(),
crossAxisCount: 2, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 0.5, crossAxisCount: 2,
mainAxisSpacing: 2.0, crossAxisSpacing: 0.5,
childAspectRatio: 0.9, mainAxisSpacing: 2.0,
), childAspectRatio: 0.9,
itemCount: model.subProducts.length, ),
itemBuilder: (BuildContext context, int index) { itemCount: model.subProducts.length,
return NetworkBaseView( itemBuilder: (BuildContext context, int index) {
baseViewModel: model, return NetworkBaseView(
child: InkWell( baseViewModel: model,
child: Card( child: InkWell(
color: model.subProducts[index].discountName != null child: Card(
? Color(0xffFFFF00) color: model.subProducts[index].discountName != null
: Colors.white, ? Color(0xffFFFF00)
elevation: 0, : Colors.white,
shape: Border( elevation: 0,
right: BorderSide( shape: Border(
color: Colors.grey.shade300, right: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
left: BorderSide( ),
color: Colors.grey.shade300, left: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
bottom: BorderSide( ),
color: Colors.grey.shade300, bottom: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
top: BorderSide( ),
color: Colors.grey.shade300, top: BorderSide(
width: 1, color: Colors.grey.shade300,
), width: 1,
), ),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
), ),
color: Colors.white, margin: EdgeInsets.symmetric(
), horizontal: 8,
padding: EdgeInsets.symmetric(horizontal: 0), vertical: 4,
width: MediaQuery.of(context).size.width / 3, ),
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, decoration: BoxDecoration(
children: [ borderRadius: BorderRadius.only(
Stack( topLeft: Radius.circular(110.0),
),
color: Colors.white,
),
padding: EdgeInsets.symmetric(horizontal: 0),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Stack(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), children: [
alignment: Alignment.center, Container(
child: Image.network( margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
model.subProducts[index].images.isNotEmpty alignment: Alignment.center,
? model.subProducts[index].images[0].thumb child: Image.network(
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', model.subProducts[index].images.isNotEmpty
fit: BoxFit.cover, ? model.subProducts[index].images[0].thumb
height: 80, : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
), fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model.subProducts[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
model.subProducts[index].rxMessage != null
? model.subProducts[index].rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
), ),
Container( Container(
width: model.subProducts[index].rxMessage != null margin: EdgeInsets.symmetric(
? MediaQuery.of(context).size.width / 5 horizontal: 6,
: 0, vertical: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
), ),
child: Texts( child: Column(
model.subProducts[index].rxMessage != null crossAxisAlignment: CrossAxisAlignment.start,
? model.subProducts[index].rxMessage children: [
: "", Texts(
color: Colors.white, model.subProducts[index].name,
regular: true, regular: true,
fontSize: 10, fontSize: 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.subProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage:
model.subProducts[index].approvedRatingSum > 0
? (model.subProducts[index].approvedRatingSum
.toDouble() /
model.subProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
), ),
), ),
], ],
), ),
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model.subProducts[index]),
)),
},
));
},
),
)
: Container(
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.122,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemCount: model.subProducts.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration: BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
),
),
Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: Image.network(
model.subProducts[index].images.isNotEmpty
? model.subProducts[index].images[0].thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
],
),
Column(
children: [
Container(
width: model.subProducts[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
model.subProducts[index].rxMessage != null
? model.subProducts[index].rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
),
],
),
Container( Container(
height: 100.0,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6, horizontal: 6,
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( SizedBox(
model.subProducts[index].name, height: 4.0,
regular: true, ),
fontSize: 12, Container(
fontWeight: FontWeight.w400, width: MediaQuery.of(context).size.width * 0.65,
child: Texts(
model.subProducts[index].name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
), ),
Padding( Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4), padding: const EdgeInsets.only(top: 4, bottom: 4),
@ -659,147 +797,43 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
], ],
), ),
), ),
), onTap: () => {
onTap: () => { Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: ProductDetailPage(model.subProducts[index]),
page: ProductDetailPage(model.subProducts[index]), )),
)), },
}, );
)); }),
}, )
), : Padding(
) padding: const EdgeInsets.all(12.0),
: Container( child: Container(
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.122, child: Center(
child: ListView.builder( child: Column(
physics: NeverScrollableScrollPhysics(), mainAxisAlignment: MainAxisAlignment.center,
itemCount: model.subProducts.length, children: [
itemBuilder: (BuildContext context, int index) { Padding(
return InkWell( padding: const EdgeInsets.all(8.0),
child: Card( child: Image.asset(
child: Row( 'assets/images/new-design/empty_box.png',
children: [ width: 100,
Stack( height: 100,
children: [ fit: BoxFit.cover,
Column(
children: [
Container(
decoration: BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
),
),
Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: Image.network(
model.subProducts[index].images.isNotEmpty
? model.subProducts[index].images[0].thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
],
),
Column(
children: [
Container(
width: model.subProducts[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
model.subProducts[index].rxMessage != null
? model.subProducts[index].rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
],
),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.65,
child: Texts(
model.subProducts[index].name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.subProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model.subProducts[index].approvedRatingSum > 0
? (model.subProducts[index].approvedRatingSum.toDouble() /
model.subProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
),
),
],
), ),
), ),
onTap: () => { Padding(
Navigator.push( padding: const EdgeInsets.all(8.0),
context, child: Text(
FadePage( 'There is no data',
page: ProductDetailPage(model.subProducts[index]), style: TextStyle(fontSize: 30),
)), ),
}, )
); ],
}), ),
),
),
) )
], ],
), ),

Loading…
Cancel
Save