T0TabDeduper class
Cross-tab presence + dedup preset.
Each tab generates a per-tab UUID and periodically broadcasts:
- uuid
- creationDate
- lastSeen timestamp
- optional meta
If more than maxTabs tabs are present, tabs not in the oldest keepTabs set will request closure.
Note: Browser security restrictions may prevent window.close() unless the
tab was opened by script. Provide onCloseRequested to implement a custom
strategy.
- Inheritance
-
- Object
- ChangeNotifier
- T0TabDeduper
Constructors
-
T0TabDeduper({Duration? heartbeat, Duration? ttl, int maxTabs = 4, int keepTabs = 2, Map<
String, dynamic> ? meta, FutureOr<void> onCloseRequested(T0TabDedupSnapshot snapshot)?})
Properties
- closeRequested → bool
-
no setter
- createdAt → DateTime
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- heartbeat → Duration
-
final
- id → String
-
no setter
- keepTabs → int
-
final
- maxTabs → int
-
final
-
meta
→ Map<
String, dynamic> -
no setter
-
onCloseRequested
→ FutureOr<
void> Function(T0TabDedupSnapshot snapshot)? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- snapshot → T0TabDedupSnapshot
-
no setter
- tabCount → int
-
no setter
-
tabs
→ List<
T0TabPresence> -
no setter
- ttl → Duration
-
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateMeta(
Map< String, dynamic> newMeta) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited