parent product and sub product update

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

@ -547,113 +547,256 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
thickness: 1.0,
color: Colors.grey.shade400,
),
styleOne == true
? Container(
height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15,
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0,
childAspectRatio: 0.9,
),
itemCount: model.parentProducts.length,
itemBuilder: (BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: InkWell(
child: Card(
color: model.parentProducts[index].discountName != null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
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),
model.parentProducts.isNotEmpty
? styleOne == true
? Container(
height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15,
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0,
childAspectRatio: 0.9,
),
itemCount: model.parentProducts.length,
itemBuilder: (BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: InkWell(
child: Card(
color: model.parentProducts[index].discountName != null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
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,
),
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),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
onTap: () => {
Navigator.push(
context,
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: [
Stack(
children: [
if (model.parentProducts[index].discountName != null)
RotatedBox(
quarterTurns: 4,
child: Container(
Column(
children: [
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,
left: 9.0,
top: 8.0,
right: 10.0,
),
),
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(
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,
),
),
],
),
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,
),
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,
),
),
],
),
],
),
@ -663,29 +806,24 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
vertical: 0,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
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,
),
),
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,
),
Texts(
model.parentProducts[index].name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w700,
),
SizedBox(
height: 8.0,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
@ -722,148 +860,43 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
],
),
),
),
onTap: () => {
Navigator.push(
context,
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: [
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.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: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model.parentProducts[index]),
)),
},
);
}),
)
: Padding(
padding: const EdgeInsets.all(12.0),
child: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model.parentProducts[index]),
)),
},
);
}),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'There is no data',
style: TextStyle(fontSize: 30),
),
)
],
),
),
),
)
],
),

@ -522,108 +522,246 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
thickness: 1.0,
color: Colors.grey.shade400,
),
styleOne == true
? Container(
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.15,
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0,
childAspectRatio: 0.9,
),
itemCount: model.subProducts.length,
itemBuilder: (BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: InkWell(
child: Card(
color: model.subProducts[index].discountName != null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
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),
model.subProducts.isNotEmpty
? styleOne == true
? Container(
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.15,
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0,
childAspectRatio: 0.9,
),
itemCount: model.subProducts.length,
itemBuilder: (BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: InkWell(
child: Card(
color: model.subProducts[index].discountName != null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
),
color: Colors.white,
),
padding: EdgeInsets.symmetric(horizontal: 0),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
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: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 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.cover,
height: 80,
),
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 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.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(
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)),
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Texts(
model.subProducts[index].rxMessage != null
? model.subProducts[index].rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
model.subProducts[index].name,
regular: true,
fontSize: 12,
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(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
model.subProducts[index].name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
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),
@ -659,147 +797,43 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
],
),
),
),
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(
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: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model.subProducts[index]),
)),
},
);
}),
)
: Padding(
padding: const EdgeInsets.all(12.0),
child: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
'assets/images/new-design/empty_box.png',
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model.subProducts[index]),
)),
},
);
}),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'There is no data',
style: TextStyle(fontSize: 30),
),
)
],
),
),
),
)
],
),

Loading…
Cancel
Save