LCOV - code coverage report
Current view: top level - src/model - error_with_tag.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 4 11 36.4 %
Date: 2021-09-21 09:30:20 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:rx_bloc/rx_bloc.dart';
       2             : 
       3             : /// Just a simple container of
       4             : /// [ErrorWithTag.exception] and [ErrorWithTag.tag]
       5             : class ErrorWithTag {
       6             :   /// Default constructor
       7           1 :   ErrorWithTag({
       8             :     required this.exception,
       9             :     this.tag = '',
      10             :   });
      11             : 
      12             :   /// Constructor that creates an instance from [ResultError]
      13           2 :   factory ErrorWithTag.fromResult(ResultError resultError) => ErrorWithTag(
      14           1 :         exception: resultError.error,
      15           1 :         tag: resultError.tag,
      16             :       );
      17             : 
      18             :   /// Is loading flag that is used in async operations
      19             :   final Exception exception;
      20             : 
      21             :   /// A tag that holds the intention of a async result
      22             :   final String tag;
      23             : 
      24           0 :   @override
      25           0 :   String toString() => '{loading: exception, tag: $tag}';
      26             : 
      27           0 :   @override
      28             :   bool operator ==(dynamic other) {
      29           0 :     if (other is! ErrorWithTag) {
      30             :       return false;
      31             :     }
      32             : 
      33           0 :     return other.exception == exception && other.tag == tag;
      34             :   }
      35             : 
      36           0 :   @override
      37           0 :   int get hashCode => tag.hashCode ^ exception.hashCode;
      38             : }

Generated by: LCOV version 1.15