Работает функционал переключения валют, остались правки по ui

This commit is contained in:
Ivan Murashov
2017-09-11 16:43:13 +03:00
parent e492a3a146
commit bc092ca8f9
6 changed files with 82 additions and 29 deletions

View File

@@ -203,29 +203,31 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
String url = user['purchases_url'];
var body = {
'doc_id': result,
'curr_iso_code': '643',
'commit': 'true',
'sum_total': sumTotal
};
helper.getCurrency().then((currency) {
var body = {
'doc_id': result,
'curr_iso_code': currency.toString(),
'commit': 'true',
'sum_total': sumTotal
};
var headers = {
'DM-Authorization': 'dmapptoken $appToken',
'Authorization': 'dmtoken ${token}'
};
var headers = {
'DM-Authorization': 'dmapptoken $appToken',
'Authorization': 'dmtoken ${token}'
};
httpClient.post(url, body: body, headers: headers).then((response) {
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']));
print(response.body);
helper.close().then((_) {
Navigator.of(context).pop();
pushRouteReplacement(context, new PurchaseSuccessScreen(sumTotal, user['first_name'] == null ? '' : user['first_name']));
});
}).catchError((error) {
purchaseInProgress = false;
print(error.toString());
});
}).catchError((error) {
purchaseInProgress = false;
print(error.toString());
});
});
}