Creating a class

suggest change

Classes can be created as follows:

class InputField {
  int? maxLength;
  String? name;
}

The class can be instantiated using the new keyword. Nullable fields are null until you set them.

var field = new InputField();

Field values can then be accessed:

// this will trigger the setter
field.name = "fieldname";

// this will trigger the getter
print(field.name);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents