LCOV - code coverage report
Current view: top level - core/util - extension.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 6 6 100.0 %
Date: 2021-04-14 08:03:52 Functions: 0 0 -

          Line data    Source code
       1             : /// Convenient class Extension on [Map]
       2             : extension MapX<K, V> on Map<K, V> {
       3             :   /// return a [Map] with no null entries (in their key or values)
       4           1 :   Map<K, V> get nullProtected =>
       5           3 :       Map.from(this)..removeWhere((key, value) => key == null || value == null);
       6             : }
       7             : 
       8             : /// Throws an [ArgumentError] if the given [expression] is `false`.
       9           6 : void checkArgument(bool expression, [String? message]) {
      10             :   if (!expression) {
      11           1 :     throw ArgumentError(message);
      12             :   }
      13             : }
      14             : 
      15             : /// Throws an [ArgumentError] if the given [reference] is `null`. Otherwise,
      16             : /// returns the [reference] parameter.
      17           5 : T checkNotNull<T>(T reference, [String? message]) {
      18             :   if (reference == null) {
      19           1 :     throw ArgumentError(message);
      20             :   }
      21             :   return reference;
      22             : }

Generated by: LCOV version 1.15