startTemp method

  1. @override
Future<void> startTemp(
  1. String? rtKey
)
override

Implementation

@override
Future<void> startTemp(String? rtKey) async {
  // skpark 2024.06.14 현재 firebase bug 로 인해 임시로 막아둠.
  //return;
  if (!kIsWeb) {
    if (Platform.isWindows) {
      logger.severe('It is not web environment, FirebaseRealtime.startTemp() is not supported.');
      return;
    }
  } else {
    logger.warning('===========skpark temporary stop : firebase realtime has bug.===========');
    return;
  }

  realTimeKey = rtKey;
  if (realTimeKey == null || realTimeKey!.isEmpty) {
    return;
  }

  await initialize();

  logger.finest('FirebaseRealtime startTemp()');
  //if (_listenTimer != null) return;
  logger.finest('FirebaseRealtime startTemp...()');
  //_listenTimer = Timer.periodic(const Duration(milliseconds: 100), (timer) {
  if (_isListenComplete) {
    _isListenComplete = false;
    logger.finest('listener restart $realTimeKey, $lastUpdateTimeStr');
    _deltaStream?.cancel();
    _deltaStream = _db!
        .child('hycop_delta')
        // .orderByChild('updateTime')
        // .startAfter(lastUpdateTimeStr)
        .orderByChild('realTimeKey')
        //.startAfter('$realTimeKey-$lastUpdateTimeStr')
        .equalTo(realTimeKey)
        .onValue
        .listen((event) => _listenCallback(event, ''));
  }
  //});
}