Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into fatima-new

# Conflicts:
#	lib/pages/sub_categorise_page.dart
merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
commit b3285f4528

File diff suppressed because it is too large Load Diff

@ -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,153 +662,359 @@ 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 * ? Container(
MediaQuery.of(context).size.height * height: model.subProducts.length *
0.15, MediaQuery.of(context).size.height *
child: GridView.builder( 0.15,
physics: NeverScrollableScrollPhysics(), child: GridView.builder(
gridDelegate: physics: NeverScrollableScrollPhysics(),
SliverGridDelegateWithFixedCrossAxisCount( gridDelegate:
crossAxisCount: 2, 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:
baseViewModel: model, (BuildContext context, int index) {
child: InkWell( return NetworkBaseView(
child: Card( baseViewModel: model,
color: model.subProducts[index] child: InkWell(
.discountName != child: Card(
null color: model.subProducts[index]
? Color(0xffFFFF00) .discountName !=
: Colors.white, null
elevation: 0, ? Color(0xffFFFF00)
shape: Border( : Colors.white,
right: BorderSide( elevation: 0,
color: Colors.grey.shade300, shape: Border(
width: 1, right: BorderSide(
), color: Colors.grey.shade300,
left: BorderSide( width: 1,
color: Colors.grey.shade300, ),
width: 1, left: BorderSide(
), color: Colors.grey.shade300,
bottom: BorderSide( width: 1,
color: Colors.grey.shade300, ),
width: 1, bottom: BorderSide(
), color: Colors.grey.shade300,
top: BorderSide( width: 1,
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, margin: EdgeInsets.symmetric(
), horizontal: 8,
padding: EdgeInsets.symmetric( vertical: 4,
horizontal: 0), ),
width: MediaQuery.of(context) child: Container(
.size decoration: BoxDecoration(
.width / borderRadius:
3, BorderRadius.only(
child: Column( topLeft:
crossAxisAlignment: Radius.circular(110.0),
CrossAxisAlignment.start, ),
children: [ color: Colors.white,
Stack( ),
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Stack(
margin: children: [
EdgeInsets.fromLTRB( Container(
0, 16, 0, 0), margin: EdgeInsets
alignment: .fromLTRB(
Alignment.center, 0, 16, 0, 0),
child: Image.network( alignment:
model Alignment.center,
.subProducts[ child: Image.network(
index] model
.images .subProducts[
.isNotEmpty index]
? model .images
.subProducts[ .isNotEmpty
index] ? model
.images[0] .subProducts[
.thumb index]
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', .images[0]
fit: BoxFit.cover, .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 margin:
.subProducts[ EdgeInsets.symmetric(
index] horizontal: 6,
.rxMessage != vertical: 0,
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( child: Column(
model.subProducts[index] crossAxisAlignment:
.rxMessage != CrossAxisAlignment
null .start,
? model children: [
Texts(
model
.subProducts[ .subProducts[
index] index]
.rxMessage .name,
: "", regular: true,
color: Colors.white, fontSize: 12,
regular: true, fontWeight:
fontSize: 10, 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:
CrossAxisAlignment CrossAxisAlignment
.start, .start,
children: [ children: [
Texts( SizedBox(
model.subProducts[index] height: 4.0,
.name, ),
regular: true, Container(
fontSize: 12, width: MediaQuery.of(
fontWeight: context)
FontWeight.w400, .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: padding:
@ -822,208 +1060,44 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
], ],
), ),
), ),
), onTap: () => {
onTap: () => { Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: ProductDetailPage(
page: ProductDetailPage( model.subProducts[index]),
model.subProducts[index]), )),
)), },
}, );
)); }),
}, )
), : Padding(
) padding: const EdgeInsets.all(12.0),
: Container( child: Container(
height: model.subProducts.length * child: Center(
MediaQuery.of(context).size.height * child: Column(
0.122, mainAxisAlignment: MainAxisAlignment.center,
child: ListView.builder( children: [
physics: NeverScrollableScrollPhysics(), Padding(
itemCount: model.subProducts.length, padding: const EdgeInsets.all(8.0),
itemBuilder: child: Image.asset(
(BuildContext context, int index) { 'assets/images/new-design/empty_box.png',
return InkWell( width: 100,
child: Card( height: 100,
child: Row( fit: BoxFit.cover,
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: () => { Padding(
Navigator.push( padding: const EdgeInsets.all(8.0),
context, child: Text(
FadePage( 'There is no data',
page: ProductDetailPage( style: TextStyle(fontSize: 30),
model.subProducts[index]), ),
)), )
}, ],
); ),
}), ),
),
) )
], ],
), ),

Loading…
Cancel
Save