decode method

Future<Map?> decode(
  1. String fileName,
  2. IFileContent fileContent
)

The method that do the loading

Implementation

Future<Map?> decode(
    final String fileName, final IFileContent fileContent) async {
  Map? returnValue;
  try {
    final String content = await loadFileContent(fileName, fileContent);
    MessagePrinter.info(
        "${fileExtension.toUpperCase()} file loaded for $fileName");
    returnValue = decodeContent(content);
  } catch (e) {
    MessagePrinter.debug(
        "Unable to load ${fileExtension.toUpperCase()} file for $fileName");
  }
  return returnValue;
}