T0TTimer constructor

T0TTimer({
  1. required String serial,
  2. Duration? duration,
  3. Duration? syncInterval,
  4. Map<String, dynamic>? meta,
  5. bool listen = true,
})

Implementation

T0TTimer({
  required this.serial,
  this.duration,
  Duration? syncInterval,
  Map<String, dynamic>? meta,
  bool listen = true,
}) : syncInterval = syncInterval ?? const Duration(seconds: 5),
     meta = meta ?? <String, dynamic>{},
     _startedAt = DateTime.now() {
  if (listen) {
    _disposeListener = Tang0Channel.addGListener(channelId, _handleMessage);
  } else {
    _disposeListener = () {};
  }

  _startPeriodicSync();
}