call method

num call(
  1. [num v]
)
inherited

Makes this Rx looks like a function so you can update a new value using rx(someOtherValue). Practical to assign the Rx directly to some Widget that has a signature ::onChange( value )

Example:

final myText = 'GetX rocks!'.obs;

// in your Constructor, just to check it works :P
ever( myText, print ) ;

// in your build(BuildContext) {
TextField(
  onChanged: myText,
),

Implementation

T call([T v]) {
  if (v != null) {
    value = v;
  }
  return value;
}