Expando<T extends Object> classfinal
AnExpando allows adding new properties to objects.
Does not work on numbers, strings, booleans, records,null,dart:ffi pointers,dart:ffi structs, ordart:ffi unions.
AnExpando does not hold on to the added property value after an objectbecomes inaccessible.
Since you can always create a new number that is identical to an existingnumber, it means that an expando property on a number could never bereleased. To avoid this, expando properties cannot be added to numbers.The same argument applies to strings, booleans andnull, which also haveliterals that evaluate to identical values when they occur more than once.In addition, expando properties can not be added to records becauserecords do not have a well-defined persistent identity.
There is no restriction on other classes, even for compile time constantobjects. Be careful if adding expando properties to compile time constants,since they will stay alive forever.
Constructors
Properties
Methods
- noSuchMethod(
Invocationinvocation)→ dynamic - Invoked when a nonexistent method or property is accessed.inherited
- toString(
)→String - Expando toString method override.override
Operators
- operator ==(
Objectother)→bool - The equality operator.inherited
- operator [](
Objectobject)→ T? - Gets the value of thisExpando's property on the given object.
- operator []=(
Objectobject,T?value)→ void - Sets thisExpando's property value on the given object to
value.