readFile static method

Future<String?> readFile(
  1. String? filepath
)

Implementation

static Future<String?> readFile(String? filepath) async
{
  if (filepath == null) return null;
  try
  {
    // qualify file name
    if (_fileExists(filepath))
    {
      File file = File(filepath);
      return await file.readAsString();
    }
    return null;
  }
  catch(e)
  {
    Log().exception(e, caller: 'platform.vm.dart => bool readFile($filepath)');
    return null;
  }
}