LCOV - code coverage report
Current view: top level - src/builders - bloc_type_class.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 19 19 100.0 %
Date: 2021-09-23 09:58:53 Functions: 0 0 -

          Line data    Source code
       1             : part of rx_bloc_generator;
       2             : 
       3             : /// Generates the type class for the blocClass
       4             : ///
       5             : ///  Example:
       6             : ///  abstract class {RxBlocName}BlocType extends RxBlocTypeBase {
       7             : ///    {RxBlocName}BlocEvents get events;
       8             : ///    {RxBlocName}BlocStates get states;
       9             : ///  }
      10             : ///
      11             : class _BlocTypeClass implements _BuilderContract {
      12           1 :   const _BlocTypeClass(
      13             :     this.className,
      14             :     this.eventClassName,
      15             :     this.stateClassName,
      16             :   );
      17             : 
      18             :   final String className;
      19             : 
      20             :   final String eventClassName;
      21             : 
      22             :   final String stateClassName;
      23             : 
      24           1 :   @override
      25           1 :   Class build() => Class(
      26           1 :         (b) => b
      27           3 :           ..docs.addAll(<String>[
      28             :             '/// Used as a contractor for the bloc, events and states classes',
      29             :             '/// {@nodoc}',
      30             :           ])
      31           1 :           ..abstract = true
      32           2 :           ..name = className
      33           3 :           ..extend = refer((RxBlocTypeBase).toString())
      34           3 :           ..methods.addAll(<Method>[
      35           1 :             Method(
      36           1 :               (b) => b
      37           1 :                 ..name = 'events'
      38           3 :                 ..returns = refer(eventClassName)
      39           1 :                 ..type = MethodType.getter,
      40             :             ),
      41           1 :             Method(
      42           1 :               (b) => b
      43           1 :                 ..name = 'states'
      44           3 :                 ..returns = refer(stateClassName)
      45           1 :                 ..type = MethodType.getter,
      46             :             ),
      47             :           ]),
      48             :       );
      49             : }

Generated by: LCOV version 1.15