lakum fixes

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

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

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

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

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

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

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

Loading…
Cancel
Save