stopBatteryBenchmark method

  1. @override
Future<BenchmarkResult?> stopBatteryBenchmark()
override

Implementation

@override
Future<BenchmarkResult?> stopBatteryBenchmark() async {
  _methodCalls.add('stopBatteryBenchmark');
  if (_activeBenchmark == null || !_activeBenchmark!.isRunning) {
    return null;
  }
  final result = _activeBenchmark!.finish(
    currentBattery: _powerState.batteryLevel,
  );
  _activeBenchmark = null;
  return result;
}