Hide discount widgets for crypto flavor
This commit is contained in:
@@ -40,7 +40,6 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
int bonusMinus = 0;
|
||||
int currency;
|
||||
bool showBonus;
|
||||
String flavor;
|
||||
|
||||
@override String getTitle() {
|
||||
return StringsLocalization.carryingPurchase();
|
||||
@@ -51,6 +50,7 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
}
|
||||
|
||||
@override Widget build(BuildContext context) {
|
||||
|
||||
if (currency == null) {
|
||||
helper.getCurrency().then((currency) {
|
||||
setState(() {
|
||||
@@ -58,27 +58,20 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
});
|
||||
});
|
||||
}
|
||||
if (this.flavor == null) {
|
||||
platform.invokeMethod('getFlavor').then((flavor) {
|
||||
setState(() {
|
||||
this.flavor = flavor;
|
||||
|
||||
if (this.details['sum_bonus'] is String) {
|
||||
String regexString = r'(\d+) начислено, (\d+).*';
|
||||
RegExp regExp = new RegExp(regexString);
|
||||
var matches = regExp.allMatches(this.details['sum_bonus']);
|
||||
if(matches.length != 0) {
|
||||
var match = matches.elementAt(0); // => extract the first (and only) match
|
||||
this.bonusPlus = int.parse(match.group(1));
|
||||
this.bonusMinus = int.parse(match.group(2));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.details['sum_bonus'] is String) {
|
||||
String regexString = r'(\d+) начислено, (\d+).*';
|
||||
RegExp regExp = new RegExp(regexString);
|
||||
var matches = regExp.allMatches(this.details['sum_bonus']);
|
||||
if(matches.length != 0) {
|
||||
var match = matches.elementAt(0); // => extract the first (and only) match
|
||||
this.bonusPlus = int.parse(match.group(1));
|
||||
this.bonusMinus = int.parse(match.group(2));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.details['sum_bonus'] is int) {
|
||||
this.bonusPlus = this.details['sum_bonus'];
|
||||
}
|
||||
});
|
||||
});
|
||||
if (this.details['sum_bonus'] is int) {
|
||||
this.bonusPlus = this.details['sum_bonus'];
|
||||
}
|
||||
|
||||
return getMainWidget();
|
||||
@@ -97,13 +90,13 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
widgetList.add(getValueWithDescription(StringsLocalization.bonusMinus(), bonusMinus.toString()));
|
||||
}
|
||||
|
||||
if (this.flavor != 'autobonus') {
|
||||
if (app != 'autobonus') {
|
||||
widgetList.add(getValueWithDescription(StringsLocalization.discountRate(), '${details['discount']}%'));
|
||||
widgetList.add(getValueWithDescription(StringsLocalization.discountSum(), '${details['sum_discount']}'));
|
||||
if (app != 'crypto') {
|
||||
widgetList.add(getValueWithDescription(StringsLocalization.discountSum(), '${details['sum_discount']}'));
|
||||
}
|
||||
}
|
||||
|
||||
// widgetList.add( new Expanded(child: new Center()));
|
||||
if (this.coupons.length > 0) {
|
||||
if (app != 'crypto' && this.coupons.length > 0) {
|
||||
widgetList.add(getItemTitle(StringsLocalization.couponsUsed()));
|
||||
this.coupons.forEach((couponItem) {
|
||||
widgetList.add(getItemToggle(
|
||||
@@ -140,8 +133,6 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
getSuccessMessage() {
|
||||
return new Row(
|
||||
children: <Widget>[
|
||||
|
||||
Reference in New Issue
Block a user