|
|
|
@ -540,29 +540,61 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
child: Button(
|
|
|
|
child: Button(
|
|
|
|
onTap:
|
|
|
|
onTap:
|
|
|
|
() async {String categoriesId = "";
|
|
|
|
() async {
|
|
|
|
for (CategoriseParentModel category in entityList) {
|
|
|
|
String
|
|
|
|
if (categoriesId == "") {categoriesId = category.id;
|
|
|
|
categoriesId =
|
|
|
|
|
|
|
|
"";
|
|
|
|
|
|
|
|
for (CategoriseParentModel category
|
|
|
|
|
|
|
|
in entityList) {
|
|
|
|
|
|
|
|
if (categoriesId ==
|
|
|
|
|
|
|
|
"") {
|
|
|
|
|
|
|
|
categoriesId =
|
|
|
|
|
|
|
|
category
|
|
|
|
|
|
|
|
.id;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
categoriesId = "$categoriesId,${category.id}";
|
|
|
|
categoriesId =
|
|
|
|
|
|
|
|
"$categoriesId,${category.id}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String brandIds = "";
|
|
|
|
String
|
|
|
|
for (CategoriseParentModel brand in entityListBrands) {
|
|
|
|
brandIds =
|
|
|
|
if (brandIds == "") {brandIds = brand.id;
|
|
|
|
"";
|
|
|
|
|
|
|
|
for (CategoriseParentModel brand
|
|
|
|
|
|
|
|
in entityListBrands) {
|
|
|
|
|
|
|
|
if (brandIds ==
|
|
|
|
|
|
|
|
"") {
|
|
|
|
|
|
|
|
brandIds =
|
|
|
|
|
|
|
|
brand
|
|
|
|
|
|
|
|
.id;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
brandIds = "$brandIds,${brand.id}";
|
|
|
|
brandIds =
|
|
|
|
|
|
|
|
"$brandIds,${brand.id}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
|
|
|
.showMyDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
|
|
|
|
await model.getFilteredSubProducts(min: minField.text.toString(),
|
|
|
|
await model.getFilteredSubProducts(
|
|
|
|
max: maxField.text.toString(), categoryId: categoriesId,
|
|
|
|
min: minField
|
|
|
|
brandId: brandIds);
|
|
|
|
.text
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
.toString(),
|
|
|
|
Navigator.pop(context);
|
|
|
|
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',
|
|
|
|
// 'Apply',
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor:
|
|
|
|
Colors
|
|
|
|
Colors
|
|
|
|
@ -630,7 +662,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
thickness: 1.0,
|
|
|
|
thickness: 1.0,
|
|
|
|
color: Colors.grey.shade400,
|
|
|
|
color: Colors.grey.shade400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
styleOne == true
|
|
|
|
model.subProducts.isNotEmpty
|
|
|
|
|
|
|
|
? styleOne == true
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
height: model.subProducts.length *
|
|
|
|
height: model.subProducts.length *
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
@ -645,7 +678,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
childAspectRatio: 0.9,
|
|
|
|
childAspectRatio: 0.9,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
itemCount: model.subProducts.length,
|
|
|
|
itemCount: model.subProducts.length,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
itemBuilder:
|
|
|
|
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
return NetworkBaseView(
|
|
|
|
return NetworkBaseView(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
@ -680,8 +714,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
borderRadius:
|
|
|
|
topLeft: Radius.circular(110.0),
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft:
|
|
|
|
|
|
|
|
Radius.circular(110.0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -698,8 +734,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Stack(
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin:
|
|
|
|
margin: EdgeInsets
|
|
|
|
EdgeInsets.fromLTRB(
|
|
|
|
.fromLTRB(
|
|
|
|
0, 16, 0, 0),
|
|
|
|
0, 16, 0, 0),
|
|
|
|
alignment:
|
|
|
|
alignment:
|
|
|
|
Alignment.center,
|
|
|
|
Alignment.center,
|
|
|
|
@ -733,9 +769,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration:
|
|
|
|
color:
|
|
|
|
BoxDecoration(
|
|
|
|
Color(0xffb23838),
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xffb23838),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.only(
|
|
|
|
BorderRadius.only(
|
|
|
|
topLeft: Radius
|
|
|
|
topLeft: Radius
|
|
|
|
@ -743,7 +780,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
6)),
|
|
|
|
6)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.subProducts[index]
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
.rxMessage !=
|
|
|
|
.rxMessage !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? model
|
|
|
|
? model
|
|
|
|
@ -761,7 +800,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(
|
|
|
|
horizontal: 6,
|
|
|
|
horizontal: 6,
|
|
|
|
vertical: 0,
|
|
|
|
vertical: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -771,7 +811,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
.start,
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
model.subProducts[index]
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
.name,
|
|
|
|
.name,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
@ -798,21 +840,20 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
index]
|
|
|
|
index]
|
|
|
|
.approvedRatingSum >
|
|
|
|
.approvedRatingSum >
|
|
|
|
0
|
|
|
|
0
|
|
|
|
? (model.subProducts[index].approvedRatingSum
|
|
|
|
? (model.subProducts[index].approvedRatingSum.toDouble() /
|
|
|
|
.toDouble() /
|
|
|
|
model.subProducts[index].approvedRatingSum
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[index]
|
|
|
|
|
|
|
|
.approvedRatingSum
|
|
|
|
|
|
|
|
.toDouble())
|
|
|
|
.toDouble())
|
|
|
|
.toDouble()
|
|
|
|
.toDouble()
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
forceStars: true),
|
|
|
|
forceStars:
|
|
|
|
|
|
|
|
true),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight:
|
|
|
|
FontWeight.w400,
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -828,7 +869,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: ProductDetailPage(
|
|
|
|
page: ProductDetailPage(
|
|
|
|
model.subProducts[index]),
|
|
|
|
model.subProducts[
|
|
|
|
|
|
|
|
index]),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
));
|
|
|
|
));
|
|
|
|
@ -865,8 +907,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin:
|
|
|
|
margin: EdgeInsets
|
|
|
|
EdgeInsets.fromLTRB(
|
|
|
|
.fromLTRB(
|
|
|
|
0, 0, 0, 0),
|
|
|
|
0, 0, 0, 0),
|
|
|
|
alignment:
|
|
|
|
alignment:
|
|
|
|
Alignment.center,
|
|
|
|
Alignment.center,
|
|
|
|
@ -904,9 +946,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration:
|
|
|
|
color:
|
|
|
|
BoxDecoration(
|
|
|
|
Color(0xffb23838),
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xffb23838),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.only(
|
|
|
|
BorderRadius.only(
|
|
|
|
topLeft: Radius
|
|
|
|
topLeft: Radius
|
|
|
|
@ -914,7 +957,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
6)),
|
|
|
|
6)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.subProducts[index]
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
.rxMessage !=
|
|
|
|
.rxMessage !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? model
|
|
|
|
? model
|
|
|
|
@ -944,19 +989,22 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
MainAxisAlignment
|
|
|
|
MainAxisAlignment
|
|
|
|
.spaceAround,
|
|
|
|
.spaceAround,
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 4.0,
|
|
|
|
height: 4.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width:
|
|
|
|
width: MediaQuery.of(
|
|
|
|
MediaQuery.of(context)
|
|
|
|
context)
|
|
|
|
.size
|
|
|
|
.size
|
|
|
|
.width *
|
|
|
|
.width *
|
|
|
|
0.65,
|
|
|
|
0.65,
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.subProducts[index]
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
.name,
|
|
|
|
.name,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 13.2,
|
|
|
|
fontSize: 13.2,
|
|
|
|
@ -970,8 +1018,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
const EdgeInsets.only(
|
|
|
|
const EdgeInsets
|
|
|
|
top: 4, bottom: 4),
|
|
|
|
.only(
|
|
|
|
|
|
|
|
top: 4,
|
|
|
|
|
|
|
|
bottom: 4),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
"SAR ${model.subProducts[index].price}",
|
|
|
|
"SAR ${model.subProducts[index].price}",
|
|
|
|
bold: true,
|
|
|
|
bold: true,
|
|
|
|
@ -986,14 +1036,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
index]
|
|
|
|
index]
|
|
|
|
.approvedRatingSum >
|
|
|
|
.approvedRatingSum >
|
|
|
|
0
|
|
|
|
0
|
|
|
|
? (model
|
|
|
|
? (model.subProducts[index].approvedRatingSum
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.approvedRatingSum
|
|
|
|
|
|
|
|
.toDouble() /
|
|
|
|
.toDouble() /
|
|
|
|
model
|
|
|
|
model
|
|
|
|
.subProducts[
|
|
|
|
.subProducts[index]
|
|
|
|
index]
|
|
|
|
|
|
|
|
.approvedRatingSum
|
|
|
|
.approvedRatingSum
|
|
|
|
.toDouble())
|
|
|
|
.toDouble())
|
|
|
|
.toDouble()
|
|
|
|
.toDouble()
|
|
|
|
@ -1025,6 +1071,34 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
: 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,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
'There is no data',
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 30),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|