getStringF static method

Future<String> getStringF(
  1. String key, {
  2. bool cache = true,
})

Retrieve a String value by its Key value.

Implementation

static Future<String> getStringF(String key, {bool cache = true}) async {
  assert(Assets._assets != null, 'Assets.init() must be called first.');
  String asset;
  try {
    asset =
        await Assets._assets!.loadString('$setPath(key)$key', cache: cache);
  } catch (ex) {
    asset = '';
  }
  return asset;
}