From 62669665f1f51f9530e7ad1fbd1d9d69103f7100 Mon Sep 17 00:00:00 2001 From: Ivan Murashov Date: Wed, 27 Sep 2017 12:40:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=BE=D0=BD=D1=83=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=BD=D0=B0=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BA=D1=83=D0=BF=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/src/main/AndroidManifest.xml | 2 +- lib/screens/purchase.dart | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a50d756..c83f785 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="1.1.3"> extends BaseState { @override Widget build(BuildContext ctx) { - if (helper == null) { - helper = new SqliteHelper(); - helper.open().then((_) { - if (app == null) { - platform.invokeMethod('getFlavor').then((flavor) { - app = flavor; - setState(() { - requestLoyalty(user['loyalty_url']); - }); - }); - } - }); - } + setState(() { + requestLoyalty(user['loyalty_url']); + }); return getMainWidget(); } @@ -132,8 +122,10 @@ class PurchaseScreenState extends BaseState { } requestLoyalty(String url) async { + print(url); if (await platform.invokeMethod('isOnline')) { getLoyaltyRequest(url, helper).then((response) { + print(response); setState(() { setBonuses(JSON.decode(response.body)); }); @@ -254,6 +246,7 @@ class PurchaseScreenState extends BaseState { } void setBonuses(Map bonuses) { + print('kifio ' + bonuses['type']); if (bonuses['type'] == 'amount') { this.loyalty = '${user['discount']}%'; } else { @@ -261,5 +254,6 @@ class PurchaseScreenState extends BaseState { bonuses['amount_to_bonus'][0]) * 100; this.loyalty = '${loyaltyVal.toStringAsFixed(0)}%'; } + print('kifio ' + this.loyalty); } }