LCOV - code coverage report
Current view: top level - response - json_utils.dart (source / functions) Hit Total Coverage
Test: coverage.lcov Lines: 0 7 0.0 %
Date: 2022-01-19 17:54:05 Functions: 0 0 -

          Line data    Source code
       1             : import 'dart:convert';
       2             : 
       3             : import 'package:at_utils/at_logger.dart';
       4             : 
       5             : class JsonUtils {
       6           0 :   static var logger = AtSignLogger('JsonDecode');
       7             : 
       8             :   /// Returns null when [jsonString] is null or empty.
       9             :   /// For a valid json string decodes and returns the decoded json, else null
      10           0 :   static dynamic decodeJson(String? jsonString) {
      11           0 :     if (jsonString == null || jsonString.isEmpty) {
      12           0 :       logger.severe('Failed to decode jsonString. Received empty string');
      13             :       return;
      14             :     }
      15             :     dynamic map;
      16             :     try {
      17           0 :       map = jsonDecode(jsonString);
      18           0 :     } on FormatException catch (e) {
      19           0 :       logger.severe('Failed to decode jsonString : $jsonString Error : $e');
      20             :     }
      21             :     return map;
      22             :   }
      23             : }

Generated by: LCOV version 1.13