Merge branch 'pharmacy-hussam' into 'pharmacy'

parent_categorise_page update

See merge request Cloud_Solution/diplomatic-quarter!226
merge-requests/227/merge
Mohammad Aljammal 4 years ago
commit d7fe93b3f3

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
@ -52,9 +53,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
backgroundColor: Colors.white,
isShowDecPage: false,
baseViewModel: model,
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 5.90,
body: Container(
child: ListView(
scrollDirection: Axis.vertical,
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -90,7 +93,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.all(10.0),
@ -117,14 +121,16 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
scrollDirection:
Axis.vertical,
itemCount: model
.categoriseParent.length,
.categoriseParent
.length,
itemBuilder:
(BuildContext context,
int index) {
return Container(
child: Padding(
padding:
EdgeInsets.all(8.0),
EdgeInsets.all(
8.0),
child: InkWell(
child: Column(
crossAxisAlignment:
@ -136,7 +142,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index]
.name),
Divider(
thickness: 0.6,
thickness:
0.6,
color: Colors
.black12,
)
@ -149,11 +156,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
builder:
(context) =>
SubCategorisePage(
title:
model.categoriseParent[index].name,
title: model.categoriseParent[index].name,
id: model.categoriseParent[index].id,
parentId:
id,
parentId: id,
)),
);
},
@ -189,10 +194,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
itemCount: model.categoriseParent.length > 8
? 8
: model.categoriseParent.length,
itemBuilder: (BuildContext context, int index) {
itemBuilder:
(BuildContext context, int index) {
return Padding(
padding:
EdgeInsets.symmetric(horizontal: 8.0),
padding: EdgeInsets.symmetric(
horizontal: 8.0),
child: InkWell(
child: Column(
crossAxisAlignment:
@ -206,7 +212,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
width: 65.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.orange.shade200
color: Colors
.orange.shade200
.withOpacity(0.45),
),
child: Center(
@ -230,10 +237,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Texts(
projectViewModel.isArabic
? model
.categoriseParent[index]
.categoriseParent[
index]
.namen
: model
.categoriseParent[index]
.categoriseParent[
index]
.name,
fontSize: 13.4,
fontWeight: FontWeight.w600,
@ -250,10 +259,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
builder: (context) =>
SubCategorisePage(
title: model
.categoriseParent[index]
.categoriseParent[
index]
.name,
id: model
.categoriseParent[index]
.categoriseParent[
index]
.id,
parentId: id,
)),
@ -301,7 +312,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
maxChildSize: 0.95,
minChildSize: 0.9,
builder: (BuildContext context,
ScrollController scrollController) {
ScrollController
scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container(
@ -325,7 +337,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Texts(
'Refine',
fontWeight:
FontWeight.w600,
FontWeight
.w600,
),
SizedBox(
width: 250.0,
@ -333,9 +346,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
InkWell(
child: Texts(
'Close',
color: Colors.red,
color:
Colors.red,
fontWeight:
FontWeight.w600,
FontWeight
.w600,
fontSize: 15.0,
),
onTap: () {
@ -353,8 +368,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column(
children: [
ExpansionTile(
title:
Texts('Categorise'),
title: Texts(
'Categorise'),
children: [
Container(
height: 350,
@ -371,26 +386,21 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.categoriseParent
.length,
itemBuilder:
(BuildContext
context,
(BuildContext context,
int index) {
return CheckboxListTile(
tristate:
true,
title: Texts(model
.categoriseParent[index]
.name),
title:
Texts(model.categoriseParent[index].name),
controlAffinity:
ListTileControlAffinity.leading,
value:
checkedCategorise,
onChanged:
(bool
value) {
setState(
() {
checkedCategorise =
value;
(bool value) {
setState(() {
checkedCategorise = value;
});
},
);
@ -400,10 +410,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Divider(
thickness: 1.0,
color: Colors.black12,
color:
Colors.black12,
),
ExpansionTile(
title: Texts('Brands'),
title:
Texts('Brands'),
children: [
Container(
height: 350,
@ -418,26 +430,21 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.brandsList
.length,
itemBuilder:
(BuildContext
context,
(BuildContext context,
int index) {
return CheckboxListTile(
tristate:
true,
title: Texts(model
.brandsList[index]
.name),
title:
Texts(model.brandsList[index].name),
controlAffinity:
ListTileControlAffinity.leading,
value:
checkedBrands,
onChanged:
(bool
value) {
setState(
() {
checkedBrands =
value;
(bool value) {
setState(() {
checkedBrands = value;
});
},
autofocus:
@ -449,10 +456,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Divider(
thickness: 1.0,
color: Colors.black12,
color:
Colors.black12,
),
ExpansionTile(
title: Texts('Price'),
title:
Texts('Price'),
children: [
Container(
color: Color(
@ -470,8 +479,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Texts(
'Min'),
Container(
color: Colors
.white,
color:
Colors.white,
width:
200,
height:
@ -480,8 +489,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
TextFormField(
decoration:
InputDecoration(
border:
OutlineInputBorder(),
border: OutlineInputBorder(),
),
),
),
@ -495,8 +503,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Texts(
'Max'),
Container(
color: Colors
.white,
color:
Colors.white,
width:
200,
height:
@ -505,8 +513,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
TextFormField(
decoration:
InputDecoration(
border:
OutlineInputBorder(),
border: OutlineInputBorder(),
),
),
),
@ -519,7 +526,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Divider(
thickness: 1.0,
color: Colors.black12,
color:
Colors.black12,
),
SizedBox(
height: MediaQuery.of(
@ -530,7 +538,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Padding(
padding:
EdgeInsets.all(8.0),
EdgeInsets.all(
8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment
@ -539,9 +548,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container(
width: 100,
child: Button(
label: 'Reset',
label:
'Reset',
backgroundColor:
Colors.red,
Colors
.red,
),
),
SizedBox(
@ -550,7 +561,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container(
width: 200,
child: Button(
label: 'Apply',
label:
'Apply',
backgroundColor:
Colors
.green,
@ -619,7 +631,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
styleOne == true
? Container(
height: MediaQuery.of(context).size.height * 4.89,
height: SizeConfig.screenHeight * 7.8,
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
gridDelegate:
@ -630,7 +642,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
childAspectRatio: 0.9,
),
itemCount: model.parentProducts.length,
itemBuilder: (BuildContext context, int index) {
itemBuilder:
(BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: Card(
@ -665,7 +678,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
topLeft:
Radius.circular(110.0),
),
color: Colors.white,
),
@ -682,7 +696,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Stack(
children: [
if (model
.parentProducts[index]
.parentProducts[
index]
.discountName !=
null)
RotatedBox(
@ -692,7 +707,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
BoxDecoration(),
child: Padding(
padding:
EdgeInsets.only(
EdgeInsets
.only(
right: 5.0,
top: 20.0,
bottom: 5.0,
@ -700,10 +716,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Texts(
'offer'
.toUpperCase(),
color: Colors.red,
color:
Colors.red,
fontSize: 13.0,
fontWeight:
FontWeight.w900,
FontWeight
.w900,
),
),
transform: new Matrix4
@ -712,9 +730,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
),
Container(
margin: EdgeInsets.fromLTRB(
margin:
EdgeInsets.fromLTRB(
0, 16, 0, 0),
alignment: Alignment.center,
alignment:
Alignment.center,
child: Image.network(
model
.parentProducts[
@ -737,18 +757,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index]
.rxMessage !=
null
? MediaQuery.of(context)
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(6)),
.circular(
6)),
),
child: Texts(
model
@ -771,13 +796,15 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
],
),
Container(
margin: EdgeInsets.symmetric(
margin:
EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [
if (model
.parentProducts[
@ -785,12 +812,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.discountName !=
null)
Container(
width: double.infinity,
width:
double.infinity,
height: 13.0,
decoration:
BoxDecoration(
color:
Color(0xff5AB145),
color: Color(
0xff5AB145),
),
child: Center(
child: Texts(
@ -799,14 +827,16 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index]
.discountName,
regular: true,
color: Colors.white,
color: Colors
.white,
fontSize: 10.4,
),
),
),
Texts(
model
.parentProducts[index]
.parentProducts[
index]
.name,
regular: true,
fontSize: 12,
@ -815,7 +845,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Padding(
padding:
const EdgeInsets.only(
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
@ -832,21 +863,20 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model
.parentProducts[index]
.approvedRatingSum
? (model.parentProducts[index].approvedRatingSum.toDouble() /
model.parentProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
forceStars:
true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
FontWeight
.w400,
)
],
),
@ -861,7 +891,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
)
: Container(
height: MediaQuery.of(context).size.height * 5.0,
height:
MediaQuery.of(context).size.height * 5.0,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
itemCount: model.parentProducts.length,
@ -875,9 +906,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column(
children: [
Container(
decoration: BoxDecoration(),
decoration:
BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
padding:
EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
@ -885,9 +918,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
),
Container(
margin: EdgeInsets.fromLTRB(
margin:
EdgeInsets.fromLTRB(
0, 0, 0, 0),
alignment: Alignment.center,
alignment:
Alignment.center,
child: Image.network(
model
.parentProducts[
@ -914,18 +949,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index]
.rxMessage !=
null
? MediaQuery.of(context)
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(6)),
.circular(
6)),
),
child: Texts(
model
@ -957,7 +997,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
@ -965,11 +1006,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
height: 4.0,
),
Texts(
model.parentProducts[index]
model
.parentProducts[index]
.name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
fontWeight:
FontWeight.w500,
maxLines: 5,
),
SizedBox(
@ -978,7 +1021,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Padding(
padding:
const EdgeInsets.only(
top: 4, bottom: 4),
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
@ -993,14 +1037,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index]
.approvedRatingSum >
0
? (model
.parentProducts[
index]
.approvedRatingSum
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model
.parentProducts[
index]
.parentProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
@ -1026,6 +1066,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
],
),
),
],
),
),
));
}

Loading…
Cancel
Save