[flutter_svg] building example app produces some warnings
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
1. clone flutter/packages
2. open `packages/third_party/packages/flutter_svg/example`
3. `flutter build web --wasm` (although the wasm option is probably not needed)
4. Observe the logs, which indicate that the example app still uses the old format and uses an incomplete setup for cupertino_icons
### Expected results
No warnings in the terminal
### Actual results
There are 2 warnings when building the example app:
1) The index.html uses an outdated template
2) The cupertino icons font is referenced, but not found (the example pubspec probably needs updating, or we remove uses of cupertino_icons entirely from the example)
```
Warning: In index.html:27: Manual service worker registration deprecated. Use flutter.js service worker bootstrapping instead. See
https://docs.flutter.dev/platform-integration/web/initialization for more details.
Expected to find fonts for (MaterialIcons, packages/cupertino_icons/CupertinoIcons), but found (MaterialIcons). This usually means you are
referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package
that would include them, or are missing "uses-material-design: true".
```
### Code sample
Code sample
```dart
[Paste your code here]
```
### Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
### Logs
Logs
```console
navaronbracke@MacBook-Pro-van-Navaron example % flutter build web --wasm
┌─ New feature ────────────────────────────────────────────────────────────────────────────┐
│ WebAssembly compilation is new. Understand the details before deploying to production. │
│ See https://flutter.dev/to/wasm for more information. │
└──────────────────────────────────────────────────────────────────────────────────────────┘
Warning: In index.html:27: Manual service worker registration deprecated. Use flutter.js service worker bootstrapping instead. See
https://docs.flutter.dev/platform-integration/web/initialization for more details.
Expected to find fonts for (MaterialIcons, packages/cupertino_icons/CupertinoIcons), but found (MaterialIcons). This usually means you are
referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package
that would include them, or are missing "uses-material-design: true".
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 7692 bytes (99.5% reduction). Tree-shaking can be
disabled by providing the --no-tree-shake-icons flag when building your app.
Compiling lib/main.dart for the Web... 3.5s
✓ Built build/web
```
### Flutter Doctor output
Doctor output
```console
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-x64, locale
en-BE)
• Flutter version 3.24.3 on channel stable at
/Users/navaronbracke/Documents/flutter
• Upstream repository git@github.com:navaronbracke/flutter.git
• FLUTTER_GIT_URL = git@github.com:navaronbracke/flutter.git
• Framework revision 2663184aa7 (9 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/navaronbracke/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.95.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.100.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 14.6.1 23G93 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.69
[✓] Network resources
• All expected network resources are available.
• No issues found!
```
Contributor guide
Assessment
This issue has not been assessed yet.