computed<T> function

FlutterComputed<T> computed<T>(
  1. T compute(), {
  2. String? debugLabel,
  3. bool autoDispose = false,
})

Create a new signal that is computed based on the values of other signals.

The returned computed signal is read-only, and its value is automatically updated when any signals accessed from within the callback function change.

Implementation

FlutterComputed<T> computed<T>(
  T Function() compute, {
  String? debugLabel,
  bool autoDispose = false,
}) {
  return FlutterComputed<T>(
    compute,
    debugLabel: debugLabel,
    autoDispose: autoDispose,
  );
}