Angular Dart: How can we iterate object into html?


I have one proto object in angular dart I am taking values from proto object into dart object but I am unable to iterate it into html. How can I achieve this thing into dart like we do in angular?

Var obj=[{name:”test”}];



I have tried to create object like:

List<Map<String,String>> details;

    details= [{‘name’:’test’}];



But I am getting error ‘the getter is not defined for the class’.


Try the following code below:

Dart file:

 List<Fields> fields = [
    Fields("Jess", 10),
    Fields("Sujuta", 11),

class Fields {
  final String name;
  final int age;

  const Fields(this.objectName, this.age);

HTML file:

<div *ngFor="let field of fields">{{}}</div> 

Answered By – Jessica Rodriguez

Answer Checked By – Marilyn (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *