init static method

Future<void> init()

Initialize asset tree from AssetManifest.json

Implementation

static Future<void> init() async {
  if (_initialized) return;
  final manifestContent = await rootBundle.loadString('AssetManifest.json');
  final Map<String, dynamic> manifestMap = json.decode(manifestContent);

  _root = AssetFolder('assets');

  for (final path in manifestMap.keys) {
    _addPath(path.substring("assets/".length));
  }

  _initialized = true;
}