|
|
|
|
@ -540,29 +540,61 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
|
width: 200,
|
|
|
|
|
child: Button(
|
|
|
|
|
onTap:
|
|
|
|
|
() async {String categoriesId = "";
|
|
|
|
|
for (CategoriseParentModel category in entityList) {
|
|
|
|
|
if (categoriesId == "") {categoriesId = category.id;
|
|
|
|
|
() async {
|
|
|
|
|
String
|
|
|
|
|
categoriesId =
|
|
|
|
|
"";
|
|
|
|
|
for (CategoriseParentModel category
|
|
|
|
|
in entityList) {
|
|
|
|
|
if (categoriesId ==
|
|
|
|
|
"") {
|
|
|
|
|
categoriesId =
|
|
|
|
|
category
|
|
|
|
|
.id;
|
|
|
|
|
} else {
|
|
|
|
|
categoriesId = "$categoriesId,${category.id}";
|
|
|
|
|
categoriesId =
|
|
|
|
|
"$categoriesId,${category.id}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String brandIds = "";
|
|
|
|
|
for (CategoriseParentModel brand in entityListBrands) {
|
|
|
|
|
if (brandIds == "") {brandIds = brand.id;
|
|
|
|
|
String
|
|
|
|
|
brandIds =
|
|
|
|
|
"";
|
|
|
|
|
for (CategoriseParentModel brand
|
|
|
|
|
in entityListBrands) {
|
|
|
|
|
if (brandIds ==
|
|
|
|
|
"") {
|
|
|
|
|
brandIds =
|
|
|
|
|
brand
|
|
|
|
|
.id;
|
|
|
|
|
} else {
|
|
|
|
|
brandIds = "$brandIds,${brand.id}";
|
|
|
|
|
brandIds =
|
|
|
|
|
"$brandIds,${brand.id}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
|
|
await model.getFilteredSubProducts(min: minField.text.toString(),
|
|
|
|
|
max: maxField.text.toString(), categoryId: categoriesId,
|
|
|
|
|
brandId: brandIds);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
await model.getFilteredSubProducts(
|
|
|
|
|
min: minField
|
|
|
|
|
.text
|
|
|
|
|
.toString(),
|
|
|
|
|
max: maxField
|
|
|
|
|
.text
|
|
|
|
|
.toString(),
|
|
|
|
|
categoryId:
|
|
|
|
|
categoriesId,
|
|
|
|
|
brandId:
|
|
|
|
|
brandIds);
|
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
.hideDialog(
|
|
|
|
|
context);
|
|
|
|
|
Navigator.pop(
|
|
|
|
|
context);
|
|
|
|
|
},
|
|
|
|
|
label: TranslationBase.of(context).apply,
|
|
|
|
|
label: TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.apply,
|
|
|
|
|
// 'Apply',
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Colors
|
|
|
|
|
@ -630,153 +662,359 @@ 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
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
model
|
|
|
|
|
.subProducts[
|
|
|
|
|
index]
|
|
|
|
|
.rxMessage
|
|
|
|
|
: "",
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
regular: true,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w400,
|
|
|
|
|
.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:
|
|
|
|
|
@ -822,208 +1060,44 @@ 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),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|