CoffeeConfig class

Configuration for the CoffeeGuard.

Constructors

CoffeeConfig({bool enabled = true, CoffeeMode mode = CoffeeMode.blockApp, int minHour = 9, int? maxHour, CoffeeRoastLevel roastLevel = CoffeeRoastLevel.sarcastic, bool showOverlay = true, bool throwOnBlock = false, int? breakReminderMinutes, bool allowOverride = true, int overrideTTLMinutes = 60, Map<CoffeeSituation, List<String>>? customMessages})
const

Properties

allowOverride bool
Whether to allow the "I had coffee" override.
final
breakReminderMinutes int?
Interval in minutes for break reminders. Null = disabled.
final
customMessages Map<CoffeeSituation, List<String>>?
Map of custom messages for specific situations. Keys should be CoffeeSituation. If provided, these messages override the built-in roast levels.
final
enabled bool
Whether the coffee guard is enabled.
final
hashCode int
The hash code for this object.
no setterinherited
maxHour int?
The maximum hour (0-23) allowed to code.
final
minHour int
The minimum hour (0-23) allowed to code.
final
mode CoffeeMode
The mode of operation (block, warn, or overlay only).
final
overrideTTLMinutes int
Duration in minutes for the override.
final
roastLevel CoffeeRoastLevel
How strict the messages should be.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showOverlay bool
Whether to show the overlay in addition to logs.
final
throwOnBlock bool
Whether to throw an exception when blocked (if false, it will just block execution flow if possible, or warn). Actually, for ensure, blocking usually means we return false or throw. To purely "block app", we usually throw.
final

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