@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_mo
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/product_detail.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/product_detail.dart ' ;
import ' package:diplomaticquarterapp/pages/sub_categorise_page.dart ' ;
import ' package:diplomaticquarterapp/pages/sub_categorise_page.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/widgets/buttons/button.dart ' ;
import ' package:diplomaticquarterapp/widgets/buttons/button.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/StarRating.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/StarRating.dart ' ;
@ -23,8 +25,7 @@ class ParentCategorisePage extends StatefulWidget {
ParentCategorisePage ( { this . id , this . titleName } ) ;
ParentCategorisePage ( { this . id , this . titleName } ) ;
@ override
@ override
_ParentCategorisePageState createState ( ) = >
_ParentCategorisePageState createState ( ) = > _ParentCategorisePageState ( id: id , titleName: titleName ) ;
_ParentCategorisePageState ( id: id , titleName: titleName ) ;
}
}
class _ParentCategorisePageState extends State < ParentCategorisePage > {
class _ParentCategorisePageState extends State < ParentCategorisePage > {
@ -55,9 +56,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
ProjectViewModel projectViewModel = Provider . of ( context ) ;
ProjectViewModel projectViewModel = Provider . of ( context ) ;
return BaseView < PharmacyCategoriseViewModel > (
return BaseView < PharmacyCategoriseViewModel > (
onModelReady: ( model ) = > model . getCategoriseParent ( i: id ) ,
onModelReady: ( model ) = > model . getCategoriseParent ( i: id ) ,
builder: ( BuildContext context , PharmacyCategoriseViewModel model ,
builder: ( BuildContext context , PharmacyCategoriseViewModel model , Widget child ) = > PharmacyAppScaffold (
Widget child ) = >
PharmacyAppScaffold (
appBarTitle: titleName ,
appBarTitle: titleName ,
isBottomBar: false ,
isBottomBar: false ,
isShowAppBar: true ,
isShowAppBar: true ,
@ -108,7 +107,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: InkWell (
child: InkWell (
child: Container (
child: Container (
child: Texts (
child: Texts (
' View All Categories ' ,
TranslationBase . of ( context ) . viewCategorise ,
/ / ' View All Categories ' ,
fontWeight: FontWeight . w300 ,
fontWeight: FontWeight . w300 ,
) ,
) ,
) ,
) ,
@ -125,31 +125,22 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
color: Colors . white ,
color: Colors . white ,
child: Center (
child: Center (
child: ListView . builder (
child: ListView . builder (
scrollDirection:
scrollDirection: Axis . vertical ,
Axis . vertical ,
itemCount: model . categoriseParent . length ,
itemCount: model
itemBuilder: ( BuildContext context , int index ) {
. categoriseParent . length ,
itemBuilder:
( BuildContext context ,
int index ) {
return Container (
return Container (
child: Padding (
child: Padding (
padding:
padding: EdgeInsets . all ( 4.0 ) ,
EdgeInsets . all ( 4.0 ) ,
child: InkWell (
child: InkWell (
child: Column (
child: Column (
crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment . start ,
CrossAxisAlignment
. start ,
children: [
children: [
Texts ( model
Texts ( projectViewModel . isArabic
. categoriseParent [
? model . categoriseParent [ index ] . namen
index ]
: model . categoriseParent [ index ] . name ) ,
. name ) ,
Divider (
Divider (
thickness: 0.6 ,
thickness: 0.6 ,
color: Colors
color: Colors . black12 ,
. black12 ,
)
)
] ,
] ,
) ,
) ,
@ -157,16 +148,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Navigator . push (
Navigator . push (
context ,
context ,
FadePage (
FadePage (
page:
page: SubCategorisePage (
SubCategorisePage (
title: model . categoriseParent [ index ] . name ,
title: model
id: model . categoriseParent [ index ] . id ,
. categoriseParent [
index ]
. name ,
id: model
. categoriseParent [
index ]
. id ,
parentId: id ,
parentId: id ,
) ) ,
) ) ,
) ;
) ;
@ -200,28 +184,22 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Center (
child: Center (
child: ListView . builder (
child: ListView . builder (
scrollDirection: Axis . horizontal ,
scrollDirection: Axis . horizontal ,
itemCount: model . categoriseParent . length > 8
itemCount: model . categoriseParent . length > 8 ? 8 : model . categoriseParent . length ,
? 8
: model . categoriseParent . 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 (
@ -232,10 +210,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
) ,
) ,
) ,
) ,
Container (
Container (
width: MediaQuery . of ( context )
width: MediaQuery . of ( context ) . size . width * 0.197 ,
. size
. width *
0.197 ,
/ / height: MediaQuery . of ( context )
/ / height: MediaQuery . of ( context )
/ / . size
/ / . size
/ / . height *
/ / . height *
@ -243,12 +218,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Center (
child: Center (
child: Texts (
child: Texts (
projectViewModel . isArabic
projectViewModel . isArabic
? model
? model . categoriseParent [ index ] . namen
. categoriseParent [ index ]
: model . categoriseParent [ index ] . name ,
. namen
: model
. categoriseParent [ index ]
. name ,
fontSize: 13.4 ,
fontSize: 13.4 ,
fontWeight: FontWeight . w600 ,
fontWeight: FontWeight . w600 ,
maxLines: 3 ,
maxLines: 3 ,
@ -262,10 +233,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
context ,
context ,
FadePage (
FadePage (
page: SubCategorisePage (
page: SubCategorisePage (
title: model
title: model . categoriseParent [ index ] . name ,
. categoriseParent [ index ] . name ,
id: model . categoriseParent [ index ] . id ,
id: model
. categoriseParent [ index ] . id ,
parentId: id ,
parentId: id ,
) ) ,
) ) ,
) ;
) ;
@ -311,21 +280,16 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
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 (
@ -336,8 +300,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
) ,
) ,
Texts (
Texts (
' Refine ' ,
' Refine ' ,
fontWeight:
fontWeight: FontWeight . w600 ,
FontWeight . w600 ,
) ,
) ,
SizedBox (
SizedBox (
width: 250.0 ,
width: 250.0 ,
@ -346,13 +309,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Texts (
child: Texts (
' 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 ) ;
} ,
} ,
) ,
) ,
] ,
] ,
@ -365,37 +326,27 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column (
Column (
children: [
children: [
ExpansionTile (
ExpansionTile (
title:
title: Texts ( ' Categorise ' ) ,
Texts ( ' Categorise ' ) ,
children: [
children: [
ProcedureListWidget (
ProcedureListWidget (
model: model ,
model: model ,
masterList: model
masterList: model . categoriseParent ,
. categoriseParent ,
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 ) ,
)
)
] ,
] ,
) ,
) ,
@ -408,33 +359,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
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 ) ,
)
)
] ,
] ,
) ,
) ,
@ -446,63 +387,40 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
title: Texts ( ' Price ' ) ,
title: Texts ( ' 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 ,
) ,
) ,
) ,
) ,
] ,
] ,
@ -517,26 +435,18 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
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: [
Container (
Container (
width: 100 ,
width: 100 ,
child: Button (
child: Button (
label: ' Reset ' ,
label: ' Reset ' ,
backgroundColor:
backgroundColor: Colors . red ,
Colors . red ,
) ,
) ,
) ,
) ,
SizedBox (
SizedBox (
@ -545,54 +455,38 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container (
Container (
width: 200 ,
width: 200 ,
child: Button (
child: Button (
onTap: ( ) {
onTap: ( ) async {
String
String categoriesId = " " ;
categoriesId =
for ( CategoriseParentModel category in entityList ) {
" " ;
if ( categoriesId = = " " ) {
for ( CategoriseParentModel category
categoriesId = category . id ;
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 } " ;
}
}
}
}
model . getFilteredProducts (
GifLoaderDialogUtils . showMyDialog ( context ) ;
min: minField
. text
await model . getFilteredProducts (
. toString ( ) ,
min: minField . text . toString ( ) ,
max: maxField
max: maxField . text . toString ( ) ,
. text
categoryId: categoriesId ,
. toString ( ) ,
brandId: brandIds ) ;
categoryId:
GifLoaderDialogUtils . hideDialog ( context ) ;
categoriesId ,
brandId:
Navigator . pop ( context ) ;
brandIds ) ;
} ,
} ,
label: ' Apply ' ,
label: ' Apply ' ,
backgroundColor:
backgroundColor: Colors . green ,
Colors
. green ,
) ,
) ,
) ,
) ,
] ,
] ,
@ -656,15 +550,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
thickness: 1.0 ,
thickness: 1.0 ,
color: Colors . grey . shade400 ,
color: Colors . grey . shade400 ,
) ,
) ,
styleOne = = true
model . parentProducts . isNotEmpty
? styleOne = = true
? Container (
? Container (
height: model . parentProducts . length *
height: model . parentProducts . 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 ,
@ -676,9 +568,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
baseViewModel: model ,
baseViewModel: model ,
child: InkWell (
child: InkWell (
child: Card (
child: Card (
color: model . parentProducts [ index ]
color: model . parentProducts [ index ] . discountName ! = null
. discountName ! =
null
? Color ( 0xffFFFF00 )
? Color ( 0xffFFFF00 )
: Colors . white ,
: Colors . white ,
elevation: 0 ,
elevation: 0 ,
@ -711,111 +601,63 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
) ,
) ,
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: [
if ( model
if ( model . parentProducts [ index ] . discountName ! = null )
. parentProducts [
index ]
. discountName ! =
null )
RotatedBox (
RotatedBox (
quarterTurns: 4 ,
quarterTurns: 4 ,
child: Container (
child: Container (
decoration:
decoration: BoxDecoration ( ) ,
BoxDecoration ( ) ,
child: Padding (
child: Padding (
padding:
padding: EdgeInsets . only (
EdgeInsets . only (
right: 5.0 ,
right: 5.0 ,
top: 20.0 ,
top: 20.0 ,
bottom: 5.0 ,
bottom: 5.0 ,
) ,
) ,
child: Texts (
child: Texts (
' offer '
' offer ' . toUpperCase ( ) ,
. toUpperCase ( ) ,
color: Colors . red ,
color: Colors . red ,
fontSize: 13.0 ,
fontSize: 13.0 ,
fontWeight:
fontWeight: FontWeight . w900 ,
FontWeight
. w900 ,
) ,
) ,
) ,
) ,
transform: new Matrix4
transform: new Matrix4 . rotationZ ( 5.837200 ) ,
. rotationZ (
5.837200 ) ,
) ,
) ,
) ,
) ,
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 . parentProducts [ index ] . images . isNotEmpty
. parentProducts [
? model . parentProducts [ index ] . images [ 0 ] . thumb
index ]
. images
. isNotEmpty
? model
. parentProducts [
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 . parentProducts [ index ] . rxMessage ! = null
. parentProducts [
? 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
model . parentProducts [ index ] . rxMessage ! = null
. parentProducts [
? model . parentProducts [ index ] . rxMessage
index ]
. rxMessage ! =
null
? model
. parentProducts [
index ]
. rxMessage
: " " ,
: " " ,
color: Colors . white ,
color: Colors . white ,
regular: true ,
regular: true ,
fontSize: 10 ,
fontSize: 10 ,
fontWeight:
fontWeight: FontWeight . w400 ,
FontWeight . w400 ,
) ,
) ,
) ,
) ,
] ,
] ,
@ -826,53 +668,34 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
vertical: 0 ,
vertical: 0 ,
) ,
) ,
child: Column (
child: Column (
crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment . start ,
CrossAxisAlignment
. start ,
children: [
children: [
if ( model
if ( model . parentProducts [ index ] . discountName ! = null )
. parentProducts [
index ]
. discountName ! =
null )
Container (
Container (
width:
width: double . infinity ,
double . infinity ,
height: 13.0 ,
height: 13.0 ,
decoration:
decoration: BoxDecoration (
BoxDecoration (
color: Color ( 0xff5AB145 ) ,
color: Color (
0xff5AB145 ) ,
) ,
) ,
child: Center (
child: Center (
child: Texts (
child: Texts (
model
model . parentProducts [ index ] . discountName ,
. parentProducts [
index ]
. discountName ,
regular: true ,
regular: true ,
color:
color: Colors . white ,
Colors . white ,
fontSize: 10.4 ,
fontSize: 10.4 ,
) ,
) ,
) ,
) ,
) ,
) ,
Texts (
Texts (
model
projectViewModel . isArabic
. parentProducts [
? model . parentProducts [ index ] . namen
index ]
: model . parentProducts [ index ] . name ,
. name ,
regular: true ,
regular: true ,
fontSize: 12 ,
fontSize: 12 ,
fontWeight:
fontWeight: FontWeight . w700 ,
FontWeight . w700 ,
) ,
) ,
Padding (
Padding (
padding:
padding: const EdgeInsets . only ( top: 4 , bottom: 4 ) ,
const EdgeInsets
. only (
top: 4 ,
bottom: 4 ) ,
child: Texts (
child: Texts (
" SAR ${ model . parentProducts [ index ] . price } " ,
" SAR ${ model . parentProducts [ index ] . price } " ,
bold: true ,
bold: true ,
@ -882,15 +705,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Row (
Row (
children: [
children: [
StarRating (
StarRating (
totalAverage: model
totalAverage:
. parentProducts [
model . parentProducts [ index ] . approvedRatingSum > 0
index ]
? ( model . parentProducts [ index ]
. approvedRatingSum >
. approvedRatingSum
0
? ( model . parentProducts [ index ] . approvedRatingSum
. toDouble ( ) /
. toDouble ( ) /
model
model . parentProducts [ index ]
. parentProducts [ index ]
. approvedRatingSum
. approvedRatingSum
. toDouble ( ) )
. toDouble ( ) )
. toDouble ( )
. toDouble ( )
@ -900,8 +720,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
" ( ${ model . parentProducts [ index ] . approvedTotalReviews } ) " ,
" ( ${ model . parentProducts [ index ] . approvedTotalReviews } ) " ,
regular: true ,
regular: true ,
fontSize: 10 ,
fontSize: 10 ,
fontWeight:
fontWeight: FontWeight . w400 ,
FontWeight . w400 ,
)
)
] ,
] ,
) ,
) ,
@ -916,8 +735,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Navigator . push (
Navigator . push (
context ,
context ,
FadePage (
FadePage (
page: ProductDetailPage ( model
page: ProductDetailPage ( model . parentProducts [ index ] ) ,
. parentProducts [ index ] ) ,
) ) ,
) ) ,
} ,
} ,
) ) ;
) ) ;
@ -925,14 +743,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
) ,
) ,
)
)
: Container (
: Container (
height: model . parentProducts . length *
height: model . parentProducts . 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 . parentProducts . length ,
itemCount: model . parentProducts . length ,
itemBuilder:
itemBuilder: ( BuildContext context , int index ) {
( BuildContext context , int index ) {
return InkWell (
return InkWell (
child: Card (
child: Card (
child: Row (
child: Row (
@ -942,11 +757,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
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 ,
@ -954,22 +767,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
) ,
) ,
) ,
) ,
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 . parentProducts [ index ] . images . isNotEmpty
. parentProducts [
? model . parentProducts [ index ] . images [ 0 ] . thumb
index ]
. images
. isNotEmpty
? model
. parentProducts [
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 ,
@ -980,44 +782,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column (
Column (
children: [
children: [
Container (
Container (
width: model
width: model . parentProducts [ index ] . rxMessage ! = null
. parentProducts [
? 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
model . parentProducts [ index ] . rxMessage ! = null
. parentProducts [
? model . parentProducts [ index ] . rxMessage
index ]
. rxMessage ! =
null
? model
. parentProducts [
index ]
. rxMessage
: " " ,
: " " ,
color: Colors . white ,
color: Colors . white ,
regular: true ,
regular: true ,
fontSize: 10 ,
fontSize: 10 ,
fontWeight:
fontWeight: FontWeight . w400 ,
FontWeight . w400 ,
) ,
) ,
) ,
) ,
] ,
] ,
@ -1030,29 +811,21 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
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
projectViewModel . isArabic
. parentProducts [ index ]
? model . parentProducts [ index ] . namen
. name ,
: model . parentProducts [ index ] . name ,
regular: true ,
regular: true ,
fontSize: 13.2 ,
fontSize: 13.2 ,
fontWeight:
fontWeight: FontWeight . w500 ,
FontWeight . w500 ,
maxLines: 5 ,
maxLines: 5 ,
) ,
) ,
) ,
) ,
@ -1060,9 +833,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
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 . parentProducts [ index ] . price } " ,
" SAR ${ model . parentProducts [ index ] . price } " ,
bold: true ,
bold: true ,
@ -1072,19 +843,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Row (
Row (
children: [
children: [
StarRating (
StarRating (
totalAverage: model
totalAverage:
. parentProducts [
model . parentProducts [ index ] . approvedRatingSum > 0
index ]
? ( model . parentProducts [ index ] . approvedRatingSum
. approvedRatingSum >
0
? ( model
. parentProducts [
index ]
. approvedRatingSum
. toDouble ( ) /
. toDouble ( ) /
model
model . parentProducts [ index ]
. parentProducts [
index ]
. approvedRatingSum
. approvedRatingSum
. toDouble ( ) )
. toDouble ( ) )
. toDouble ( )
. toDouble ( )
@ -1094,8 +857,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
" ( ${ model . parentProducts [ index ] . approvedTotalReviews } ) " ,
" ( ${ model . parentProducts [ index ] . approvedTotalReviews } ) " ,
regular: true ,
regular: true ,
fontSize: 10 ,
fontSize: 10 ,
fontWeight:
fontWeight: FontWeight . w400 ,
FontWeight . w400 ,
)
)
] ,
] ,
) ,
) ,
@ -1109,13 +871,40 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Navigator . push (
Navigator . push (
context ,
context ,
FadePage (
FadePage (
page: ProductDetailPage (
page: ProductDetailPage ( model . parentProducts [ index ] ) ,
model . parentProducts [ 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 ) ,
) ,
)
] ,
) ,
) ,
) ,
)
] ,
] ,
) ,
) ,
) ,
) ,
@ -1124,8 +913,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
}
}
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 ;
}
}
@ -1133,8 +921,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
}
}
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 ;
}
}