Android analytics done, camera instructions added.

This commit is contained in:
Ivan Murashov
2018-04-22 18:43:29 +03:00
parent be4f2dc7cf
commit bc02327b3e
42 changed files with 1015 additions and 1386 deletions

View File

@@ -50,4 +50,4 @@ class _CurrenciesState extends SettingsBaseState<CurrenciesScreen> {
saveOption() async {
await helper.saveCurrency(currencies[selectedItem]);
}
}
}

View File

@@ -79,9 +79,10 @@ class RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
setState(() {
_tokenActive = JSON.decode(response.body)['active'];
});
}).catchError((error) {
print(error.toString());
return false;
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()}).then((_) {
return false;
});
});
});
}

View File

@@ -123,8 +123,8 @@ class RegistrationScreenState extends BaseState<RegistrationScreen> {
error = parsedMap['errors'][0];
});
}
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
}

View File

@@ -191,9 +191,10 @@ class SettingsState extends BaseState<SettingsScreen> {
helper.clear().then((result) {
Navigator.of(context).pop('');
});
}).catchError((error) {
print(error.toString());
Navigator.of(context).pop('');
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()}).then((_) {
Navigator.of(context).pop('');
});
});
});
}

View File

@@ -83,9 +83,10 @@ class _SplashScreenState extends BaseState<SplashScreen> {
} else if (token != null) {
_initAndStartScanner(context, app, token, helper);
} else {
print('Произошла непредусмотренная ошибка в логике приложения');
helper.getToken().then((token) {
_initAndStartScanner(context, app, token, helper);
platform.invokeMethod('logError', {"message":"Token is null"}).then((_) {
helper.getToken().then((token) {
_initAndStartScanner(context, app, token, helper);
});
});
}
});
@@ -103,8 +104,8 @@ class _SplashScreenState extends BaseState<SplashScreen> {
if (await platform.invokeMethod('isOnline')) {
getCheckTokenStatusRequest(token).then((statusResponse) {
handleStatusResponse(statusResponse, helper);
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
}
@@ -153,8 +154,8 @@ class _SplashScreenState extends BaseState<SplashScreen> {
} else if (response.statusCode == 201) {
clearToken(response, helper);
}
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
@@ -164,9 +165,11 @@ class _SplashScreenState extends BaseState<SplashScreen> {
Map parsedMap = JSON.decode(response.body);
getDeleteTokenRequest(parsedMap['token']).then((_) {
showNextScreen(new RegistrationScreen(helper, app));
}).catchError((error) {
print(error.toString());
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
@@ -257,7 +260,11 @@ class _SplashScreenState extends BaseState<SplashScreen> {
.value
.toString();
platform.invokeMethod('startScanner', args);
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}, onError: (e) {
platform.invokeMethod('logError', {"message":e.toString()});
});
}
}