ChartAlert class

Represents an active or triggered visual price alert on the chart canvas.

Constructors

ChartAlert({required String id, required String symbol, required double price, String note = 'Price Alert', AlertTriggerCondition condition = AlertTriggerCondition.crossing, required DateTime createdAt, bool isTriggered = false, bool isActive = true, DateTime? triggeredAt})
const
ChartAlert.fromJson(Map<String, dynamic> json)
factory

Properties

condition → AlertTriggerCondition
final
createdAt → DateTime
final
hashCode → int
The hash code for this object.
no setteroverride
id → String
final
isActive → bool
final
isTriggered → bool
final
note → String
final
price → double
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
symbol → String
final
triggeredAt → DateTime?
final

Methods

checkTrigger(double currentPrice, double previousPrice) → bool
Evaluates whether the current price update satisfies this alert's trigger condition.
copyWith({String? id, String? symbol, double? price, String? note, AlertTriggerCondition? condition, DateTime? createdAt, bool? isTriggered, bool? isActive, DateTime? triggeredAt}) → ChartAlert
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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