Merge branch 'blood_pressure' into 'development'

parent product and sub product update

See merge request Cloud_Solution/diplomatic-quarter!389
merge-update-with-lab-changes
Mohammad Aljammal 4 years ago
commit cfe9e35c38

File diff suppressed because it is too large Load Diff

@ -23,8 +23,7 @@ class SubCategorisePage extends StatefulWidget {
SubCategorisePage({this.id, this.parentId, this.title}); SubCategorisePage({this.id, this.parentId, this.title});
@override @override
_SubCategorisePageState createState() => _SubCategorisePageState createState() => _SubCategorisePageState(id: id, title: title, parentId: parentId);
_SubCategorisePageState(id: id, title: title, parentId: parentId);
} }
class _SubCategorisePageState extends State<SubCategorisePage> { class _SubCategorisePageState extends State<SubCategorisePage> {
@ -52,9 +51,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
TextEditingController maxField = TextEditingController(); TextEditingController maxField = TextEditingController();
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getSubCategorise(i: id), onModelReady: (model) => model.getSubCategorise(i: id),
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => PharmacyAppScaffold(
Widget child) =>
PharmacyAppScaffold(
appBarTitle: title, appBarTitle: title,
isBottomBar: false, isBottomBar: false,
isShowAppBar: true, isShowAppBar: true,
@ -86,8 +83,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png'
: parentId == '9' : parentId == '9'
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png'
: parentId == : parentId == '10'
'10'
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png'
: '', : '',
fit: BoxFit.fill, fit: BoxFit.fill,
@ -99,14 +95,12 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
children: [ children: [
InkWell( InkWell(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Texts(TranslationBase.of(context) child: Texts(TranslationBase.of(context).viewCategorise),
.viewCategorise),
), ),
), ),
Icon(Icons.arrow_forward) Icon(Icons.arrow_forward)
@ -118,30 +112,21 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return Container(
height: height: MediaQuery.of(context).size.height * 0.89,
MediaQuery.of(context).size.height *
0.89,
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: itemCount: model.subCategorise.length,
model.subCategorise.length, itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context,
int index) {
return Container( return Container(
child: Padding( child: Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Texts(model Texts(model.subCategorise[index].name),
.subCategorise[
index]
.name),
Divider( Divider(
thickness: 0.6, thickness: 0.6,
color: Colors.black12, color: Colors.black12,
@ -152,12 +137,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: page: FinalProductsPage(
FinalProductsPage( id: model.subCategorise[index].id,
id: model
.subCategorise[
index]
.id,
), ),
), ),
); );
@ -190,23 +171,19 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemCount: model.subCategorise.length, itemCount: model.subCategorise.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 8.0),
EdgeInsets.symmetric(horizontal: 8.0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 13.0),
horizontal: 13.0),
child: Container( child: Container(
height: 60.0, height: 60.0,
width: 65.0, width: 65.0,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.orange.shade200 color: Colors.orange.shade200.withOpacity(0.45),
.withOpacity(0.45),
), ),
child: Center( child: Center(
child: Icon( child: Icon(
@ -217,14 +194,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
), ),
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.17,
.size height: MediaQuery.of(context).size.height * 0.10,
.width *
0.17,
height: MediaQuery.of(context)
.size
.height *
0.10,
child: Center( child: Center(
child: Texts( child: Texts(
model.subCategorise[index].name, model.subCategorise[index].name,
@ -285,21 +256,16 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
initialChildSize: 0.95, initialChildSize: 0.95,
maxChildSize: 0.95, maxChildSize: 0.95,
minChildSize: 0.9, minChildSize: 0.9,
builder: (BuildContext context, builder: (BuildContext context, ScrollController scrollController) {
ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: Container( child: Container(
color: Colors.white, color: Colors.white,
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 1.95,
.size
.height *
1.95,
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: padding: EdgeInsets.all(8.0),
EdgeInsets.all(8.0),
child: Row( child: Row(
children: [ children: [
Icon( Icon(
@ -309,30 +275,23 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
width: 10.0, width: 10.0,
), ),
Texts( Texts(
TranslationBase.of( TranslationBase.of(context).refine,
context)
.refine,
// 'Refine', // 'Refine',
fontWeight: fontWeight: FontWeight.w600,
FontWeight.w600,
), ),
SizedBox( SizedBox(
width: 250.0, width: 250.0,
), ),
InkWell( InkWell(
child: Texts( child: Texts(
TranslationBase.of( TranslationBase.of(context).closeIt,
context)
.closeIt,
// 'Close', // 'Close',
color: Colors.red, color: Colors.red,
fontWeight: fontWeight: FontWeight.w600,
FontWeight.w600,
fontSize: 15.0, fontSize: 15.0,
), ),
onTap: () { onTap: () {
Navigator.pop( Navigator.pop(context);
context);
}, },
), ),
], ],
@ -345,39 +304,27 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Column( Column(
children: [ children: [
ExpansionTile( ExpansionTile(
title: Texts( title: Texts(TranslationBase.of(context).categorise),
TranslationBase.of(
context)
.categorise),
children: [ children: [
ProcedureListWidget( ProcedureListWidget(
model: model, model: model,
masterList: model masterList: model.subCategorise,
.subCategorise, removeHistory: (item) {
removeHistory:
(item) {
setState(() { setState(() {
entityList entityList.remove(item);
.remove(
item);
}); });
}, },
addHistory: addHistory: (history) {
(history) {
setState(() { setState(() {
entityList.add( entityList.add(history);
history);
}); });
}, },
addSelectedHistories: addSelectedHistories: () {
() {
//TODO build your fun herr //TODO build your fun herr
// widget.addSelectedHistories(); // widget.addSelectedHistories();
}, },
isEntityListSelected: isEntityListSelected: (master) =>
(master) => isEntityListSelected(master),
isEntityListSelected(
master),
) )
], ],
), ),
@ -386,40 +333,27 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
color: Colors.black12, color: Colors.black12,
), ),
ExpansionTile( ExpansionTile(
title: Texts( title: Texts(TranslationBase.of(context).brands),
TranslationBase.of(
context)
.brands),
children: [ children: [
ProcedureListWidget( ProcedureListWidget(
model: model, model: model,
masterList: model masterList: model.brandsList,
.brandsList, removeHistory: (item) {
removeHistory:
(item) {
setState(() { setState(() {
entityListBrands entityListBrands.remove(item);
.remove(
item);
}); });
}, },
addHistory: addHistory: (history) {
(history) {
setState(() { setState(() {
entityListBrands entityListBrands.add(history);
.add(
history);
}); });
}, },
addSelectedHistories: addSelectedHistories: () {
() {
//TODO build your fun herr //TODO build your fun herr
// widget.addSelectedHistories(); // widget.addSelectedHistories();
}, },
isEntityListSelected: isEntityListSelected: (master) =>
(master) => isEntityListSelectedBrands(master),
isEntityListSelectedBrands(
master),
) )
], ],
), ),
@ -428,69 +362,43 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
color: Colors.black12, color: Colors.black12,
), ),
ExpansionTile( ExpansionTile(
title: Texts( title: Texts(TranslationBase.of(context).price),
TranslationBase.of(
context)
.price),
children: [ children: [
Container( Container(
color: Color( color: Color(0xffEEEEEE),
0xffEEEEEE),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceAround,
MainAxisAlignment
.spaceAround,
children: [ children: [
Column( Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment
.start,
children: [ children: [
Texts( Texts('Min'),
'Min'),
Container( Container(
color: Colors color: Colors.white,
.white, width: 200,
width: height: 40,
200, child: TextFormField(
height: decoration: InputDecoration(
40, border: OutlineInputBorder(),
child: ),
TextFormField( controller: minField,
decoration:
InputDecoration(
border:
OutlineInputBorder(),
),
controller:
minField,
), ),
), ),
], ],
), ),
Column( Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment
.start,
children: [ children: [
Texts( Texts('Max'),
'Max'),
Container( Container(
color: Colors color: Colors.white,
.white, width: 200,
width: height: 40,
200, child: TextFormField(
height: decoration: InputDecoration(
40, border: OutlineInputBorder(),
child: ),
TextFormField( controller: maxField,
decoration:
InputDecoration(
border:
OutlineInputBorder(),
),
controller:
maxField,
), ),
), ),
], ],
@ -505,31 +413,20 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
color: Colors.black12, color: Colors.black12,
), ),
SizedBox( SizedBox(
height: MediaQuery.of( height: MediaQuery.of(context).size.height * 0.4,
context)
.size
.height *
0.4,
), ),
Padding( Padding(
padding: padding: EdgeInsets.all(8.0),
EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment
.spaceEvenly,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
width: 100, width: 100,
child: Button( child: Button(
label: TranslationBase.of( label: TranslationBase.of(context).reset,
context)
.reset,
// 'Reset', // 'Reset',
backgroundColor: backgroundColor: Colors.red,
Colors
.red,
), ),
), ),
), ),
@ -539,66 +436,37 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Container( Container(
width: 200, width: 200,
child: Button( child: Button(
onTap: onTap: () async {
() async { String categoriesId = "";
String for (CategoriseParentModel category in entityList) {
categoriesId = if (categoriesId == "") {
""; categoriesId = category.id;
for (CategoriseParentModel category
in entityList) {
if (categoriesId ==
"") {
categoriesId =
category
.id;
} else { } else {
categoriesId = categoriesId = "$categoriesId,${category.id}";
"$categoriesId,${category.id}";
} }
} }
String String brandIds = "";
brandIds =
"";
for (CategoriseParentModel brand for (CategoriseParentModel brand
in entityListBrands) { in entityListBrands) {
if (brandIds == if (brandIds == "") {
"") { brandIds = brand.id;
brandIds =
brand
.id;
} else { } else {
brandIds = brandIds = "$brandIds,${brand.id}";
"$brandIds,${brand.id}";
} }
} }
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(context);
.showMyDialog(
context);
await model.getFilteredSubProducts( await model.getFilteredSubProducts(
min: minField min: minField.text.toString(),
.text max: maxField.text.toString(),
.toString(), categoryId: categoriesId,
max: maxField brandId: brandIds);
.text GifLoaderDialogUtils.hideDialog(context);
.toString(), Navigator.pop(context);
categoryId:
categoriesId,
brandId:
brandIds);
GifLoaderDialogUtils
.hideDialog(
context);
Navigator.pop(
context);
}, },
label: TranslationBase.of( label: TranslationBase.of(context).apply,
context)
.apply,
// 'Apply', // 'Apply',
backgroundColor: backgroundColor: Colors.green,
Colors
.green,
), ),
), ),
], ],
@ -662,15 +530,13 @@ 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 * 0.15,
MediaQuery.of(context).size.height *
0.15,
child: GridView.builder( child: GridView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 0.5, crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0, mainAxisSpacing: 2.0,
@ -682,9 +548,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
baseViewModel: model, baseViewModel: model,
child: InkWell( child: InkWell(
child: Card( child: Card(
color: model.subProducts[index] color: model.subProducts[index].discountName != null
.discountName !=
null
? Color(0xffFFFF00) ? Color(0xffFFFF00)
: Colors.white, : Colors.white,
elevation: 0, elevation: 0,
@ -717,77 +581,42 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 0),
horizontal: 0), width: MediaQuery.of(context).size.width / 3,
width: MediaQuery.of(context)
.size
.width /
3,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Stack( Stack(
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
EdgeInsets.fromLTRB( alignment: Alignment.center,
0, 16, 0, 0),
alignment:
Alignment.center,
child: Image.network( child: Image.network(
model model.subProducts[index].images.isNotEmpty
.subProducts[ ? model.subProducts[index].images[0].thumb
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', : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
), ),
), ),
Container( Container(
width: model width: model.subProducts[index].rxMessage != null
.subProducts[ ? MediaQuery.of(context).size.width / 5
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5
: 0, : 0,
padding: padding: EdgeInsets.all(4),
EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Color(0xffb23838),
Color(0xffb23838),
borderRadius: borderRadius:
BorderRadius.only( BorderRadius.only(topLeft: Radius.circular(6)),
topLeft: Radius
.circular(
6)),
), ),
child: Texts( child: Texts(
model.subProducts[index] model.subProducts[index].rxMessage != null
.rxMessage != ? model.subProducts[index].rxMessage
null
? model
.subProducts[
index]
.rxMessage
: "", : "",
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
), ),
), ),
], ],
@ -798,24 +627,16 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Texts( Texts(
model.subProducts[index] model.subProducts[index].name,
.name,
regular: true, regular: true,
fontSize: 12, fontSize: 12,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(top: 4, bottom: 4),
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts( child: Texts(
"SAR ${model.subProducts[index].price}", "SAR ${model.subProducts[index].price}",
bold: true, bold: true,
@ -825,15 +646,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Row( Row(
children: [ children: [
StarRating( StarRating(
totalAverage: model totalAverage:
.subProducts[ model.subProducts[index].approvedRatingSum > 0
index]
.approvedRatingSum >
0
? (model.subProducts[index].approvedRatingSum ? (model.subProducts[index].approvedRatingSum
.toDouble() / .toDouble() /
model model.subProducts[index]
.subProducts[index]
.approvedRatingSum .approvedRatingSum
.toDouble()) .toDouble())
.toDouble() .toDouble()
@ -843,8 +660,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
"(${model.subProducts[index].approvedTotalReviews})", "(${model.subProducts[index].approvedTotalReviews})",
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
) )
], ],
), ),
@ -859,8 +675,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ProductDetailPage( page: ProductDetailPage(model.subProducts[index]),
model.subProducts[index]),
)), )),
}, },
)); ));
@ -868,14 +683,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
) )
: Container( : Container(
height: model.subProducts.length * height: model.subProducts.length * MediaQuery.of(context).size.height * 0.122,
MediaQuery.of(context).size.height *
0.122,
child: ListView.builder( child: ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
itemBuilder: itemBuilder: (BuildContext context, int index) {
(BuildContext context, int index) {
return InkWell( return InkWell(
child: Card( child: Card(
child: Row( child: Row(
@ -885,11 +697,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Column( Column(
children: [ children: [
Container( Container(
decoration: decoration: BoxDecoration(),
BoxDecoration(),
child: Padding( child: Padding(
padding: padding: EdgeInsets.only(
EdgeInsets.only(
left: 9.0, left: 9.0,
top: 8.0, top: 8.0,
right: 10.0, right: 10.0,
@ -897,22 +707,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
EdgeInsets.fromLTRB( alignment: Alignment.center,
0, 0, 0, 0),
alignment:
Alignment.center,
child: Image.network( child: Image.network(
model model.subProducts[index].images.isNotEmpty
.subProducts[ ? model.subProducts[index].images[0].thumb
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', : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain, fit: BoxFit.contain,
height: 80, height: 80,
@ -923,42 +722,23 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Column( Column(
children: [ children: [
Container( Container(
width: model width: model.subProducts[index].rxMessage != null
.subProducts[ ? MediaQuery.of(context).size.width / 5
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5
: 0, : 0,
padding: padding: EdgeInsets.all(4),
EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Color(0xffb23838),
Color(0xffb23838),
borderRadius: borderRadius:
BorderRadius.only( BorderRadius.only(topLeft: Radius.circular(6)),
topLeft: Radius
.circular(
6)),
), ),
child: Texts( child: Texts(
model.subProducts[index] model.subProducts[index].rxMessage != null
.rxMessage != ? model.subProducts[index].rxMessage
null
? model
.subProducts[
index]
.rxMessage
: "", : "",
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
), ),
), ),
], ],
@ -972,28 +752,19 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceAround,
MainAxisAlignment crossAxisAlignment: CrossAxisAlignment.start,
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 4.0, height: 4.0,
), ),
Container( Container(
width: width: MediaQuery.of(context).size.width * 0.65,
MediaQuery.of(context)
.size
.width *
0.65,
child: Texts( child: Texts(
model.subProducts[index] model.subProducts[index].name,
.name,
regular: true, regular: true,
fontSize: 13.2, fontSize: 13.2,
fontWeight: fontWeight: FontWeight.w500,
FontWeight.w500,
maxLines: 5, maxLines: 5,
), ),
), ),
@ -1001,9 +772,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
height: 8.0, height: 8.0,
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(top: 4, bottom: 4),
const EdgeInsets.only(
top: 4, bottom: 4),
child: Texts( child: Texts(
"SAR ${model.subProducts[index].price}", "SAR ${model.subProducts[index].price}",
bold: true, bold: true,
@ -1013,20 +782,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Row( Row(
children: [ children: [
StarRating( StarRating(
totalAverage: model totalAverage:
.subProducts[ model.subProducts[index].approvedRatingSum > 0
index] ? (model.subProducts[index].approvedRatingSum
.approvedRatingSum >
0
? (model
.subProducts[
index]
.approvedRatingSum
.toDouble() / .toDouble() /
model model.subProducts[index].approvedRatingSum
.subProducts[
index]
.approvedRatingSum
.toDouble()) .toDouble())
.toDouble() .toDouble()
: 0, : 0,
@ -1035,8 +795,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
"(${model.subProducts[index].approvedTotalReviews})", "(${model.subProducts[index].approvedTotalReviews})",
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
) )
], ],
), ),
@ -1050,13 +809,40 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
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),
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),
),
)
],
),
),
),
)
], ],
), ),
), ),
@ -1065,8 +851,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
} }
bool isEntityListSelected(CategoriseParentModel masterKey) { bool isEntityListSelected(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history = Iterable<CategoriseParentModel> history = entityList.where((element) => masterKey.id == element.id);
entityList.where((element) => masterKey.id == element.id);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
@ -1074,8 +859,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
} }
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) { bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
Iterable<CategoriseParentModel> history = Iterable<CategoriseParentModel> history = entityListBrands.where((element) => masterKey.id == element.id);
entityListBrands.where((element) => masterKey.id == element.id);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }

Loading…
Cancel
Save