Make Assets more robust across platforms (#14246)
diff --git a/packages/flutter_tools/lib/src/flutter_manifest.dart b/packages/flutter_tools/lib/src/flutter_manifest.dart index e26d9f1..30e5d6b 100644 --- a/packages/flutter_tools/lib/src/flutter_manifest.dart +++ b/packages/flutter_tools/lib/src/flutter_manifest.dart
@@ -52,8 +52,8 @@ return _flutterDescriptor['fonts'] ?? const <Map<String, dynamic>>[]; } - List<String> get assets { - return _flutterDescriptor['assets'] ?? const <String>[]; + List<Uri> get assets { + return _flutterDescriptor['assets']?.map(Uri.parse)?.toList() ?? const <Uri>[]; } List<Font> _fonts; @@ -89,7 +89,7 @@ } fontAssets.add(new FontAsset( - asset, + Uri.parse(asset), weight: fontFile['weight'], style: fontFile['style'], )); @@ -122,10 +122,10 @@ } class FontAsset { - FontAsset(this.asset, {this.weight, this.style}) - : assert(asset != null); + FontAsset(this.assetUri, {this.weight, this.style}) + : assert(assetUri != null); - final String asset; + final Uri assetUri; final int weight; final String style; @@ -137,12 +137,12 @@ if (style != null) descriptor['style'] = style; - descriptor['asset'] = asset; + descriptor['asset'] = assetUri.path; return descriptor; } @override - String toString() => '$runtimeType(asset: $asset, weight; $weight, style: $style)'; + String toString() => '$runtimeType(asset: ${assetUri.path}, weight; $weight, style: $style)'; } Future<dynamic> _loadFlutterManifest(String manifestPath) async { @@ -167,4 +167,4 @@ printError(validator.errors.join('\n')); return false; } -} \ No newline at end of file +}