@ -4,17 +4,17 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta
import ' package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart ' ;
import ' package:diplomaticquarterapp/locator.dart ' ;
import ' package:diplomaticquarterapp/locator.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.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 ' ;
import ' package:diplomaticquarterapp/widgets/others/app_scaffold_ pharmacy_ widget.dart' ;
import ' package:diplomaticquarterapp/widgets/others/app_scaffold_ widget.dart' ;
import ' package:diplomaticquarterapp/widgets/others/network_base_view.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/network_base_view.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/src/widgets/image.dart ' as flutterImage ;
import ' base/base_view.dart ' ;
import ' base/base_view.dart ' ;
dynamic languageID ;
dynamic languageID ;
@ -22,8 +22,7 @@ dynamic languageID;
class FinalProductsPage extends StatefulWidget {
class FinalProductsPage extends StatefulWidget {
final String id ;
final String id ;
final int productType ; / / 1 : default , 2 : manufacturer , 3 : recently viewed
final int productType ; / / 1 : default , 2 : manufacturer , 3 : recently viewed
AuthenticatedUserObject authenticatedUserObject =
AuthenticatedUserObject authenticatedUserObject = locator < AuthenticatedUserObject > ( ) ;
locator < AuthenticatedUserObject > ( ) ;
FinalProductsPage ( { this . id , this . productType = 1 } ) ;
FinalProductsPage ( { this . id , this . productType = 1 } ) ;
@ -33,7 +32,9 @@ class FinalProductsPage extends StatefulWidget {
class _FinalProductsPageState extends State < FinalProductsPage > {
class _FinalProductsPageState extends State < FinalProductsPage > {
String id ;
String id ;
_FinalProductsPageState ( { this . id } ) ;
_FinalProductsPageState ( { this . id } ) ;
String categoriseName = " Personal Care " ;
String categoriseName = " Personal Care " ;
String appBarTitle = " " ;
String appBarTitle = " " ;
bool styleOne = true ;
bool styleOne = true ;
@ -77,11 +78,10 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
}
}
} ,
} ,
allowAny: true ,
allowAny: true ,
builder: ( BuildContext context , PharmacyCategoriseViewModel model ,
builder: ( BuildContext context , PharmacyCategoriseViewModel model , Widget child ) = > AppScaffold (
Widget child ) = >
isPharmacy: true ,
PharmacyAppScaffold (
appBarTitle: appBarTitle ,
appBarTitle: appBarTitle ,
isBottomBar: fals e,
isBottomBar: tru e,
isShowAppBar: true ,
isShowAppBar: true ,
backgroundColor: Colors . white ,
backgroundColor: Colors . white ,
isShowDecPage: false ,
isShowDecPage: false ,
@ -91,16 +91,13 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
child: Column (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
/ / Expanded widget heree if nassery
Row (
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
children: [
Padding (
Padding (
padding: EdgeInsets . all ( 8.0 ) ,
padding: EdgeInsets . all ( 8.0 ) ,
child: Texts (
child: Texts (
" $ appBarTitle " +
" $ appBarTitle " + TranslationBase . of ( context ) . products ,
TranslationBase . of ( context ) . products ,
fontWeight: FontWeight . w600 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
) ,
) ,
@ -154,29 +151,21 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
? Expanded (
? Expanded (
child: model . finalProducts . length > 0
child: model . finalProducts . length > 0
? Container (
? Container (
height: MediaQuery . of ( context ) . size . height *
height: MediaQuery . of ( context ) . size . height * 3.90 ,
3.90 ,
child: GridView . builder (
child: GridView . builder (
gridDelegate:
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: 2 ,
crossAxisCount: 2 ,
crossAxisSpacing: 0.5 ,
crossAxisSpacing: 0.5 ,
mainAxisSpacing: 2.0 ,
mainAxisSpacing: 2.0 ,
childAspectRatio: 1.0 ,
childAspectRatio: 1.0 ,
) ,
) ,
itemCount: model . finalProducts . length ,
itemCount: model . finalProducts . length ,
itemBuilder:
itemBuilder: ( BuildContext context , int index ) {
( BuildContext context , int index ) {
return NetworkBaseView (
return NetworkBaseView (
baseViewModel: model ,
baseViewModel: model ,
child: InkWell (
child: InkWell (
child: Card (
child: Card (
color:
color: model . finalProducts [ index ] . discountName ! = null ? Color ( 0xffFFFF00 ) : Colors . white ,
model . finalProducts [ index ]
. discountName ! =
null
? Color ( 0xffFFFF00 )
: Colors . white ,
elevation: 0 ,
elevation: 0 ,
shape: Border (
shape: Border (
right: BorderSide (
right: BorderSide (
@ -198,226 +187,84 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
) ,
) ,
margin: EdgeInsets . symmetric (
margin: EdgeInsets . symmetric (
horizontal: 8 ,
horizontal: 8 ,
vertical: 1 ,
vertical: 4 ,
/ / vertical: 2 ,
) ,
) ,
child: Container (
child: Container (
decoration: BoxDecoration (
decoration: BoxDecoration (
borderRadius:
borderRadius: BorderRadius . only (
BorderRadius . only (
topLeft: Radius . circular ( 110.0 ) ,
topLeft: Radius . circular (
110.0 ) ,
) ,
) ,
color: Colors . white ,
color: Colors . white ,
) ,
) ,
padding: EdgeInsets . symmetric (
padding: EdgeInsets . symmetric ( horizontal: 0 ) ,
horizontal: 4 ,
) ,
width: MediaQuery . of ( context ) . size . width / 3 ,
width: MediaQuery . of ( context ) . size . width / 3 ,
/ / width: MediaQuery . of ( context )
/ / . size
/ / . width /
/ / 1 ,
/ / height: MediaQuery . of ( context )
/ / . size
/ / . width /
/ / 1 ,
child: Column (
child: Column (
crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment . start ,
CrossAxisAlignment
. start ,
children: [
children: [
Stack (
Stack (
children: [
children: [
Container (
Container (
margin: EdgeInsets
margin: EdgeInsets . fromLTRB ( 0 , 16 , 0 , 0 ) ,
. fromLTRB ( 0 , 1 ,
alignment: Alignment . center ,
0 , 0 ) ,
child: Image . network (
alignment: Alignment
model . finalProducts [ index ] . images . isNotEmpty
. center ,
? model . finalProducts [ index ] . images [ 0 ] . thumb
child:
Image . network (
model
. finalProducts [
index ]
. images
. isNotEmpty
? model
. finalProducts [
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: 7 0,
height: 80 ,
) ,
) ,
) ,
) ,
/ / Container (
Container (
/ / width: model
width: model . finalProducts [ index ] . rxMessage ! = null ? MediaQuery . of ( context ) . size . width / 2.8 : 0 ,
/ / . finalProducts [
padding: EdgeInsets . all ( 4 ) ,
/ / index ]
decoration: BoxDecoration (
/ / . rxMessage ! =
color: Color ( 0xffb23838 ) ,
/ / null
borderRadius: BorderRadius . only ( topLeft: Radius . circular ( 6 ) ) ,
/ / ? MediaQuery . of (
/ / context )
/ / . size
/ / . width /
/ / 2.8
/ / : 0 ,
/ / padding:
/ / EdgeInsets . all (
/ / 4 ) ,
/ / decoration:
/ / BoxDecoration (
/ / color: Color (
/ / 0xffb23838 ) ,
/ / borderRadius: BorderRadius . only (
/ / topLeft: Radius
/ / . circular (
/ / 6 ) ) ,
/ / ) ,
/ / child: model
/ / . finalProducts [
/ / index ]
/ / . rxMessage ! =
/ / null
/ / ? Texts (
/ / languageID = =
/ / ' ar '
/ / ? model
/ / . finalProducts [
/ / index ]
/ / . rxMessagen
/ / : model
/ / . finalProducts [ index ]
/ / . rxMessage ,
/ / color: Colors
/ / . white ,
/ / regular:
/ / true ,
/ / fontSize:
/ / 10 ,
/ / fontWeight:
/ / FontWeight
/ / . w600 ,
/ / )
/ / : Texts ( " " ) ,
/ / ) ,
] ,
) ,
Container (
margin: EdgeInsets
. symmetric (
horizontal: 0 ,
vertical: 2 ,
) ,
width: model
. finalProducts [
index ]
. rxMessage ! =
null
? MediaQuery . of (
context )
. size
. width /
2.0
: 0 ,
padding:
EdgeInsets . fromLTRB ( 8 , 4 , 8 , 4 ) ,
decoration:
BoxDecoration (
color: Color (
0xffb23838 ) ,
/ / borderRadius: BorderRadius . only (
/ / topLeft: Radius
/ / . circular (
/ / 6 ) ) ,
) ,
) ,
child: model
child: model . finalProducts [ index ] . rxMessage ! = null
. finalProducts [
index ]
. rxMessage ! =
null
? Texts (
? Texts (
languageID = =
languageID = = ' ar ' ? model . finalProducts [ index ] . rxMessagen : model . finalProducts [ index ] . rxMessage ,
' ar '
color: Colors . white ,
? model
regular: true ,
. finalProducts [
fontSize: 10 ,
index ]
fontWeight: FontWeight . w600 ,
. rxMessagen
: model
. finalProducts [ index ]
. rxMessage ,
color: Colors
. white ,
regular:
true ,
fontSize:
10 ,
fontWeight:
FontWeight
. w600 ,
)
)
: Texts ( " " ) ,
: Texts ( " " ) ,
) ,
) ,
] ,
) ,
Container (
Container (
margin: EdgeInsets
margin: EdgeInsets . symmetric (
. symmetric (
horizontal: 6 ,
horizontal: 6 ,
vertical: 0 ,
vertical: 0 ,
) ,
) ,
child: Column (
child: Column (
crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment . start ,
CrossAxisAlignment
. start ,
children: [
children: [
if ( model
if ( model . finalProducts [ index ] . discountName ! = null )
. finalProducts [
index ]
. discountName ! =
null )
Container (
Container (
width: double
width: double . infinity ,
. 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 . finalProducts [ index ] . discountName ,
. finalProducts [
regular: true ,
index ]
color: Colors . white ,
. discountName ,
fontSize: 10.4 ,
regular:
true ,
color: Colors
. white ,
fontSize:
10.4 ,
) ,
) ,
) ,
) ,
) ,
) ,
Texts (
Texts (
model
model . finalProducts [ index ] . name ,
. finalProducts [
index ]
. 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 . finalProducts [ index ] . price } " ,
" SAR ${ model . finalProducts [ index ] . price } " ,
bold: true ,
bold: true ,
@ -427,20 +274,15 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Row (
Row (
children: [
children: [
StarRating (
StarRating (
totalAverage: model . finalProducts [ index ] . approvedRatingSum >
totalAverage: model . finalProducts [ index ] . approvedRatingSum > 0
0
? ( model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) / model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) ) . toDouble ( )
? ( model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) / model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) )
. toDouble ( )
: 0 ,
: 0 ,
forceStars:
forceStars: true ) ,
true ) ,
Texts (
Texts (
" ( ${ model . finalProducts [ index ] . approvedTotalReviews } ) " ,
" ( ${ model . finalProducts [ index ] . approvedTotalReviews } ) " ,
regular: true ,
regular: true ,
fontSize: 10 ,
fontSize: 10 ,
fontWeight:
fontWeight: FontWeight . w400 ,
FontWeight
. w400 ,
)
)
] ,
] ,
) ,
) ,
@ -455,9 +297,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Navigator . push (
Navigator . push (
context ,
context ,
FadePage (
FadePage (
page: ProductDetailPage (
page: ProductDetailPage ( model . finalProducts [ index ] ) ,
model . finalProducts [
index ] ) ,
) ) ,
) ) ,
} ,
} ,
) ) ;
) ) ;
@ -466,10 +306,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
)
)
: Container (
: Container (
child: Column (
child: Column (
mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment . center ,
MainAxisAlignment . center ,
crossAxisAlignment: CrossAxisAlignment . center ,
crossAxisAlignment:
CrossAxisAlignment . center ,
children: [
children: [
Align (
Align (
alignment: Alignment . center ,
alignment: Alignment . center ,
@ -493,285 +331,143 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
: Expanded (
: Expanded (
child: model . finalProducts . length > 0
child: model . finalProducts . length > 0
? Container (
? Container (
height: MediaQuery . of ( context ) . size . height *
height: MediaQuery . of ( context ) . size . height * 5.0 ,
5.0 ,
child: ListView . builder (
child: ListView . builder (
itemCount: model . finalProducts . length ,
itemCount: model . finalProducts . length ,
itemBuilder:
itemBuilder: ( BuildContext context , int index ) {
( BuildContext context , int index ) {
return InkWell (
return InkWell (
child: Card (
child: Card (
child: Padding (
child: Row (
padding: const EdgeInsets . all ( 4.0 ) ,
children: [
child: Row (
Stack (
children: [
children: [
Stack (
Column (
children: [
children: [
Column (
Container (
children: [
decoration: BoxDecoration ( ) ,
Container (
child: Padding (
decoration:
padding: EdgeInsets . only (
BoxDecoration ( ) ,
left: 9.0 ,
child: Padding (
top: 8.0 ,
padding:
right: 10.0 ,
EdgeInsets
. only (
left: 2.0 ,
top: 2.0 ,
right: 2.0 ,
) ,
) ,
) ,
) ,
) ,
Container (
) ,
/ / margin: EdgeInsets
Container (
/ / . fromLTRB (
margin: EdgeInsets . fromLTRB ( 0 , 0 , 0 , 0 ) ,
/ / 8 , 0 , 8 , 0 ) ,
alignment: Alignment . center ,
alignment: Alignment
child: Image . network (
. center ,
model . finalProducts [ index ] . images . isNotEmpty
child:
? model . finalProducts [ index ] . images [ 0 ] . thumb
Image . network (
: ' https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png ' ,
model
fit: BoxFit . contain ,
. finalProducts [
height: 80 ,
index ]
. images
. isNotEmpty
? model
. finalProducts [
index ]
. images [ 0 ]
. thumb
: ' https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png ' ,
fit: BoxFit
. contain ,
height: 70 ,
) ,
) ,
) ,
] ,
) ,
) ,
] ,
/ / Column (
/ / children: [
/ / Container (
/ / width: model
/ / . finalProducts [
/ / index ]
/ / . rxMessage ! =
/ / null
/ / ? MediaQuery . of (
/ / context )
/ / . size
/ / . width /
/ / 5.3
/ / : 0 ,
/ / padding:
/ / EdgeInsets . all (
/ / 4 ) ,
/ / decoration:
/ / BoxDecoration (
/ / color: Color (
/ / 0xffb23838 ) ,
/ / borderRadius: BorderRadius . only (
/ / topLeft: Radius
/ / . circular (
/ / 6 ) ) ,
/ / ) ,
/ / child: Texts (
/ / model
/ / . finalProducts [
/ / index ]
/ / . rxMessage ! =
/ / null
/ / ? model
/ / . finalProducts [
/ / index ]
/ / . rxMessage
/ / : " " ,
/ / color:
/ / Colors . white ,
/ / regular: true ,
/ / fontSize: 10 ,
/ / fontWeight:
/ / FontWeight
/ / . w600 ,
/ / ) ,
/ / ) ,
/ / ] ,
/ / ) ,
] ,
) ,
Container (
height: 130.0 ,
margin:
EdgeInsets . symmetric (
horizontal: 0 ,
vertical: 6 ,
) ,
) ,
child: Column (
Column (
mainAxisAlignment:
MainAxisAlignment
. spaceAround ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
children: [
Container (
Container (
margin: EdgeInsets
width: model . finalProducts [ index ] . rxMessage ! = null ? MediaQuery . of ( context ) . size . width / 5.3 : 0 ,
. symmetric (
padding: EdgeInsets . all ( 4 ) ,
horizontal: 4 ,
decoration: BoxDecoration (
vertical: 0 ,
color: Color ( 0xffb23838 ) ,
) ,
borderRadius: BorderRadius . only ( topLeft: Radius . circular ( 6 ) ) ,
width: model
. finalProducts [
index ]
. rxMessage ! =
null
? MediaQuery . of (
context )
. size
. width /
2.0
: 0 ,
padding:
EdgeInsets . all (
4 ) ,
decoration:
BoxDecoration (
color: Color (
0xffb23838 ) ,
/ / borderRadius: BorderRadius . only (
/ / topLeft: Radius
/ / . circular (
/ / 6 ) ) ,
) ,
) ,
child: model
. finalProducts [
index ]
. rxMessage ! =
null
? Texts (
languageID = =
' ar '
? model
. finalProducts [
index ]
. rxMessagen
: model
. finalProducts [ index ]
. rxMessage ,
color: Colors
. white ,
regular:
true ,
fontSize:
10 ,
fontWeight:
FontWeight
. w600 ,
)
: Texts ( " " ) ,
) ,
SizedBox (
height: 4.0 ,
) ,
Container (
width: MediaQuery . of (
context )
. size
. width *
0.65 ,
child: Texts (
child: Texts (
model
model . finalProducts [ index ] . rxMessage ! = null ? model . finalProducts [ index ] . rxMessage : " " ,
. finalProducts [
color: Colors . white ,
index ]
. name ,
regular: true ,
regular: true ,
fontSize: 13.2 ,
fontSize: 10 ,
fontWeight:
fontWeight: FontWeight . w600 ,
FontWeight . w500 ,
maxLines: 5 ,
) ,
) ,
) ,
) ,
SizedBox (
height: 8.0 ,
) ,
Padding (
padding:
const EdgeInsets
. only (
top: 4 ,
bottom: 4 ) ,
child: Texts (
" SAR ${ model . finalProducts [ index ] . price } " ,
bold: true ,
fontSize: 14 ,
) ,
) ,
Row (
children: [
StarRating (
totalAverage: model
. finalProducts [
index ]
. approvedRatingSum >
0
? ( model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) /
model . finalProducts [ index ] . approvedRatingSum
. toDouble ( ) )
. toDouble ( )
: 0 ,
forceStars:
true ) ,
Texts (
" ( ${ model . finalProducts [ index ] . approvedTotalReviews } ) " ,
regular: true ,
fontSize: 10 ,
fontWeight:
FontWeight
. w400 ,
)
] ,
) ,
] ,
] ,
) ,
) ,
] ,
) ,
Container (
height: 100.0 ,
margin: EdgeInsets . symmetric (
horizontal: 6 ,
vertical: 0 ,
) ,
) ,
child: Column (
widget . authenticatedUserObject . isLogin
mainAxisAlignment: MainAxisAlignment . spaceAround ,
? Container (
crossAxisAlignment: CrossAxisAlignment . start ,
child: IconButton (
children: [
icon: Icon ( Icons . shopping_cart ,
SizedBox (
size: 18 ,
height: 4.0 ,
color: Colors . blue , ) ,
) ,
onPressed: ( ) async {
Container (
if ( model . finalProducts [ index ] . rxMessage = = null ) {
width: MediaQuery . of ( context ) . size . width * 0.65 ,
GifLoaderDialogUtils . showMyDialog ( context ) ;
child: Texts (
await addToCartFunction ( 1 , model . finalProducts [ index ] . id ) ;
model . finalProducts [ index ] . name ,
GifLoaderDialogUtils . hideDialog ( context ) ;
regular: true ,
Navigator . push (
fontSize: 13.2 ,
context ,
fontWeight: FontWeight . w500 ,
FadePage ( page: CartOrderPage ( ) ) ) ;
maxLines: 5 ,
}
) ,
else {
) ,
AppToast . showErrorToast ( message: TranslationBase . of ( context ) . needPrescription ) ;
SizedBox (
}
height: 8.0 ,
) ,
Padding (
padding: const EdgeInsets . only ( top: 4 , bottom: 4 ) ,
child: Texts (
" SAR ${ model . finalProducts [ index ] . price } " ,
bold: true ,
fontSize: 14 ,
) ,
) ,
Row (
children: [
StarRating (
totalAverage: model . finalProducts [ index ] . approvedRatingSum > 0
? ( model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) / model . finalProducts [ index ] . approvedRatingSum . toDouble ( ) ) . toDouble ( )
: 0 ,
forceStars: true ) ,
Texts (
" ( ${ model . finalProducts [ index ] . approvedTotalReviews } ) " ,
regular: true ,
fontSize: 10 ,
fontWeight: FontWeight . w400 ,
)
] ,
) ,
] ,
) ,
) ,
widget . authenticatedUserObject . isLogin
? Container (
child: IconButton (
icon: Icon (
Icons . shopping_cart ,
size: 18 ,
color: Colors . blue ,
) ,
onPressed: ( ) async {
if ( model . finalProducts [ index ] . rxMessage = = null ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
await addToCartFunction ( 1 , model . finalProducts [ index ] . id ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
Navigator . push ( context , FadePage ( page: CartOrderPage ( ) ) ) ;
} else {
AppToast . showErrorToast ( message: TranslationBase . of ( context ) . needPrescription ) ;
}
/ /
/ /
}
} ) ,
)
) ,
: Container ( ) ,
) : Container ( ) ,
] ,
] ,
) ,
) ,
) ,
) ,
) ,
onTap: ( ) = > {
onTap: ( ) = > {
Navigator . push (
Navigator . push (
context ,
context ,
FadePage (
FadePage (
page: ProductDetailPage (
page: ProductDetailPage ( model . finalProducts [ index ] ) ,
model . finalProducts [
index ] ) ,
) ) ,
) ) ,
} ,
} ,
) ;
) ;
@ -779,10 +475,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
)
)
: Container (
: Container (
child: Column (
child: Column (
mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment . center ,
MainAxisAlignment . center ,
crossAxisAlignment: CrossAxisAlignment . center ,
crossAxisAlignment:
CrossAxisAlignment . center ,
children: [
children: [
Align (
Align (
alignment: Alignment . center ,
alignment: Alignment . center ,