Add embedded font assets to the asset list

Any font asset referenced in the fonts section of flutter.yaml will now be
included in the FLX assets.  It's no longer necessary to separately list the
font in the assets section.
This commit is contained in:
Jason Simmons
2016-03-24 11:20:11 -07:00
parent e1b112ff88
commit f17b68d2d3

View File

@@ -81,6 +81,23 @@ Map<_Asset, List<_Asset>> _parseAssets(Map<String, dynamic> manifestDescriptor,
}
}
}
// Add assets referenced in the fonts section of the manifest.
if (manifestDescriptor.containsKey('fonts')) {
for (Map<String, dynamic> family in manifestDescriptor['fonts']) {
List<Map<String, dynamic>> fonts = family['fonts'];
if (fonts == null) continue;
for (Map<String, dynamic> font in fonts) {
String asset = font['asset'];
if (asset == null) continue;
_Asset baseAsset = new _Asset(base: assetBase, key: asset);
result[baseAsset] = <_Asset>[];
}
}
}
return result;
}