|
|
|
|
@ -20,21 +20,23 @@ import 'package:http/http.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class CartOrderPage extends StatefulWidget {
|
|
|
|
|
const CartOrderPage({Key key}) : super(key: key);
|
|
|
|
|
final Function(int) changeTab;
|
|
|
|
|
|
|
|
|
|
const CartOrderPage({Key key, this.changeTab}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_CartOrderPageState createState() => _CartOrderPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _CartOrderPageState extends State<CartOrderPage> {
|
|
|
|
|
|
|
|
|
|
bool isLoading = true;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
getData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final mediaQuery = MediaQuery.of(context);
|
|
|
|
|
@ -53,195 +55,194 @@ class _CartOrderPageState extends State<CartOrderPage> {
|
|
|
|
|
showHomeAppBarIcon: false,
|
|
|
|
|
isShowDecPage: true,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
backButtonTab: widget.changeTab != null ? () => widget.changeTab(0) : null,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
body: !(model.cartResponse.shoppingCarts == null ||
|
|
|
|
|
model.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
model.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
? Container(
|
|
|
|
|
height: height * 0.85,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
GestureIconButton(
|
|
|
|
|
TranslationBase.of(context).deleteAllItems,
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.delete_outline_sharp,
|
|
|
|
|
color: Colors.grey.shade700,
|
|
|
|
|
),
|
|
|
|
|
onTap: () => {model.deleteShoppingCart()},
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: height * 0.85,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.cartResponse.shoppingCarts != null
|
|
|
|
|
? model.cartResponse.shoppingCarts.length
|
|
|
|
|
: 0,
|
|
|
|
|
(index) => ProductOrderItem(
|
|
|
|
|
model.cartResponse.shoppingCarts[index], () {
|
|
|
|
|
print(model.cartResponse.shoppingCarts[index]
|
|
|
|
|
.quantity);
|
|
|
|
|
model
|
|
|
|
|
.changeProductQuantity(
|
|
|
|
|
model.cartResponse.shoppingCarts[index])
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state !=
|
|
|
|
|
ViewState.Error) {
|
|
|
|
|
appScaffold.appBar.badgeUpdater(
|
|
|
|
|
'${value.quantityCount ?? 0}');
|
|
|
|
|
}
|
|
|
|
|
if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
Utils.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, () {
|
|
|
|
|
model
|
|
|
|
|
.deleteProduct(
|
|
|
|
|
model.cartResponse.shoppingCarts[index])
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state !=
|
|
|
|
|
ViewState.Error) {
|
|
|
|
|
appScaffold.appBar.badgeUpdater(
|
|
|
|
|
'${value.quantityCount ?? 0}');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}))
|
|
|
|
|
GestureIconButton(
|
|
|
|
|
TranslationBase.of(context).deleteAllItems,
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.delete_outline_sharp,
|
|
|
|
|
color: Colors.grey.shade700,
|
|
|
|
|
),
|
|
|
|
|
onTap: () => {model.deleteShoppingCart()},
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.cartResponse.shoppingCarts != null
|
|
|
|
|
? model.cartResponse.shoppingCarts.length
|
|
|
|
|
: 0,
|
|
|
|
|
(index) => ProductOrderItem(
|
|
|
|
|
model.cartResponse
|
|
|
|
|
.shoppingCarts[index], () {
|
|
|
|
|
print(model.cartResponse
|
|
|
|
|
.shoppingCarts[index].quantity);
|
|
|
|
|
model
|
|
|
|
|
.changeProductQuantity(model
|
|
|
|
|
.cartResponse
|
|
|
|
|
.shoppingCarts[index])
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state != ViewState.Error) {
|
|
|
|
|
appScaffold.appBar.badgeUpdater(
|
|
|
|
|
'${value.quantityCount ?? 0}');
|
|
|
|
|
}
|
|
|
|
|
if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, () {
|
|
|
|
|
model
|
|
|
|
|
.deleteProduct(model.cartResponse
|
|
|
|
|
.shoppingCarts[index])
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state != ViewState.Error) {
|
|
|
|
|
appScaffold.appBar.badgeUpdater(
|
|
|
|
|
'${value.quantityCount ?? 0}');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 2,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).subtotal,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).vat}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).total,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/payment_image.png",
|
|
|
|
|
width: mediaQuery.size.width - 20,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 120,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 2,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).subtotal,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).vat}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).total,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: 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,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).noData,
|
|
|
|
|
// 'There is no data',
|
|
|
|
|
style: TextStyle(fontSize: 30),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/payment_image.png",
|
|
|
|
|
width: mediaQuery.size.width - 20,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 120,)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: 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(
|
|
|
|
|
TranslationBase.of(context).noData,
|
|
|
|
|
// 'There is no data',
|
|
|
|
|
style: TextStyle(fontSize: 30),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
height: !(model.cartResponse.shoppingCarts == null ||
|
|
|
|
|
model.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
model.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
? height * 0.15
|
|
|
|
|
: 0,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
@ -251,13 +252,12 @@ class _CartOrderPageState extends State<CartOrderPage> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getData()async {
|
|
|
|
|
|
|
|
|
|
await Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
|
|
|
|
|
void getData() async {
|
|
|
|
|
await Provider.of<OrderPreviewViewModel>(context, listen: false)
|
|
|
|
|
.getShoppingCart();
|
|
|
|
|
setState(() {
|
|
|
|
|
isLoading= false;
|
|
|
|
|
isLoading = false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -279,148 +279,145 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
|
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
|
OrderPreviewViewModel cart = Provider.of(context);
|
|
|
|
|
return !(cart.cartResponse.shoppingCarts == null ||
|
|
|
|
|
cart.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
cart.cartResponse.shoppingCarts.length == 0)
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 1,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: widget.height * 0.070,
|
|
|
|
|
color: Color(0xffe6ffe0),
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAgree = !isAgree;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 25.0,
|
|
|
|
|
height: widget.height * 0.070,
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color:
|
|
|
|
|
!isAgree ? Color(0xffeeeeee) : Colors.green,
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: !isAgree
|
|
|
|
|
? null
|
|
|
|
|
: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(0.0),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.check,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 25,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.pharmacyServiceTermsCondition,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
color: Colors.grey.shade800,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Divider(
|
|
|
|
|
color: Color(0xFFD6D6D6),
|
|
|
|
|
height: 1,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () => {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
FadePage(page: PharmacyTermsConditions()))
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.info,
|
|
|
|
|
size: 25,
|
|
|
|
|
color: Color(0xff005aff),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: widget.height * 0.070,
|
|
|
|
|
color: Color(0xffe6ffe0),
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAgree = !isAgree;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 25.0,
|
|
|
|
|
height: widget.height * 0.070,
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: !isAgree ? Color(0xffeeeeee) : Colors.green,
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: !isAgree
|
|
|
|
|
? null
|
|
|
|
|
: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(0.0),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.check,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
size: 25,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.pharmacyServiceTermsCondition,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
color: Colors.grey.shade800,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () => {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context, FadePage(page: PharmacyTermsConditions()))
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.info,
|
|
|
|
|
size: 25,
|
|
|
|
|
color: Color(0xff005aff),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: widget.height * 0.065,
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 2),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
Container(
|
|
|
|
|
height: widget.height * 0.065,
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 2),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 0, vertical: 0),
|
|
|
|
|
child: Row(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 0, vertical: 0),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: projectProvider.isArabic ? 12 : 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).inclusiveVat}",
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize:
|
|
|
|
|
projectProvider.isArabic ? 12 : 14,
|
|
|
|
|
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).inclusiveVat}",
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
RaisedButton(
|
|
|
|
|
onPressed: isAgree
|
|
|
|
|
? () => {
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RaisedButton(
|
|
|
|
|
onPressed: isAgree
|
|
|
|
|
? () => {
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
: Container();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|