DiagnosticsOptions class
Options that control native collection flags and Dart health scoring.
Constructors
- DiagnosticsOptions({bool includeSecurityChecks = true, bool includeRootJailbreakCheck = false, bool includeNetworkReachability = false, int storageWarningThresholdMb = 500, int storageCriticalThresholdMb = 100, int batteryWarningThresholdPercent = 20, int batteryCriticalThresholdPercent = 10, int memoryWarningThresholdPercent = 75, int memoryCriticalThresholdPercent = 90, Duration collectionTimeout = const Duration(seconds: 5), Duration healthCacheTtl = const Duration(seconds: 5)})
-
Creates collection and scoring options. Prefer defaults for typical use.
const
Properties
- batteryCriticalThresholdPercent → int
-
Battery percent below this while discharging is scored critical.
final
- batteryWarningThresholdPercent → int
-
Battery percent below this (or power-save) is scored warning.
final
- collectionTimeout → Duration
-
Maximum time MobileDiagnostics.getFullReport may wait for native work.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- healthCacheTtl → Duration
-
How long a scored DiagnosticsReport is reused before recollecting.
final
- includeNetworkReachability → bool
-
HTTP/DNS probe to verify real internet. Adds latency. Off by default.
final
- includeRootJailbreakCheck → bool
-
Root (Android) / jailbreak (iOS) — advisory only. Off by default.
final
- includeSecurityChecks → bool
-
Screen lock, emulator, and developer-mode checks.
final
- memoryCriticalThresholdPercent → int
-
RAM usage percent at or above this (or OS low-memory) is scored critical.
final
- memoryWarningThresholdPercent → int
-
RAM usage percent at or above this is scored warning.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storageCriticalThresholdMb → int
-
Free space at or below this MB is scored HealthStatus.critical.
final
- storageWarningThresholdMb → int
-
Free space at or below this MB is scored HealthStatus.warning.
final
Methods
-
copyWith(
{bool? includeSecurityChecks, bool? includeRootJailbreakCheck, bool? includeNetworkReachability, int? storageWarningThresholdMb, int? storageCriticalThresholdMb, int? batteryWarningThresholdPercent, int? batteryCriticalThresholdPercent, int? memoryWarningThresholdPercent, int? memoryCriticalThresholdPercent, Duration? collectionTimeout, Duration? healthCacheTtl}) → DiagnosticsOptions - Returns a copy with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toChannelArgs(
) → Map< String, dynamic> - Flags forwarded to native collectors (security and reachability).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaults → const DiagnosticsOptions
- Default thresholds and flags used when callers omit options.