uploading receipt

This commit is contained in:
Felix 2019-08-12 11:37:59 +01:00
parent 4e67bfbbec
commit 405a037a15
3 changed files with 75 additions and 11 deletions

View file

@ -12,13 +12,12 @@ class Organisation {
var town = "";
Organisation(
this.id,
this.name,
this.postcode,
this.streetName,
this.town,
);
this.id,
this.name,
this.postcode,
this.streetName,
this.town,
);
}
class Organisations {

View file

@ -37,26 +37,25 @@ Future<LoginModel> submitReceiptAPI(
'recurring': receipt.recurring,
'street_name': receipt.street,
'postcode': receipt.postcode,
'town': receipt.town,
'session_key': preferences.get('LastToken'),
};
// debugPrint('$body');
// debugPrint(json.encode(body));
debugPrint(json.encode(body));
final response = await http.post(
url,
body: json.encode(body),
);
// debugPrint(response.body);
debugPrint(response.body);
if (response.statusCode == 200) {
final responseJson = json.decode(response.body);
// print(responseJson[0]);
print(responseJson[0]);
showDialogSingleButton(
context,