Fix Gallery example code display initialization (#6176)

This commit is contained in:
Hans Muller
2016-10-03 12:00:01 -07:00
committed by GitHub
parent 35de41d648
commit 66127250c9
4 changed files with 59 additions and 6 deletions

View File

@@ -18,7 +18,8 @@ Future<String> getExampleCode(String tag, AssetBundle bundle) async {
}
Future<Null> _parseExampleCode(AssetBundle bundle) async {
final String code = await bundle.loadString('lib/gallery/example_code.dart');
final String code = await bundle.loadString('lib/gallery/example_code.dart') ??
'// lib/gallery/example_code.dart not found\n';
_exampleCode = <String, String>{};
final List<String> lines = code.split('\n');