Im trying to get json data from the server
here is the code:
void main() async{
List data = await getData();
print(data);
runApp(MyApp());
}
Future<List> getData() async {
String myUrl = "https://dashboard.ssitanas.com/public/api/categories";
http.Response response = await http.get(myUrl, headers: {
'Accept': 'application/json',
});
return json.decode(response.body);
}