NetworkQualityThresholds class

Configurable latency boundaries used to classify a latency sample into a NetworkQuality value.

Each field is the upper bound (inclusive) for that quality tier. Defaults are a reasonable starting point, not a guarantee — tune them for your API's actual latency profile.

Constructors

NetworkQualityThresholds({Duration excellent = const Duration(milliseconds: 100), Duration good = const Duration(milliseconds: 300), Duration fair = const Duration(milliseconds: 800)})
Creates a set of latency thresholds.
const

Properties

excellent → Duration
Upper bound for NetworkQuality.excellent. Default: 100ms.
final
fair → Duration
Upper bound for NetworkQuality.fair. Anything slower than this is classified as NetworkQuality.poor. Default: 800ms.
final
good → Duration
Upper bound for NetworkQuality.good. Default: 300ms.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

classify(Duration? latency) → NetworkQuality
Classifies a latency sample into a NetworkQuality tier using these thresholds. Returns NetworkQuality.unknown if latency is null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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