Almost all done, need fix logout.
This commit is contained in:
@@ -46,6 +46,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
loading = true;
|
||||
requestAsyncData(user);
|
||||
super.initState();
|
||||
}
|
||||
@@ -225,9 +226,6 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
}
|
||||
|
||||
requestAsyncData(Map user) async {
|
||||
setState(() {
|
||||
loading = true;
|
||||
});
|
||||
bool showBonus = await platform.invokeMethod('showBonus');
|
||||
if (await platform.invokeMethod('isOnline')) {
|
||||
var response, couponResponse;
|
||||
@@ -248,8 +246,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
coupons['results'].forEach((couponItem) {
|
||||
couponItem['isSet'] = false;
|
||||
});
|
||||
|
||||
setState(() {
|
||||
loading = false;
|
||||
this.coupons = coupons['results'];
|
||||
this.loyalityType = loyality['type'];
|
||||
setBonuses(loyality, showBonus);
|
||||
@@ -343,6 +341,9 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
}
|
||||
|
||||
purchase(String sumTotal) async {
|
||||
setState(() {
|
||||
loading = true;
|
||||
});
|
||||
if (await platform.invokeMethod('isOnline')) {
|
||||
if (!purchaseInProgress) {
|
||||
purchaseInProgress = true;
|
||||
@@ -363,7 +364,6 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
'curr_iso_code': currency.toString(),
|
||||
'commit': 'true',
|
||||
'sum_total': sumTotal,
|
||||
// 'coupons': []
|
||||
};
|
||||
|
||||
if (bonusController.text.length > 0) {
|
||||
|
||||
@@ -28,20 +28,13 @@ class SplashScreen extends BaseScreen {
|
||||
class _SplashScreenState extends BaseState<SplashScreen> {
|
||||
|
||||
_SplashScreenState(SqliteHelper helper, String app) : super(helper, app);
|
||||
bool a = false;
|
||||
bool a = true;
|
||||
|
||||
bool isAutomaticallyImplyLeading() => false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
print('init state!');
|
||||
|
||||
new Future.delayed(const Duration(milliseconds: 1000), () {
|
||||
showNextScreen();
|
||||
a = true;
|
||||
});
|
||||
|
||||
showNextScreen();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -173,6 +166,11 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
||||
SqliteHelper helper) {
|
||||
// Канал ловит вызовы методов из "нативной" части приложения.
|
||||
// Могут быть вызваны либо exit либо faq, либо purchase.
|
||||
|
||||
setState(() {
|
||||
a = false;
|
||||
});
|
||||
|
||||
platform.setMethodCallHandler((MethodCall call) async {
|
||||
print(this.toString());
|
||||
if (call.method == 'findUser') {
|
||||
|
||||
Reference in New Issue
Block a user