TrackerLevel class abstract
An abstract class that defines values for different Tracker levels.
TrackerLevel provides a standardized way to represent different status or priority levels in tracker components. Each level defines both a visual color and descriptive name for consistent representation across the UI.
Predefined Levels
The class includes several predefined levels for common use cases:
- fine: Green color, typically for healthy/good states
- warning: Orange color, for cautionary states requiring attention
- critical: Red color, for urgent states requiring immediate action
- unknown: Gray color, for undefined or unavailable states
Custom Levels
Custom tracker levels can be implemented by extending this abstract class and providing color and name implementations.
Example:
// Using predefined levels
TrackerData(
level: TrackerLevel.critical,
tooltip: Text('System Alert'),
);
// Creating custom level
class CustomLevel implements TrackerLevel {
@override
Color get color => Colors.purple;
@override
String get name => 'Custom';
}
Constructors
Properties
- color → Color
-
Gets the color for the specified TrackerLevel.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Gets the name for the specified TrackerLevel.
no setter
- 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- critical → const TrackerLevel
- Default values for the critical level.
- fine → const TrackerLevel
- Default values for the fine level.
- unknown → const TrackerLevel
- Default values for the unknown level.
- warning → const TrackerLevel
- Default values for the warning level.