Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:core
  3. Expando<T extendsObject> class
Expando
description

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

Expando([String?name])
Creates a newExpando. The optional name is only used fordebugging purposes and creating two differentExpandos with thesame name yields twoExpandos that work on different propertiesof the objects they are used on.

Properties

hashCodeint
The hash code for this object.
no setterinherited
nameString?
The name of the thisExpando as passed to the constructor.
final
runtimeTypeType
A representation of the runtime type of the object.
no setterinherited

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 tovalue.
  1. Dart
  2. dart:core
  3. Expando<T extendsObject> class
dart:core library

[8]ページ先頭

©2009-2025 Movatter.jp