flutter / flutter/flutter

Some Svgs do not load in Safari

Open
#163,815 5 comments 0 reactions 0 assignees View on GitHub
browser: safari-macos found in release: 3.29 found in release: 3.30 has reproducible steps p: flutter_svg platform-web team-engine
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

1. Add flutter_svg: ^2.0.17 package and image at assets folder.
2. Use that image in
```dart
SvgPicture.asset("assets/image.svg", fit: BoxFit.fill);
```
3. Image will not load up in safari

### Expected results

Svg should load in all browser

### Actual results

Svg not loading in safari

### Code sample

Code sample

```dart
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: MyHomePage(),
);
}
}

class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});

@override
Widget build(BuildContext context) {
return SvgPicture.asset("assets/image.svg", fit: BoxFit.fill);
}
}
```

### Screenshots or Video

Screenshots / Video demonstration

- Safari screenshot
Image

- Chrome screenshot
Image

### Logs

Logs

```console
Launching lib/main.dart on Chrome in debug mode...
This app is linked to the debug service: ws://127.0.0.1:61215/5Tyf2kg4x70=/ws
Debug service listening on ws://127.0.0.1:61215/5Tyf2kg4x70=/ws
Connecting to VM Service at ws://127.0.0.1:61215/5Tyf2kg4x70=/ws
Connected to the VM Service.
```

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.0 24A335 darwin-arm64, locale
en-IN) [260ms]
• Flutter version 3.29.0 on channel stable at
/Users/govindmaheshwari/Developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388afb5 (10 days ago), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4522
• Dart version 3.7.0
• DevTools version 2.42.2

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[288ms]
• Android SDK at /Users/govindmaheshwari/Library/Android/sdk
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.

[!] Xcode - develop for iOS and macOS (Xcode 16.0) [1,086ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16A242d
! iOS 18.0 Simulator not installed; this may be necessary for iOS and macOS
development.
To download and install the platform, open Xcode, select Xcode > Settings
> Components,
and click the GET button for the required platform.

For more information, please visit:
https://developer.apple.com/documentation/xcode/installing-additional-si
mulator-runtimes
! CocoaPods 1.13.0 out of date (1.16.2 is recommended).
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
To update CocoaPods, see
https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods

[✓] Chrome - develop for the web [10ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2) [9ms]
• 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.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.97.0) [8ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.104.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.