СС
var url = Uri.parse('http://localhost/phplesson1/');
final response = await http.get(url);
if (response.statusCode == 200) {
return CategoryList.fromJson(json.decode(response.body));
} else {
throw Exception("Error: ${response.reasonPhrase}");
}
}