LCOV - code coverage report
Current view: | top level - src/providers - provider.dart (source / functions) |  |  | Hit | Total | Coverage
Test: | lcov.info |  | Lines: | 8 | 8 | 100.0 %
Date: | 2021-10-11 06:57:03 |  | Functions: | 0 | 0 | -

              Line data    Source code
           1             : import 'package:flutter/material.dart';
           2             :
           3             : abstract class Provider<State> extends InheritedWidget {
           4           5 :   const Provider({
           5             :     required this.state,
           6             :     required this.onStateChanged,
           7             :     required Widget child,
           8             :     Key? key,
           9           5 :   }) : super(
          10             :           child: child,
          11             :           key: key,
          12             :         );
          13             :
          14             :   final State state;
          15             :   final ValueChanged<State> onStateChanged;
          16             :
          17           4 :   void emit(State state) {
          18           8 :     if (this.state != state) {
          19           4 :       onStateChanged(state);
          20             :     }
          21             :   }
          22             :
          23           5 :   @override
          24             :   bool updateShouldNotify(covariant Provider<State> oldWidget) {
          25          15 :     return oldWidget.state != state ||
          26           3 :         oldWidget.onStateChanged != onStateChanged;
          27             :   }
          28             : }

Generated by: LCOV version 1.15