Obj<T> class

A base-class that store a value of T.

You can create a new Obj:

// usign `.obj` extension
final strObj = "initial value".obj;
final intObj = 0.obj;
final userObj = User().obj;
// or usign the constructor class
final strObj = Obj<String>("initial value");
final intObj = Obj<int>(0);
final userObj = Obj<User>(User());

You can get the value:

// usign a `value` getter
print(strObj.value);
// or using the callable
print(strObj());
// or using `toString` implicit
print("$intObj");

You can set a new value:

// usign a `value` setter
strObj.value = "change value";
// or using the callable
strObj("change value");
Implementers
Available Extensions

Constructors

Obj(T value)

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
getter/setter pair

Methods

call([T? val]) → T
Gets and/or sets to value like a function
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override