|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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:flutter/material.dart';
|
|
|
|
|
@ -16,6 +17,7 @@ class LakumWidget extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
TextEditingController _pointsController = new TextEditingController();
|
|
|
|
|
bool useLakumWidgets = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -27,29 +29,30 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/lakum/lakum_checkout.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(color: Color(0x99ffffff)),
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).lakumPoints}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 24.0,
|
|
|
|
|
width: 24.0,
|
|
|
|
|
child: Checkbox(
|
|
|
|
|
activeColor: CustomColors.green,
|
|
|
|
|
value: useLakumWidgets,
|
|
|
|
|
onChanged: (bool value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
useLakumWidgets = value;
|
|
|
|
|
print(useLakumWidgets);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
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(
|
|
|
|
|
@ -58,71 +61,93 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).riyal}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4),
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 50,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Colors.black, width: 0.2),
|
|
|
|
|
gapPadding: 0,
|
|
|
|
|
borderRadius: projectProvider.isArabic
|
|
|
|
|
? BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8))
|
|
|
|
|
: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
|
|
|
|
decoration: BoxDecoration(color: Color(0x99ffffff)),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).availableBalance}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Colors.black, width: 0.4),
|
|
|
|
|
gapPadding: 0,
|
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
|
|
|
|
Text(
|
|
|
|
|
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}",
|
|
|
|
|
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
controller: _pointsController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount > 0 ? Colors.black : Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
enabled: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount == 0 ? false : true,
|
|
|
|
|
onChanged: (val) {
|
|
|
|
|
var value = int.tryParse(val);
|
|
|
|
|
if (value != null && value <= widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount) {
|
|
|
|
|
widget.model.paymentCheckoutData.usedLakumPoints = value;
|
|
|
|
|
} else {
|
|
|
|
|
widget.model.paymentCheckoutData.usedLakumPoints = 0;
|
|
|
|
|
}
|
|
|
|
|
_pointsController.text = "${widget.model.paymentCheckoutData.usedLakumPoints}";
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 50,
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: Color(0xff3666E0),
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: projectProvider.isArabic
|
|
|
|
|
? BorderRadius.only(topLeft: Radius.circular(6), bottomLeft: Radius.circular(6))
|
|
|
|
|
: BorderRadius.only(topRight: Radius.circular(6), bottomRight: Radius.circular(6)),
|
|
|
|
|
border: Border.fromBorderSide(BorderSide(
|
|
|
|
|
color: Color(0xff3666E0),
|
|
|
|
|
width: 0.8,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).use}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
// children: [
|
|
|
|
|
// Texts(
|
|
|
|
|
// "${TranslationBase.of(context).riyal}",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4),
|
|
|
|
|
// width: 60,
|
|
|
|
|
// height: 50,
|
|
|
|
|
// child: TextField(
|
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(color: Colors.black, width: 0.2),
|
|
|
|
|
// gapPadding: 0,
|
|
|
|
|
// borderRadius: projectProvider.isArabic
|
|
|
|
|
// ? BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8))
|
|
|
|
|
// : BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
|
|
|
|
// ),
|
|
|
|
|
// disabledBorder: OutlineInputBorder(
|
|
|
|
|
// borderSide: BorderSide(color: Colors.black, width: 0.4),
|
|
|
|
|
// gapPadding: 0,
|
|
|
|
|
// borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// controller: _pointsController,
|
|
|
|
|
// keyboardType: TextInputType.number,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// color: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount > 0 ? Colors.black : Colors.grey,
|
|
|
|
|
// ),
|
|
|
|
|
// enabled: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount == 0 ? false : true,
|
|
|
|
|
// onChanged: (val) {
|
|
|
|
|
// var value = int.tryParse(val);
|
|
|
|
|
// if (value != null && value <= widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount) {
|
|
|
|
|
// widget.model.paymentCheckoutData.usedLakumPoints = value;
|
|
|
|
|
// } else {
|
|
|
|
|
// widget.model.paymentCheckoutData.usedLakumPoints = 0;
|
|
|
|
|
// }
|
|
|
|
|
// _pointsController.text = "${widget.model.paymentCheckoutData.usedLakumPoints}";
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: 50,
|
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
|
|
|
|
// decoration: new BoxDecoration(
|
|
|
|
|
// color: Color(0xff3666E0),
|
|
|
|
|
// shape: BoxShape.rectangle,
|
|
|
|
|
// borderRadius: projectProvider.isArabic
|
|
|
|
|
// ? BorderRadius.only(topLeft: Radius.circular(6), bottomLeft: Radius.circular(6))
|
|
|
|
|
// : BorderRadius.only(topRight: Radius.circular(6), bottomRight: Radius.circular(6)),
|
|
|
|
|
// border: Border.fromBorderSide(BorderSide(
|
|
|
|
|
// color: Color(0xff3666E0),
|
|
|
|
|
// width: 0.8,
|
|
|
|
|
// )),
|
|
|
|
|
// ),
|
|
|
|
|
// child: Texts(
|
|
|
|
|
// "${TranslationBase.of(context).use}",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|