@ -1,7 +1,7 @@
import ' package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart ' ;
import ' package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/cart- order-page.dart' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/cart- page/cart- order-page.dart' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/widgets/buttons/secondary_button.dart ' ;
@ -128,92 +128,104 @@ class _FooterWidgetState extends State<FooterWidget> {
: Container (
height: 20 ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Container (
width: 70 ,
height: 50 ,
child: FlatButton (
child: Column (
mainAxisAlignment: MainAxisAlignment . center ,
crossAxisAlignment: CrossAxisAlignment . center ,
children: [
Expanded (
flex: 4 ,
child: Text (
widget . quantity . toString ( ) ,
style: TextStyle ( fontSize: 20 ) ,
Container (
height: 58 ,
child: Row (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Container (
width: 90 ,
height: 60 ,
child: FlatButton (
child: Column (
mainAxisAlignment: MainAxisAlignment . center ,
crossAxisAlignment: CrossAxisAlignment . center ,
children: [
Expanded (
flex: 4 ,
child: Text (
widget . quantity . toString ( ) ,
style: TextStyle ( fontSize: 20 ) ,
) ,
) ,
) ,
Expanded (
flex: 5 ,
child: Text (
TranslationBase . of ( context ) . quantityShortcut ,
style: TextStyle ( fontSize: 16 ) ,
Expanded (
flex: 5 ,
child: Text (
TranslationBase . of ( context ) . quantityShortcut ,
style: TextStyle ( fontSize: 16 ) ,
) ,
) ,
) ,
] ,
] ,
) ,
onPressed: ( ) {
setState ( ( ) {
if ( showUI ) {
quantityUI = 80 ;
showUI = false ;
} else {
quantityUI = 160 ;
showUI = true ;
}
} ) ;
} ,
) ,
onPressed: ( ) {
setState ( ( ) {
if ( showUI ) {
quantityUI = 80 ;
showUI = false ;
} else {
quantityUI = 160 ;
showUI = true ;
}
} ) ;
} ,
) ,
) ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.45 ,
child: SecondaryButton (
label: TranslationBase . of ( context ) . addToCart . toUpperCase ( ) ,
disabled: ( ! widget . isAvailable & & widget . quantity > 0 ) | | widget . quantity > widget . quantityLimit | | widget . item . isRx ,
onTap: ( ) async {
if ( ! authenticatedUserObject . isLogin ) {
Navigator . of ( context ) . pushNamed (
WELCOME_LOGIN ,
) ;
} else
await widget . addToCartFunction ( quantity: widget . quantity , itemID: widget . item . id , model: widget . model ) ;
} ,
fontWeight: FontWeight . w600 ,
borderColor: Color ( 0xFF4CAF50 ) ,
borderRadius: 3 ,
color: Color ( 0xFF4CAF50 ) ,
SizedBox (
width: 10 ,
) ,
) ,
SizedBox (
width: 5 ,
) ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.35 ,
child: SecondaryButton (
label: TranslationBase . of ( context ) . buyNow . toUpperCase ( ) ,
disabled: ( ! widget . isAvailable & & widget . quantity > 0 ) | | ( widget . quantity > widget . quantityLimit ) | | widget . item . isRx ,
onTap: ( ) async {
await widget . addToShoppingCartFunction ( quantity: widget . quantity , itemID: widget . item . id , model: widget . model ) ;
Navigator . push (
context ,
FadePage ( page: CartOrderPage ( ) ) ,
) ;
} ,
fontWeight: FontWeight . w600 ,
borderColor: Colors . grey [ 800 ] ,
borderRadius: 3 ,
disableColor: Colors . grey [ 700 ] ,
color: ! widget . isAvailable & & widget . quantity > 0 | | widget . quantity > widget . quantityLimit | | widget . item . rxMessage ! = null ? Colors . grey : Colors . grey [ 800 ] ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.35 ,
child: SecondaryButton (
label: TranslationBase . of ( context ) . addToCart . toUpperCase ( ) ,
disabled: ( ! widget . isAvailable & & widget . quantity > 0 ) | | widget . quantity > widget . quantityLimit | | widget . item . isRx ,
onTap: ( ) async {
if ( ! authenticatedUserObject . isLogin ) {
Navigator . of ( context ) . pushNamed (
WELCOME_LOGIN ,
) ;
} else
await widget . addToCartFunction ( quantity: widget . quantity , itemID: widget . item . id , model: widget . model ) ;
} ,
fontWeight: FontWeight . w600 ,
borderColor: Color ( 0xFF4CAF50 ) ,
borderRadius: 3 ,
color: Color ( 0xFF4CAF50 ) ,
) ,
) ,
SizedBox (
width: 5 ,
) ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.35 ,
child: SecondaryButton (
label: TranslationBase . of ( context ) . buyNow . toUpperCase ( ) ,
disabled: ( ! widget . isAvailable & & widget . quantity > 0 ) | | ( widget . quantity > widget . quantityLimit ) | | widget . item . isRx ,
onTap: ( ) async {
if ( ! authenticatedUserObject . isLogin ) {
Navigator . of ( context ) . pushNamed (
WELCOME_LOGIN ,
) ;
} else {
await widget . addToShoppingCartFunction ( quantity: widget . quantity , itemID: widget . item . id , model: widget . model ) ;
Navigator . push (
context ,
FadePage ( page: CartOrderPage ( ) ) ,
) ; }
} ,
fontWeight: FontWeight . w600 ,
borderColor: Colors . grey [ 800 ] ,
borderRadius: 3 ,
disableColor: Colors . grey [ 700 ] ,
color: ! widget . isAvailable & & widget . quantity > 0 | | widget . quantity > widget . quantityLimit | | widget . item . rxMessage ! = null ? Colors . grey : Colors . grey [ 800 ] ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
] ,
) ,
) ;
}