I/flutter ( 6994): type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>' in type castI/flutter ( 6994): type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>' in type cast code example

Example: type '_InternalLinkedHashMap' is not a subtype of type 'Map'

Future<List<Map<String, dynamic>>> fetch() async {
  http.Response response = await http.get('http://10.0.2.2:8000/api/membres');
  if (response.statusCode != 200) return null;
  return List<Map<String, dynamic>>.from(json.decode(response.body)['membre']);
}

Tags:

Dart Example