@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import ' package:diplomaticquarterapp/pages/base/base_view.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils.dart ' ;
@ -276,7 +277,7 @@ class OrderBottomWidget extends StatefulWidget {
class _OrderBottomWidgetState extends State < OrderBottomWidget > {
bool isAgree = false ;
bool outOfStock = false ;
@ override
Widget build ( BuildContext context ) {
ProjectViewModel projectProvider = Provider . of ( context ) ;
@ -400,23 +401,49 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
onPressed: isAgree
/ / & & cart . cartResponse . shoppingCarts [ 1 ] . product . stockQuantity = = 0
? ( ) = > {
Navigator . push (
context ,
FadePage (
page:
OrderPreviewPage ( widget . addresses ) ) )
}
: Text ( " remove item " ) ,
if ( cart . isCartItemsOutOfStock ( ) ) {
/ / Toast msg
AppToast . showErrorToast ( message: TranslationBase . of ( context ) . outOfStockMsg )
} else {
Navigator . push (
context ,
FadePage (
page:
OrderPreviewPage ( widget . addresses ) ) )
}
}
: null ,
child: new Text (
" ${ TranslationBase . of ( context ) . checkOut } " ,
style: new TextStyle (
color:
isAgree ? Colors . white : Colors . grey . shade300 ,
isAgree ? Colors . white : Colors . grey . shade300 ,
fontSize: 14 ) ,
) ,
color: Color ( 0xff005aff ) ,
disabledColor: Color ( 0xff005aff ) ,
) ,
)
/ / RaisedButton (
/ / onPressed: isAgree
/ / / / & & cart . cartResponse . shoppingCarts [ 1 ] . product . stockQuantity = = 0
/ / ? ( ) = > {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page:
/ / OrderPreviewPage ( widget . addresses ) ) )
/ / }
/ / : null ,
/ / child: new Text (
/ / " ${ TranslationBase . of ( context ) . checkOut } " ,
/ / style: new TextStyle (
/ / color:
/ / isAgree ? Colors . white : Colors . grey . shade300 ,
/ / fontSize: 14 ) ,
/ / ) ,
/ / color: Color ( 0xff005aff ) ,
/ / disabledColor: Color ( 0xff005aff ) ,
/ / )
] ,
) ,
) ,