@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_
import ' package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart ' ;
import ' package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart ' ;
@ -17,8 +18,11 @@ class OrderPreviewPage extends StatefulWidget {
final List < Addresses > addresses ;
final OrderPreviewViewModel model ;
OrderPreviewPage ( { this . addresses , this . model } ) ;
@ override
_OrderPreviewPageState createState ( ) = > _OrderPreviewPageState ( ) ;
}
@ -26,6 +30,10 @@ class OrderPreviewPage extends StatefulWidget {
class _OrderPreviewPageState extends State < OrderPreviewPage > {
MyInAppBrowser browser ;
bool isLoading = true ;
bool isChecked = false ;
@ override
void initState ( ) {
@ -40,6 +48,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
} ) ;
}
@ override
Widget build ( BuildContext context ) {
final mediaQuery = MediaQuery . of ( context ) ;
@ -74,7 +83,79 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
? Container (
child: Column (
children: [
LakumWidget ( widget . model ) ,
/ / LakumWidget ( widget . model ) ,
Container (
color: Colors . white ,
padding: EdgeInsets . symmetric ( vertical: 12 , horizontal: 12 ) ,
child: Row (
children: [
Row (
children: [
SizedBox (
height: 24.0 ,
width: 24.0 ,
child: Checkbox (
activeColor: CustomColors . green ,
value: isChecked ,
onChanged: ( bool value ) {
setState ( ( ) {
isChecked = value ;
print ( isChecked ) ;
if ( value ) {
/ / isChecked ;
PaymentBottomWidget . isChecked = true ;
print ( value ) ;
} else {
PaymentBottomWidget . isChecked = false ;
}
setState ( ( ) {
} ) ;
} ) ;
} ,
) ,
) ,
Padding (
padding: const EdgeInsets . only ( left: 8.0 , right: 8.0 ) ,
child: Text (
TranslationBase . of ( context ) . useLakumPoints +
" ( ${ widget . model . paymentCheckoutData . lacumInformation . lakumInquiryInformationObjVersion . pointsBalance . toString ( ) + " " + TranslationBase . of ( context ) . points } ) " ,
style: TextStyle ( fontSize: 12.0 , fontWeight: FontWeight . w600 , letterSpacing: - 0.56 ) ) ,
) ,
] ,
) ,
Expanded (
child: Container (
decoration: BoxDecoration ( color: Color ( 0x99ffffff ) ) ,
padding: const EdgeInsets . symmetric ( horizontal: 8 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . end ,
children: [
Container (
decoration: BoxDecoration ( color: Color ( 0x99ffffff ) ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Texts (
" ${ TranslationBase . of ( context ) . availableBalance } " ,
fontSize: 12 ,
fontWeight: FontWeight . bold ,
) ,
Text (
" ${ TranslationBase . of ( context ) . sar + " " + widget . model . paymentCheckoutData . lacumInformation . lakumInquiryInformationObjVersion . pointsBalanceAmount . toString ( ) } " ,
style: TextStyle ( fontSize: 12.0 , fontWeight: FontWeight . w600 , letterSpacing: - 0.56 )
) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ,
] ,
) ,
) ,
SizedBox (
height: 10 ,
) ,
@ -190,7 +271,32 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
indent: 0 ,
endIndent: 0 ,
) ,
isChecked ?
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Texts (
" ${ TranslationBase . of ( context ) . lakum } " ,
fontSize: 14 ,
color: Colors . green ,
fontWeight: FontWeight . w500 ,
) ,
Texts (
" - ${ TranslationBase . of ( context ) . sar } ${ ( widget . model . paymentCheckoutData . lacumInformation . lakumInquiryInformationObjVersion . pointsBalanceAmount ) . toStringAsFixed ( 2 ) } " ,
fontSize: 14 ,
color: Colors . green ,
fontWeight: FontWeight . w500 ,
) ,
] ,
) : Container ( ) ,
isChecked ? const Divider (
color: Color ( 0xFFD6D6D6 ) ,
height: 20 ,
thickness: 1 ,
indent: 0 ,
endIndent: 0 ,
) : Container ( ) ,
isChecked ? Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Texts (
@ -200,7 +306,24 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight . bold ,
) ,
Texts (
" ${ TranslationBase . of ( context ) . sar } ${ ( widget . model . cartResponse . totalAmount ) . toStringAsFixed ( 2 ) } " ,
" ${ TranslationBase . of ( context ) . sar } " " ${ ( widget . model . cartResponse . totalAmount - widget . model . paymentCheckoutData . lacumInformation . lakumInquiryInformationObjVersion . pointsBalanceAmount ) . toStringAsFixed ( 2 ) } " ,
fontSize: 14 ,
color: Colors . black ,
fontWeight: FontWeight . bold ,
) ,
] ,
)
: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Texts (
TranslationBase . of ( context ) . total ,
fontSize: 14 ,
color: Colors . black ,
fontWeight: FontWeight . bold ,
) ,
Texts (
" ${ TranslationBase . of ( context ) . sar } ${ ( widget . model . cartResponse . totalAmount ) . toStringAsFixed ( 2 ) } " ,
fontSize: 14 ,
color: Colors . black ,
fontWeight: FontWeight . bold ,
@ -228,9 +351,12 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: PaymentBottomWidget ( widget . model ) ,
) ,
) ;
}
changeMainState ( ) {
setState ( ( ) { } ) ;
}
}