loadAsset static method

Future<String> loadAsset(
  1. String assetPath
)

Load an asset from the project using an assetPath.

Implementation

static Future<String> loadAsset(String assetPath) async {
  File file = File(assetPath);
  if ((await file.exists()) == false) {
    return "";
  }
  return await file.readAsString();
}