track<T> method

  1. @override
T track<T>(
  1. T action()
)
override

Implementation

@override
T track<T>(T Function() action) {
  if (isStarted) {
    throw StateError('Can not be tracked twice');
  }
  _start();
  try {
    return action();
  } finally {
    _stop();
  }
}