lakum fixes

merge-requests/528/head
haroon amjad 4 years ago
parent 975fe6ca7b
commit 61a406085b

@ -1,5 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert' as convert; import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
@ -92,8 +92,8 @@ class LacumViewModel extends BaseViewModel {
Uint8List convertBase64ToBarCodeImage() { Uint8List convertBase64ToBarCodeImage() {
try { try {
final _byteImage = convert.base64Decode( final _byteImage = base64Decode(
lacumGroupInformation.lakumInquiryInformationObjVersion.barCode); lacumGroupInformation.lakumInquiryInformationObjVersion.barCode.split(',').last);
return _byteImage; return _byteImage;
} catch (e) { } catch (e) {
print(e); print(e);

@ -69,16 +69,15 @@ class LakumMainPage extends StatelessWidget {
], ],
), ),
SizedBox( SizedBox(
width: 8, height: 12,
), ),
LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount, LakumHomeButtons(mediaQuery, model),
model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
SizedBox( SizedBox(
height: 20, height: 12,
), ),
Container( Container(
height: 125, height: 100,
margin: EdgeInsets.symmetric(horizontal: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0),
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
@ -109,15 +108,15 @@ class LakumMainPage extends StatelessWidget {
], ],
), ),
), ),
LacumPointsWidget( // LacumPointsWidget(
mediaQuery, // mediaQuery,
3, // 3,
TranslationBase.of(context).consumed, // TranslationBase.of(context).consumed,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null // model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount) // ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
: 0, // : 0,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints, // model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear), // model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),

@ -16,13 +16,10 @@ class PaymentMethodSelectPage extends StatefulWidget {
final bool isUpdating; final bool isUpdating;
final Function changeMainState; final Function changeMainState;
const PaymentMethodSelectPage( const PaymentMethodSelectPage({Key key, this.model, this.isUpdating = false, this.changeMainState}) : super(key: key);
{Key key, this.model, this.isUpdating = false, this.changeMainState})
: super(key: key);
@override @override
_PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState();
_PaymentMethodSelectPageState();
} }
class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> { class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
@ -85,16 +82,17 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
selectedPaymentOption = PaymentOption.mastercard; selectedPaymentOption = PaymentOption.mastercard;
}) })
}), }),
PaymentMethodCard( widget.model.cartResponse.totalAmount > 1000
cardWidth, ? PaymentMethodCard(
selectedPaymentOption, cardWidth,
PaymentOption.installments, selectedPaymentOption,
() => { PaymentOption.installments,
setState(() { () => {
selectedPaymentOption = setState(() {
PaymentOption.installments; selectedPaymentOption = PaymentOption.installments;
}) })
}), })
: Container(),
if (Platform.isIOS) if (Platform.isIOS)
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
@ -118,8 +116,7 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
TranslationBase.of(context).next, TranslationBase.of(context).next,
selectedPaymentOption != null selectedPaymentOption != null
? () { ? () {
widget.model.paymentCheckoutData.paymentOption = widget.model.paymentCheckoutData.paymentOption = selectedPaymentOption;
selectedPaymentOption;
if (widget.isUpdating) { if (widget.isUpdating) {
widget.changeMainState(); widget.changeMainState();
Navigator.pop(context); Navigator.pop(context);
@ -150,14 +147,12 @@ class PaymentMethodCard extends StatelessWidget {
final PaymentOption paymentOption; final PaymentOption paymentOption;
final Function selectMethod; final Function selectMethod;
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod);
this.paymentOption, this.selectMethod);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isSelected = false; bool isSelected = false;
if (selectedPaymentOption != null && if (selectedPaymentOption != null && selectedPaymentOption == paymentOption) {
selectedPaymentOption == paymentOption) {
isSelected = true; isSelected = true;
} }
@ -171,9 +166,7 @@ class PaymentMethodCard extends StatelessWidget {
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: isSelected side: isSelected ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
? BorderSide(color: Colors.green, width: 2.0)
: BorderSide(color: Colors.transparent, width: 0.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
@ -182,13 +175,7 @@ class PaymentMethodCard extends StatelessWidget {
Container( Container(
width: 24, width: 24,
height: 24, height: 24,
decoration: containerColorRadiusBorderWidth( decoration: containerColorRadiusBorderWidth(isSelected ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
isSelected
? CustomColors.accentColor
: Colors.transparent,
100,
Colors.grey,
0.5),
), ),
mWidth(12), mWidth(12),
Container( Container(
@ -200,8 +187,7 @@ class PaymentMethodCard extends StatelessWidget {
if (isSelected) if (isSelected)
Container( Container(
decoration: containerRadius(CustomColors.green, 200), decoration: containerRadius(CustomColors.green, 200),
padding: padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text( child: Text(
TranslationBase.of(context).paymentSelected, TranslationBase.of(context).paymentSelected,
style: TextStyle( style: TextStyle(

@ -229,13 +229,15 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
width: widget.mediaQuery.size.width * 1.0, width: widget.mediaQuery.size.width * 1.0,
height: widget.mediaQuery.size.width * 1.0, height: widget.mediaQuery.size.width * 1.0,
), ),
Container( Center(
margin: EdgeInsets.fromLTRB(12, 70, 12, 4), child: Container(
child: widget.model.convertBase64ToBarCodeImage() != margin: EdgeInsets.fromLTRB(12, 70, 12, 4),
null child: widget.model.convertBase64ToBarCodeImage() !=
? Image.memory( null
widget.model.convertBase64ToBarCodeImage()) ? Image.memory(
: Container(), widget.model.convertBase64ToBarCodeImage())
: Container(),
),
), ),
], ],
), ),

@ -217,12 +217,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
Container( Container(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
child: SvgPicture.asset( child: Icon(
projectViewModel.isArabic Icons.arrow_forward,
? 'assets/images/pharmacy/arrow_left.svg' size: 18,
: 'assets/images/pharmacy/arrow_right.svg', color: Colors.grey[500],
height: 20,
width: 20,
), ),
), ),
], ],
@ -503,12 +501,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
Container( Container(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
child: SvgPicture.asset( child: Icon(
projectViewModel.isArabic Icons.arrow_forward,
? 'assets/images/pharmacy/arrow_left.svg' size: 18,
: 'assets/images/pharmacy/arrow_right.svg', color: Colors.grey[500],
height: 20,
width: 20,
), ),
), ),
], ],
@ -969,12 +965,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
Container( Container(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
child: SvgPicture.asset( child: Icon(
projectViewModel.isArabic Icons.arrow_forward,
? 'assets/images/pharmacy/arrow_left.svg' size: 18,
: 'assets/images/pharmacy/arrow_right.svg', color: Colors.grey[500],
height: 20,
width: 20,
), ),
), ),
], ],
@ -1139,7 +1133,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
cancelledOrderList.clear(); cancelledOrderList.clear();
for (int i = 0; i < model.orders.length; i++) { for (int i = 0; i < model.orders.length; i++) {
if (model.orders[i].orderStatusId == 40 || if (model.orders[i].orderStatusId == 40 ||
model.orders[i].orderStatus == 996 || model.orders[i].orderStatusId == 996 ||
model.orders[i].orderStatusId == 200) { model.orders[i].orderStatusId == 200) {
cancelledOrderList.add(model.orders[i]); cancelledOrderList.add(model.orders[i]);
} }
@ -1243,12 +1237,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
Container( Container(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
child: SvgPicture.asset( child: Icon(
projectViewModel.isArabic Icons.arrow_forward,
? 'assets/images/pharmacy/arrow_left.svg' size: 18,
: 'assets/images/pharmacy/arrow_right.svg', color: Colors.grey[500],
height: 20,
width: 20,
), ),
), ),
], ],

@ -62,7 +62,7 @@ class _AddAddressPageState extends State<AddAddressPage> {
return BaseView<PharmacyAddressesViewModel>( return BaseView<PharmacyAddressesViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).changeAddress, appBarTitle: TranslationBase.of(context).changeAddress,
isShowAppBar: true, isShowAppBar: false,
isPharmacy: true, isPharmacy: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Container( body: Container(

Loading…
Cancel
Save