i’m creating an flutter app that eat relaxation API with Arabic character, the Arabic character not exhibiting nicely.
The code of http.get request:
Future<Null> fetchCustomers() {
_isLoading = true;
notifyListeners();
return http.get('http://10.0.3.2:8000/transfers/', headers: {
HttpHeaders.contentTypeHeader: 'utility/json',
HttpHeaders.acceptCharsetHeader:'utf-8',
}).then<Null>((http.Response response) {
ultimate Checklist<Buyer> fetchedCustomerList = [];
var customerListData = json.decode(response.physique);
print(customerListData);
print('right here');
ultimate customerData =
(customerListData as Checklist).map((i) => new Buyer.fromJson(i));
print(customerData);
print('earlier than');
if (customerListData == null) {
_isLoading = false;
notifyListeners();
return;
}
customerListData.forEach((customerData) {
ultimate Buyer buyer = Buyer(
id: customerData['id'],
identify: customerData['name']
cell: customerData['mobile'],
handle: customerData['address'],
);
fetchedCustomerList.add(buyer);
});
_customers = fetchedCustomerList;
print(_customers);
print("after");
_isLoading = false;
notifyListeners();
_selCustomerId = null;
}).catchError((error) {
_isLoading = false;
notifyListeners();
return;
});
}