|
|
|
@ -23,7 +23,8 @@ class SubCategorisePage extends StatefulWidget {
|
|
|
|
SubCategorisePage({this.id, this.parentId, this.title});
|
|
|
|
SubCategorisePage({this.id, this.parentId, this.title});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_SubCategorisePageState createState() => _SubCategorisePageState(id: id, title: title, parentId: parentId);
|
|
|
|
_SubCategorisePageState createState() =>
|
|
|
|
|
|
|
|
_SubCategorisePageState(id: id, title: title, parentId: parentId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
@ -51,7 +52,9 @@ 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, Widget child) => PharmacyAppScaffold(
|
|
|
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
|
|
|
|
|
|
|
Widget child) =>
|
|
|
|
|
|
|
|
PharmacyAppScaffold(
|
|
|
|
appBarTitle: title,
|
|
|
|
appBarTitle: title,
|
|
|
|
isBottomBar: false,
|
|
|
|
isBottomBar: false,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
@ -83,7 +86,8 @@ 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 == '10'
|
|
|
|
: parentId ==
|
|
|
|
|
|
|
|
'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,
|
|
|
|
@ -95,12 +99,14 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
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).viewCategorise),
|
|
|
|
child: Texts(TranslationBase.of(context)
|
|
|
|
|
|
|
|
.viewCategorise),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Icon(Icons.arrow_forward)
|
|
|
|
Icon(Icons.arrow_forward)
|
|
|
|
@ -112,21 +118,30 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.89,
|
|
|
|
height:
|
|
|
|
|
|
|
|
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: model.subCategorise.length,
|
|
|
|
itemCount:
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
model.subCategorise.length,
|
|
|
|
|
|
|
|
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.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(model.subCategorise[index].name),
|
|
|
|
Texts(model
|
|
|
|
|
|
|
|
.subCategorise[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.name),
|
|
|
|
Divider(
|
|
|
|
Divider(
|
|
|
|
thickness: 0.6,
|
|
|
|
thickness: 0.6,
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
@ -137,8 +152,12 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: FinalProductsPage(
|
|
|
|
page:
|
|
|
|
id: model.subCategorise[index].id,
|
|
|
|
FinalProductsPage(
|
|
|
|
|
|
|
|
id: model
|
|
|
|
|
|
|
|
.subCategorise[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.id,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -171,19 +190,23 @@ 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: EdgeInsets.symmetric(horizontal: 8.0),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 8.0),
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 13.0),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
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.withOpacity(0.45),
|
|
|
|
color: Colors.orange.shade200
|
|
|
|
|
|
|
|
.withOpacity(0.45),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Icon(
|
|
|
|
child: Icon(
|
|
|
|
@ -194,8 +217,14 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.17,
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
height: MediaQuery.of(context).size.height * 0.10,
|
|
|
|
.size
|
|
|
|
|
|
|
|
.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,
|
|
|
|
@ -256,16 +285,21 @@ 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, ScrollController scrollController) {
|
|
|
|
builder: (BuildContext context,
|
|
|
|
|
|
|
|
ScrollController scrollController) {
|
|
|
|
return SingleChildScrollView(
|
|
|
|
return SingleChildScrollView(
|
|
|
|
controller: scrollController,
|
|
|
|
controller: scrollController,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
height: MediaQuery.of(context).size.height * 1.95,
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
|
|
|
|
1.95,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.all(8.0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
@ -275,23 +309,30 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
width: 10.0,
|
|
|
|
width: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
TranslationBase.of(context).refine,
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.refine,
|
|
|
|
// 'Refine',
|
|
|
|
// 'Refine',
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w600,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
width: 250.0,
|
|
|
|
width: 250.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase.of(context).closeIt,
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.closeIt,
|
|
|
|
// 'Close',
|
|
|
|
// 'Close',
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w600,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(
|
|
|
|
|
|
|
|
context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -304,27 +345,39 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ExpansionTile(
|
|
|
|
ExpansionTile(
|
|
|
|
title: Texts(TranslationBase.of(context).categorise),
|
|
|
|
title: Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.categorise),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ProcedureListWidget(
|
|
|
|
ProcedureListWidget(
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
masterList: model.subCategorise,
|
|
|
|
masterList: model
|
|
|
|
removeHistory: (item) {
|
|
|
|
.subCategorise,
|
|
|
|
|
|
|
|
removeHistory:
|
|
|
|
|
|
|
|
(item) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityList.remove(item);
|
|
|
|
entityList
|
|
|
|
|
|
|
|
.remove(
|
|
|
|
|
|
|
|
item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addHistory: (history) {
|
|
|
|
addHistory:
|
|
|
|
|
|
|
|
(history) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityList.add(history);
|
|
|
|
entityList.add(
|
|
|
|
|
|
|
|
history);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addSelectedHistories: () {
|
|
|
|
addSelectedHistories:
|
|
|
|
|
|
|
|
() {
|
|
|
|
//TODO build your fun herr
|
|
|
|
//TODO build your fun herr
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isEntityListSelected: (master) =>
|
|
|
|
isEntityListSelected:
|
|
|
|
isEntityListSelected(master),
|
|
|
|
(master) =>
|
|
|
|
|
|
|
|
isEntityListSelected(
|
|
|
|
|
|
|
|
master),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -333,27 +386,40 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ExpansionTile(
|
|
|
|
ExpansionTile(
|
|
|
|
title: Texts(TranslationBase.of(context).brands),
|
|
|
|
title: Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.brands),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ProcedureListWidget(
|
|
|
|
ProcedureListWidget(
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
masterList: model.brandsList,
|
|
|
|
masterList: model
|
|
|
|
removeHistory: (item) {
|
|
|
|
.brandsList,
|
|
|
|
|
|
|
|
removeHistory:
|
|
|
|
|
|
|
|
(item) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityListBrands.remove(item);
|
|
|
|
entityListBrands
|
|
|
|
|
|
|
|
.remove(
|
|
|
|
|
|
|
|
item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addHistory: (history) {
|
|
|
|
addHistory:
|
|
|
|
|
|
|
|
(history) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityListBrands.add(history);
|
|
|
|
entityListBrands
|
|
|
|
|
|
|
|
.add(
|
|
|
|
|
|
|
|
history);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addSelectedHistories: () {
|
|
|
|
addSelectedHistories:
|
|
|
|
|
|
|
|
() {
|
|
|
|
//TODO build your fun herr
|
|
|
|
//TODO build your fun herr
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isEntityListSelected: (master) =>
|
|
|
|
isEntityListSelected:
|
|
|
|
isEntityListSelectedBrands(master),
|
|
|
|
(master) =>
|
|
|
|
|
|
|
|
isEntityListSelectedBrands(
|
|
|
|
|
|
|
|
master),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -362,43 +428,69 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ExpansionTile(
|
|
|
|
ExpansionTile(
|
|
|
|
title: Texts(TranslationBase.of(context).price),
|
|
|
|
title: Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.price),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Color(0xffEEEEEE),
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xffEEEEEE),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceAround,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts('Min'),
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
'Min'),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors
|
|
|
|
width: 200,
|
|
|
|
.white,
|
|
|
|
height: 40,
|
|
|
|
width:
|
|
|
|
child: TextFormField(
|
|
|
|
200,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
height:
|
|
|
|
border: OutlineInputBorder(),
|
|
|
|
40,
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
TextFormField(
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
border:
|
|
|
|
|
|
|
|
OutlineInputBorder(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
controller: minField,
|
|
|
|
controller:
|
|
|
|
|
|
|
|
minField,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts('Max'),
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
'Max'),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors
|
|
|
|
width: 200,
|
|
|
|
.white,
|
|
|
|
height: 40,
|
|
|
|
width:
|
|
|
|
child: TextFormField(
|
|
|
|
200,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
height:
|
|
|
|
border: OutlineInputBorder(),
|
|
|
|
40,
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
TextFormField(
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
border:
|
|
|
|
|
|
|
|
OutlineInputBorder(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
controller: maxField,
|
|
|
|
controller:
|
|
|
|
|
|
|
|
maxField,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -413,20 +505,31 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.4,
|
|
|
|
height: MediaQuery.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
|
|
|
|
0.4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.all(8.0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceEvenly,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
width: 100,
|
|
|
|
width: 100,
|
|
|
|
child: Button(
|
|
|
|
child: Button(
|
|
|
|
label: TranslationBase.of(context).reset,
|
|
|
|
label: TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.reset,
|
|
|
|
// 'Reset',
|
|
|
|
// 'Reset',
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
backgroundColor:
|
|
|
|
|
|
|
|
Colors
|
|
|
|
|
|
|
|
.red,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -436,37 +539,66 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
child: Button(
|
|
|
|
child: Button(
|
|
|
|
onTap: () async {
|
|
|
|
onTap:
|
|
|
|
String categoriesId = "";
|
|
|
|
() async {
|
|
|
|
for (CategoriseParentModel category in entityList) {
|
|
|
|
String
|
|
|
|
if (categoriesId == "") {
|
|
|
|
categoriesId =
|
|
|
|
categoriesId = category.id;
|
|
|
|
"";
|
|
|
|
|
|
|
|
for (CategoriseParentModel category
|
|
|
|
|
|
|
|
in entityList) {
|
|
|
|
|
|
|
|
if (categoriesId ==
|
|
|
|
|
|
|
|
"") {
|
|
|
|
|
|
|
|
categoriesId =
|
|
|
|
|
|
|
|
category
|
|
|
|
|
|
|
|
.id;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
categoriesId = "$categoriesId,${category.id}";
|
|
|
|
categoriesId =
|
|
|
|
|
|
|
|
"$categoriesId,${category.id}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String brandIds = "";
|
|
|
|
String
|
|
|
|
|
|
|
|
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,${brand.id}";
|
|
|
|
brandIds =
|
|
|
|
|
|
|
|
"$brandIds,${brand.id}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
|
|
|
.showMyDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
|
|
|
|
await model.getFilteredSubProducts(
|
|
|
|
await model.getFilteredSubProducts(
|
|
|
|
min: minField.text.toString(),
|
|
|
|
min: minField
|
|
|
|
max: maxField.text.toString(),
|
|
|
|
.text
|
|
|
|
categoryId: categoriesId,
|
|
|
|
.toString(),
|
|
|
|
brandId: brandIds);
|
|
|
|
max: maxField
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
.text
|
|
|
|
Navigator.pop(context);
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
categoryId:
|
|
|
|
|
|
|
|
categoriesId,
|
|
|
|
|
|
|
|
brandId:
|
|
|
|
|
|
|
|
brandIds);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
|
|
|
.hideDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
Navigator.pop(
|
|
|
|
|
|
|
|
context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: TranslationBase.of(context).apply,
|
|
|
|
label: TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.apply,
|
|
|
|
// 'Apply',
|
|
|
|
// 'Apply',
|
|
|
|
backgroundColor: Colors.green,
|
|
|
|
backgroundColor:
|
|
|
|
|
|
|
|
Colors
|
|
|
|
|
|
|
|
.green,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -533,22 +665,28 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
model.subProducts.isNotEmpty
|
|
|
|
model.subProducts.isNotEmpty
|
|
|
|
? styleOne == true
|
|
|
|
? styleOne == true
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.15,
|
|
|
|
height: model.subProducts.length *
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.15,
|
|
|
|
child: GridView.builder(
|
|
|
|
child: GridView.builder(
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
gridDelegate:
|
|
|
|
|
|
|
|
SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
crossAxisCount: 2,
|
|
|
|
crossAxisCount: 2,
|
|
|
|
crossAxisSpacing: 0.5,
|
|
|
|
crossAxisSpacing: 0.5,
|
|
|
|
mainAxisSpacing: 2.0,
|
|
|
|
mainAxisSpacing: 2.0,
|
|
|
|
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(
|
|
|
|
child: Card(
|
|
|
|
child: Card(
|
|
|
|
color: model.subProducts[index].discountName != null
|
|
|
|
color: model.subProducts[index]
|
|
|
|
|
|
|
|
.discountName !=
|
|
|
|
|
|
|
|
null
|
|
|
|
? Color(0xffFFFF00)
|
|
|
|
? Color(0xffFFFF00)
|
|
|
|
: Colors.white,
|
|
|
|
: Colors.white,
|
|
|
|
elevation: 0,
|
|
|
|
elevation: 0,
|
|
|
|
@ -576,67 +714,118 @@ 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,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 0),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
width: MediaQuery.of(context).size.width / 3,
|
|
|
|
horizontal: 0),
|
|
|
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width /
|
|
|
|
|
|
|
|
3,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
|
|
margin: EdgeInsets
|
|
|
|
alignment: Alignment.center,
|
|
|
|
.fromLTRB(
|
|
|
|
|
|
|
|
0, 16, 0, 0),
|
|
|
|
|
|
|
|
alignment:
|
|
|
|
|
|
|
|
Alignment.center,
|
|
|
|
child: Image.network(
|
|
|
|
child: Image.network(
|
|
|
|
model.subProducts[index].images.isNotEmpty
|
|
|
|
model
|
|
|
|
? model.subProducts[index].images[0].thumb
|
|
|
|
.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',
|
|
|
|
: '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.subProducts[index].rxMessage != null
|
|
|
|
width: model
|
|
|
|
? MediaQuery.of(context).size.width / 5
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? MediaQuery.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width /
|
|
|
|
|
|
|
|
5
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
padding:
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xffb23838),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft: Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
6)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.subProducts[index].rxMessage != null
|
|
|
|
model
|
|
|
|
? model.subProducts[index].rxMessage
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage
|
|
|
|
: "",
|
|
|
|
: "",
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(
|
|
|
|
horizontal: 6,
|
|
|
|
horizontal: 6,
|
|
|
|
vertical: 0,
|
|
|
|
vertical: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
model.subProducts[index].name,
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.name,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(top: 4, bottom: 4),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
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,
|
|
|
|
@ -646,21 +835,25 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
StarRating(
|
|
|
|
StarRating(
|
|
|
|
totalAverage:
|
|
|
|
totalAverage: model
|
|
|
|
model.subProducts[index].approvedRatingSum > 0
|
|
|
|
.subProducts[
|
|
|
|
? (model.subProducts[index].approvedRatingSum
|
|
|
|
index]
|
|
|
|
.toDouble() /
|
|
|
|
.approvedRatingSum >
|
|
|
|
model.subProducts[index]
|
|
|
|
0
|
|
|
|
.approvedRatingSum
|
|
|
|
? (model.subProducts[index].approvedRatingSum.toDouble() /
|
|
|
|
.toDouble())
|
|
|
|
model.subProducts[index].approvedRatingSum
|
|
|
|
.toDouble()
|
|
|
|
.toDouble())
|
|
|
|
: 0,
|
|
|
|
.toDouble()
|
|
|
|
forceStars: true),
|
|
|
|
: 0,
|
|
|
|
|
|
|
|
forceStars:
|
|
|
|
|
|
|
|
true),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -675,7 +868,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: ProductDetailPage(model.subProducts[index]),
|
|
|
|
page: ProductDetailPage(
|
|
|
|
|
|
|
|
model.subProducts[
|
|
|
|
|
|
|
|
index]),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
));
|
|
|
|
));
|
|
|
|
@ -683,11 +878,14 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.122,
|
|
|
|
height: model.subProducts.length *
|
|
|
|
|
|
|
|
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: (BuildContext context, int index) {
|
|
|
|
itemBuilder:
|
|
|
|
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
return InkWell(
|
|
|
|
return InkWell(
|
|
|
|
child: Card(
|
|
|
|
child: Card(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
@ -697,9 +895,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: BoxDecoration(),
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
BoxDecoration(),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
left: 9.0,
|
|
|
|
left: 9.0,
|
|
|
|
top: 8.0,
|
|
|
|
top: 8.0,
|
|
|
|
right: 10.0,
|
|
|
|
right: 10.0,
|
|
|
|
@ -707,11 +907,22 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
|
|
|
|
margin: EdgeInsets
|
|
|
|
alignment: Alignment.center,
|
|
|
|
.fromLTRB(
|
|
|
|
|
|
|
|
0, 0, 0, 0),
|
|
|
|
|
|
|
|
alignment:
|
|
|
|
|
|
|
|
Alignment.center,
|
|
|
|
child: Image.network(
|
|
|
|
child: Image.network(
|
|
|
|
model.subProducts[index].images.isNotEmpty
|
|
|
|
model
|
|
|
|
? model.subProducts[index].images[0].thumb
|
|
|
|
.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',
|
|
|
|
: '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,
|
|
|
|
@ -722,23 +933,45 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: model.subProducts[index].rxMessage != null
|
|
|
|
width: model
|
|
|
|
? MediaQuery.of(context).size.width / 5
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? MediaQuery.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width /
|
|
|
|
|
|
|
|
5
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
padding:
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xffb23838),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft: Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
6)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.subProducts[index].rxMessage != null
|
|
|
|
model
|
|
|
|
? model.subProducts[index].rxMessage
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage
|
|
|
|
: "",
|
|
|
|
: "",
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -752,19 +985,31 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
vertical: 0,
|
|
|
|
vertical: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
mainAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceAround,
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 4.0,
|
|
|
|
height: 4.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.65,
|
|
|
|
width: MediaQuery.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
|
|
|
|
0.65,
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
model.subProducts[index].name,
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.name,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 13.2,
|
|
|
|
fontSize: 13.2,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w500,
|
|
|
|
maxLines: 5,
|
|
|
|
maxLines: 5,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -772,7 +1017,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
height: 8.0,
|
|
|
|
height: 8.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(top: 4, bottom: 4),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
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,
|
|
|
|
@ -782,20 +1031,26 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
StarRating(
|
|
|
|
StarRating(
|
|
|
|
totalAverage:
|
|
|
|
totalAverage: model
|
|
|
|
model.subProducts[index].approvedRatingSum > 0
|
|
|
|
.subProducts[
|
|
|
|
? (model.subProducts[index].approvedRatingSum
|
|
|
|
index]
|
|
|
|
.toDouble() /
|
|
|
|
.approvedRatingSum >
|
|
|
|
model.subProducts[index].approvedRatingSum
|
|
|
|
0
|
|
|
|
.toDouble())
|
|
|
|
? (model.subProducts[index].approvedRatingSum
|
|
|
|
.toDouble()
|
|
|
|
.toDouble() /
|
|
|
|
: 0,
|
|
|
|
model
|
|
|
|
|
|
|
|
.subProducts[index]
|
|
|
|
|
|
|
|
.approvedRatingSum
|
|
|
|
|
|
|
|
.toDouble())
|
|
|
|
|
|
|
|
.toDouble()
|
|
|
|
|
|
|
|
: 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.w400,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.w400,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -809,7 +1064,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: ProductDetailPage(model.subProducts[index]),
|
|
|
|
page: ProductDetailPage(
|
|
|
|
|
|
|
|
model.subProducts[index]),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -851,7 +1107,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelected(CategoriseParentModel masterKey) {
|
|
|
|
bool isEntityListSelected(CategoriseParentModel masterKey) {
|
|
|
|
Iterable<CategoriseParentModel> history = entityList.where((element) => masterKey.id == element.id);
|
|
|
|
Iterable<CategoriseParentModel> history =
|
|
|
|
|
|
|
|
entityList.where((element) => masterKey.id == element.id);
|
|
|
|
if (history.length > 0) {
|
|
|
|
if (history.length > 0) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -859,7 +1116,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
|
|
|
|
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
|
|
|
|
Iterable<CategoriseParentModel> history = entityListBrands.where((element) => masterKey.id == element.id);
|
|
|
|
Iterable<CategoriseParentModel> history =
|
|
|
|
|
|
|
|
entityListBrands.where((element) => masterKey.id == element.id);
|
|
|
|
if (history.length > 0) {
|
|
|
|
if (history.length > 0) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|