An Expando allows adding new properties to objects.
Does not work on numbers, strings, booleans, null, dart:ffi pointers, dart:ffi structs, or dart:ffi unions.
An Expando does not hold on to the added property value after an object becomes inaccessible.
Since you can always create a new number that is identical to an existing number, it means that an expando property on a number could never be released. To avoid this, expando properties cannot be added to numbers. The same argument applies to strings, booleans and null, which also have literals that evaluate to identical values when they occur more than once.
There is no restriction on other classes, even for compile time constant objects. Be careful if adding expando properties to compile time constants, since they will stay alive forever.
value.
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-core/Expando-class.html