LCOV - code coverage report
Current view: top level - lib/src/utils - cached_stream_controller.dart (source / functions) Coverage Total Hit
Test: merged.info Lines: 83.3 % 12 10
Test Date: 2025-01-14 13:39:53 Functions: - 0 0

            Line data    Source code
       1              : import 'dart:async';
       2              : 
       3              : class CachedStreamController<T> {
       4              :   T? _value;
       5              :   Object? _lastError;
       6              :   final StreamController<T> _streamController = StreamController.broadcast();
       7              : 
       8           39 :   CachedStreamController([T? value]) : _value = value;
       9              : 
      10           66 :   T? get value => _value;
      11            0 :   Object? get lastError => _lastError;
      12           84 :   Stream<T> get stream => _streamController.stream;
      13              : 
      14           34 :   void add(T value) {
      15           34 :     _value = value;
      16           68 :     _streamController.add(value);
      17              :   }
      18              : 
      19            1 :   void addError(Object error, [StackTrace? stackTrace]) {
      20            2 :     _lastError = value;
      21            2 :     _streamController.addError(error, stackTrace);
      22              :   }
      23              : 
      24            3 :   Future close() => _streamController.close();
      25            0 :   bool get isClosed => _streamController.isClosed;
      26              : }
        

Generated by: LCOV version 2.0-1