Экран переключения валюты открывается с первого раза, соединение с базой данных не открывается на тех экранах, на которых это не требуется
This commit is contained in:
@@ -219,10 +219,17 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
httpClient.post(url, body: body, headers: headers).then((response) {
|
||||
|
||||
print(response.body);
|
||||
helper.close().then((_) {
|
||||
Navigator.of(context).pop();
|
||||
pushRouteReplacement(context, new PurchaseSuccessScreen(sumTotal, user['first_name'] == null ? '' : user['first_name']));
|
||||
});
|
||||
Map parsedMap = JSON.decode(response.body);
|
||||
|
||||
if (parsedMap.containsKey('errors')) {
|
||||
List<String> errors = parsedMap['errors'];
|
||||
// TODO: ПОказывать сообщение с ошибкой!
|
||||
} else {
|
||||
helper.close().then((_) {
|
||||
Navigator.of(context).pop();
|
||||
pushRouteReplacement(context, new PurchaseSuccessScreen(sumTotal, user['first_name'] == null ? '' : user['first_name']));
|
||||
});
|
||||
}
|
||||
|
||||
}).catchError((error) {
|
||||
purchaseInProgress = false;
|
||||
|
||||
Reference in New Issue
Block a user