createProperty<T> method Null safety

EmpireProperty<T> createProperty<T>(
  1. T value,
  2. {String? propertyName}
)

Short hand helper function for initializing an EmpireProperty.

See EmpireProperty for propertyName usages.

Example

late final EmpireProperty<String> name;

name = createProperty('Bob');

Implementation

EmpireProperty<T> createProperty<T>(T value, {String? propertyName}) {
  return EmpireProperty<T>(value, this, propertyName: propertyName);
}