Home  • Programming • Dart

How to convert array of json objects into Dart List object?

[
  {"id":1,"name":"John"},
  {"id":2,"name":"Alice"}
]
final List data = jsonDecode(response.body);

List<Employee> employees =
    data.map((e) => Employee.fromJson(e)).toList();

Comments 0


Copyright © 2026. Powered by Intellect Software Ltd