initProperties method Null safety

void initProperties()

Initializes all EmpireProperty properties in the ViewModel.

This method is automatically called during object construction and should not be called manually.

All EmpireProperty properties must be defined with the late final keywords. For example:

late final EmpireProperty<int> age;

When overriding the initProperties functions you would initialize your EmpireProperty like so:

@override
void initProperties() {
   age = EmpireProperty<int>(0, this);
}

You can also initialize properties using the createProperty function:

@override
void initProperties() {
   age = createProperty(0);
}

Implementation

void initProperties();