CpuTracker class

Tracks CPU usage through a platform channel.

Requires native implementation on each platform:

  • Android: Read from /proc/stat or use ActivityManager
  • iOS: Use host_processor_info via Mach APIs

Register a handler on the flutter_app_vitals/cpu MethodChannel that responds to getCpuUsage with a double (percentage 0–100). Falls back to 0% when no native handler is registered.

Constructors

CpuTracker()

Properties

cpuUsagePercent double
Last recorded CPU usage percentage (0–100).
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update() Future<void>
Queries the native platform for current CPU usage.

Operators

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