Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1459)

Unified Diff: sky/sdk/lib/widgets/icon.dart

Issue 1208273003: Stocks.apk should have icons when run offline (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/mojo/asset_bundle.dart ('k') | sky/shell/ui/engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/icon.dart
diff --git a/sky/sdk/lib/widgets/icon.dart b/sky/sdk/lib/widgets/icon.dart
index 3709ca4bc507324068ea1d2a93c92910351584a9..51117235b4fb02791d814cdfd5275147f2ac131e 100644
--- a/sky/sdk/lib/widgets/icon.dart
+++ b/sky/sdk/lib/widgets/icon.dart
@@ -5,8 +5,14 @@
import '../mojo/asset_bundle.dart';
import 'basic.dart';
-const String _kAssetBase = '/packages/sky/assets/material-design-icons/';
-final AssetBundle _iconBundle = new NetworkAssetBundle(Uri.base.resolve(_kAssetBase));
+AssetBundle _initIconBundle() {
+ if (rootBundle != null)
+ return rootBundle;
+ const String _kAssetBase = '/packages/sky/assets/material-design-icons/';
+ return new NetworkAssetBundle(Uri.base.resolve(_kAssetBase));
+}
+
+final AssetBundle _iconBundle = _initIconBundle();
class Icon extends Component {
Icon({ String key, this.size, this.type: '' }) : super(key: key);
« no previous file with comments | « sky/sdk/lib/mojo/asset_bundle.dart ('k') | sky/shell/ui/engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698