If your Flutter Web app still shows the default Flutter mark in a browser tab, the fix usually belongs in web/index.html, not in a Dart widget. A Flutter web favicon is a static image that the browser requests separately from your application UI.
You will link that image from Flutter’s web shell, keep web-app manifest images separate, then rebuild the static output. No Dart changes are required.
Prerequisites
- Confirm that Web is enabled and your Flutter SDK can target Chrome. Run
flutter doctor before changing assets.
- Prepare a square source image with a simple silhouette. Tiny detail tends to disappear at tab size; review the favicon size guide before exporting.
- Know the deployment base path: root, or a subdirectory such as
/portal/. It affects how relative icon URLs resolve.
Add a Flutter web favicon in six steps
-
Inspect Flutter’s web entry file
Open web/index.html and search for rel='icon'. Flutter’s template may already contain a default icon link, so replace that reference instead of leaving two competing stacks.
Open web/manifest.json too. Its icons array supplies installed web-app images, but it does not replace the browser-tab link you will add next.
-
Prepare the static icon files
Create a square icon set with Mzu favicondl. Export an SVG, 16- and 32-pixel PNGs, a multi-size ICO, a 180-pixel Apple touch image, and 192- and 512-pixel PNGs for the manifest.
Place the files under web/icons/ so Flutter copies them with the rest of the static web assets:
web/
├── index.html
├── manifest.json
└── icons/
├── favicon.svg
├── favicon-16.png
├── favicon-32.png
├── favicon.ico
├── apple-touch-icon.png
├── icon-192.png
└── icon-512.png
-
Add the icon links to the HTML head
The HTML standard associates an icon resource with rel='icon'. Add one deliberate stack inside the <head> element of web/index.html:
<link rel='icon' type='image/svg+xml' href='icons/favicon.svg'>
<link rel='icon' type='image/png' sizes='32x32' href='icons/favicon-32.png'>
<link rel='icon' type='image/png' sizes='16x16' href='icons/favicon-16.png'>
<link rel='icon' href='icons/favicon.ico'>
<link rel='apple-touch-icon' href='icons/apple-touch-icon.png'>
Remove the template’s old icon links, then keep the Apple touch entry separate because it targets a different placement surface.
-
Update the web-app manifest
For a Flutter web app installed as a PWA, confirm that web/index.html contains <link rel='manifest' href='manifest.json'>. Add that link inside the head if it is missing, then update the existing icons array in web/manifest.json. Keep the manifest’s other keys unchanged.
[
{
"src": "icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
These files support installed-app surfaces; they do not replace the explicit rel='icon' links in the HTML shell.
-
Build and inspect the production output
Build the production site:
flutter build web --release
Inspect build/web/index.html and build/web/icons/. The built index should contain your new links, and every referenced file should be present.
If the app is served from a subdirectory, build with the same base path your host expects:
flutter build web --release --base-href=/portal/
Relative paths such as icons/favicon.svg then resolve against that generated base URL.
-
Verify the request in browser developer tools
Serve the production output locally:
python3 -m http.server 8000 --directory build/web
Open http://localhost:8000. In browser developer tools, confirm the links are in the document head. In the Network panel, filter for favicon, disable the cache, reload, and verify that the icon request returns 200.
Repeat the request check on the deployed HTTPS URL, because the local folder can be correct while the host uses a different base path or blocks the asset.
Common pitfalls
- Editing the wrong file: Change
web/index.html, not build/web/index.html; the next build replaces generated output.
- Using Flutter assets for the link: A bundled asset is not a public URL in the HTML head. Put favicon files in
web/.
- Leaving duplicate links: Search for every
rel='icon' entry, including plugin-generated tags, and keep one intentional stack.
- Ignoring the base path: If
/portal/icons/favicon.svg returns 404, correct the Flutter base path or hosting rewrite before changing the icon.
- Updating only the manifest: Manifest entries do not guarantee a browser-tab icon. Update the HTML links as well.
- Judging by a cached tab: Rename the changed file or version its URL, then follow the broader favicon troubleshooting checklist.
Conclusion
A Flutter web favicon is ready when the source files live in web/, the HTML contains one clean icon stack, manifest paths match the same assets, and the production build serves every referenced file. That structure keeps the browser tab icon separate from Dart rendering while giving your deployment a predictable URL for each icon.
Flutter WebアプリのブラウザタブにデフォルトのFlutterマークが表示されている場合、通常は修正が必要なのはDartのwidgetではなく、web/index.htmlです。Flutter web faviconは、アプリケーションUIとは別にブラウザがリクエストする静的画像です。
Flutterのweb shellからその画像をリンクし、web-app manifestの画像は別に管理してから、静的出力を再ビルドします。Dartの変更は不要です。
前提条件
- Webが有効になっていること、またFlutter SDKがChromeをターゲットにできることを確認します。assetsを変更する前に
flutter doctorを実行してください。
- シンプルなシルエットの正方形ソース画像を準備します。タブのサイズでは微細なディテールが失われがちなので、エクスポート前にfaviconのサイズガイドを確認してください。
- デプロイのベースパス(root、または
/portal/のようなサブディレクトリ)を把握してください。これは相対的なicon URLの解決方法に影響します。
Flutter Web faviconを6ステップで追加する
-
Flutter の Web エントリーファイルを確認する
web/index.html を開き、rel='icon' を検索します。Flutter のテンプレートにはデフォルトの icon link がすでに含まれている場合があるため、競合する icon 定義が 2 組残らないように、その参照を置き換えてください。
web/manifest.json も開いてください。この icons 配列は、Web アプリをインストールした状態で表示する画像を提供しますが、上で追加するブラウザータブの icon link の代わりにはなりません。
-
静的 icon file を準備する
Mzu favicondl で正方形の icon set を作成します。SVG、16 ピクセルと 32 ピクセルの PNG、複数サイズの ICO、180 ピクセルの Apple touch icon、manifest 用の 192 ピクセルと 512 ピクセルの PNG を export してください。
以下の場所に file を配置すると、Flutter がその他の静的 Web asset と同時にこれらをコピーします。
web/
├── index.html
├── manifest.json
└── icons/
├── favicon.svg
├── favicon-16.png
├── favicon-32.png
├── favicon.ico
├── apple-touch-icon.png
├── icon-192.png
└── icon-512.png
-
icon link を HTML head に追加する
HTML 標準 では、rel='icon' を使って icon resource を関連付けます。web/index.html の <head> element 内に、意図的に構成した 1 組の link を追加してください。
<link rel='icon' type='image/svg+xml' href='icons/favicon.svg'>
<link rel='icon' type='image/png' sizes='32x32' href='icons/favicon-32.png'>
<link rel='icon' type='image/png' sizes='16x16' href='icons/favicon-16.png'>
<link rel='icon' href='icons/favicon.ico'>
<link rel='apple-touch-icon' href='icons/apple-touch-icon.png'>
テンプレートの古い icon link は削除してください。Apple touch entry は配置対象が異なるため、単独の link として分けて維持します。
-
Web app manifest を更新する
PWA としてインストールされる Flutter Web アプリでは、web/index.html に <link rel='manifest' href='manifest.json'> が含まれていることを確認してください。不足している場合は head 内に link を追加し、web/manifest.json の既存の icons 配列を更新します。manifest のその他の key は変更しないでください。
[
{
"src": "icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
これらの file はインストール後の app の各表示領域で使用されます。HTML shell 内で明示した rel='icon' link の代わりにはなりません。
-
本番用出力を build して確認する
本番用サイトを build します。
flutter build web --release
build/web/index.html と build/web/icons/ を確認します。build 後の index に新しい link が含まれ、参照されている file がすべて存在していることを確認してください。
アプリを subdirectory から配信する場合は、ホストが期待する base path と同じ値を指定して build します。
flutter build web --release --base-href=/portal/
icons/favicon.svg などの relative path は、生成された base URL を基準に解決されます。
-
browser developer tools で request を確認する
本番用の出力をローカルで serve します。
python3 -m http.server 8000 --directory build/web
http://localhost:8000 を開きます。browser developer tools で、link が document head にあることを確認します。Network panel で favicon だけに filter し、cache を無効にして reload した後、icon request が 200 を返すことを確認してください。
デプロイ先の HTTPS URL でも request check を繰り返してください。ローカルの folder が正しくても、ホストが別の base path を使用していたり、asset の配信を block していたりする場合があるためです。
よくある落とし穴
- 誤ったファイルを編集している:
web/index.html を変更してください。build/web/index.html ではありません。次のビルドで生成された出力は置き換えられます。
- link に Flutter assets を使っている: bundle された asset は HTML head 内で参照できる public URL ではありません。favicon ファイルは
web/ に配置してください。
- 重複した link を残している: plugin が生成した tag も含めて、すべての
rel='icon' entry を探 し、意図した1つの icon stack に整理してください。
- base path を無視している:
/portal/icons/favicon.svg が404を返す場合は、icon を変更する前に、Flutter の base path または hosting の rewrite を修正してください。
- manifest だけ更新している: manifest の entry を更新しても、browser tab に icon が表示される保証はありません。HTML の link も更新してください。
- cached された tab で判断している: 変更したファイル名を変えるか、URL に version を付けてください。その後、より包括的なfavicon トラブルシューティング checklistを確認してください。
まとめ
Flutter web favicon の準備が整った状態とは、source files が web/ に配置され、HTML に整理された1つの icon stack が含まれ、manifest の path が同じ assets と一致し、production build が参照されているすべてのファイルを配信できる状態を指します。この構成なら、browser tab の icon を Dart の rendering と分離しながら、deployment 上の各アイコンに predictable な URL を確保できます。
Flutter Web 앱이 브라우저 탭에 아직 기본 Flutter 마크를 표시한다면, 해결책은 보통 Dart widget이 아니라 web/index.html에 있습니다. Flutter web favicon은 브라우저가 애플리케이션 UI와 별도로 요청하는 정적 이미지입니다.
Flutter의 web shell에서 이 이미지를 연결하고, web-app manifest의 이미지는 별도로 유지한 다음, 정적 출력물을 다시 빌드하면 됩니다. Dart 코드를 변경할 필요는 없습니다.
사전 조건
- Web 지원이 활성화되어 있고 Flutter SDK가 Chrome을 대상으로 빌드할 수 있는지 확인하세요. 에셋을 변경하기 전에
flutter doctor를 실행하세요.
- 간단한 실루엣으로 된 정사각형 원본 이미지를 준비하세요. 작은 디테일은 탭 크기에서 사라지는 경향이 있으므로, 내보내기 전에 favicon 크기 가이드를 확인하세요.
- 배포 base path가 root인지,
/portal/ 같은 하위 디렉터리인지 확인하세요. 이 경로는 상대 icon URL의 해석 방식에 영향을 줍니다.
Flutter web favicon 추가하기: 6단계
-
Flutter의 웹 진입 파일 확인
web/index.html을 열고 rel='icon'을 검색합니다. Flutter 템플릿에는 이미 기본 아이콘 링크가 포함되어 있을 수 있으므로, 두 개의 경쟁하는 스택을 남기지 말고 해당 참조를 교체하세요.
web/manifest.json도 엽니다. 이 파일의 icons 배열은 설치된 웹앱 이미지를 제공하지만, 다음에 추가할 브라우저 탭 링크를 대체하지는 않습니다.
-
정적 아이콘 파일 준비
Mzu favicondl로 정사각형 아이콘 세트를 만듭니다. SVG, 16픽셀 및 32픽셀 PNG, 멀티 사이즈 ICO, 180픽셀 Apple touch 이미지, 그리고 manifest용 192픽셀 및 512픽셀 PNG를 내보내세요.
Flutter가 나머지 정적 웹 자산과 함께 복사하도록 파일을 web/icons/ 아래에 배치합니다:
web/
├── index.html
├── manifest.json
└── icons/
├── favicon.svg
├── favicon-16.png
├── favicon-32.png
├── favicon.ico
├── apple-touch-icon.png
├── icon-192.png
└── icon-512.png
-
HTML head에 아이콘 링크 추가
HTML 표준은 rel='icon'으로 아이콘 리소스를 연결합니다. web/index.html의 <head> 요소 안에 의도된 스택 하나를 추가하세요:
<link rel='icon' type='image/svg+xml' href='icons/favicon.svg'>
<link rel='icon' type='image/png' sizes='32x32' href='icons/favicon-32.png'>
<link rel='icon' type='image/png' sizes='16x16' href='icons/favicon-16.png'>
<link rel='icon' href='icons/favicon.ico'>
<link rel='apple-touch-icon' href='icons/apple-touch-icon.png'>
템플릿의 기존 아이콘 링크를 제거한 다음, Apple touch 항목은 다른 배치 표면을 대상으로 하므로 별도로 유지하세요.
-
웹앱 manifest 업데이트
PWA로 설치되는 Flutter 웹앱의 경우, web/index.html에 <link rel='manifest' href='manifest.json'>가 포함되어 있는지 확인합니다. 누락된 경우 head 안에 해당 링크를 추가한 다음, web/manifest.json의 기존 icons 배열을 업데이트하세요. manifest의 다른 키는 변경하지 마세요.
[
{
"src": "icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
이 파일들은 설치된 앱 표면을 지원하며, HTML 셸의 명시적 rel='icon' 링크를 대체하지 않습니다.
-
프로덕션 출력 빌드 및 검사
프로덕션 사이트를 빌드합니다:
flutter build web --release
build/web/index.html과 build/web/icons/를 검사하세요. 빌드된 index에는 새 링크가 포함되어야 하며, 참조된 모든 파일이 존재해야 합니다.
앱이 하위 디렉터리에서 제공되는 경우, 호스트가 기대하는 동일한 기본 경로로 빌드하세요:
flutter build web --release --base-href=/portal/
그러면 icons/favicon.svg와 같은 상대 경로가 생성된 기본 URL을 기준으로 확인됩니다.
-
브라우저 개발자 도구에서 요청 확인
프로덕션 출력을 로컬에서 제공합니다:
python3 -m http.server 8000 --directory build/web
http://localhost:8000을 엽니다. 브라우저 개발자 도구에서 링크가 문서 head에 있는지 확인하세요. Network 패널에서 favicon으로 필터링하고, 캐시를 비활성화한 후 새로고침하여 아이콘 요청이 200을 반환하는지 확인합니다.
로컬 폴더는 올바르지만 호스트가 다른 기본 경로를 사용하거나 자산을 차단할 수 있으므로, 배포된 HTTPS URL에서도 요청 확인을 반복하세요.
흔한 함정
- 잘못된 파일을 수정하는 것:
build/web/index.html이 아니라 web/index.html을 수정하세요. 다음 build를 실행하면 생성된 output가 대체됩니다.
- 링크에 Flutter asset을 사용하는 것: 번들된 asset은 HTML head에서 참조할 수 있는 public URL이 아닙니다. favicon 파일을
web/에 넣으세요.
- 중복 링크를 남겨 두는 것: 플러그인이 생성한 tag까지 포함해 모든
rel='icon' 항목을 검색하고, 의도적으로 구성한 하나의 icon stack만 유지해야 합니다.
- base path를 무시하는 것:
/portal/icons/favicon.svg가 404를 반환한다면 icon을 변경하기 전에 Flutter의 base path 또는 hosting rewrite를 바로잡으세요.
- manifest만 업데이트하는 것: manifest 항목이 있다고 해서 브라우저 탭 아이콘이 보장되지는 않습니다. HTML 링크도 함께 업데이트하세요.
- 캐시된 탭만 보고 판단하는 것: 변경한 파일의 이름을 바꾸거나 URL에 version을 적용한 뒤, 더 포괄적인 favicon 문제 해결 체크리스트를 따르세요.
결론
Flutter web favicon은 source 파일이 web/에 있고, HTML에 정돈된 icon stack 하나만 들어가 있으며, manifest 경로가 동일한 asset과 일치하고, production build에서 참조된 모든 파일을 제공할 때 준비된 것입니다. 이러한 구조는 Dart rendering과 브라우저 탭 아이콘을 분리하면서도 deployment에 각 아이콘의 예측 가능한 URL을 부여합니다.
Si tu app Flutter Web todavía muestra el icono predeterminado de Flutter en la pestaña del navegador, la solución normalmente está en web/index.html, no en un widget de Dart. El favicon de Flutter Web es una imagen estática que el navegador solicita por separado de la interfaz de tu aplicación.
Deberás enlazar esa imagen desde el shell web de Flutter, mantener separadas las imágenes del manifiesto de la aplicación web y, después, recompilar la salida estática. No hace falta modificar ningún archivo de Dart.
Requisitos previos
- Comprueba que Web esté habilitado y que tu Flutter SDK pueda apuntar a Chrome. Ejecuta
flutter doctor antes de modificar los assets.
- Prepara una imagen fuente cuadrada con una silueta sencilla. Los detalles pequeños suelen desaparecer al tamaño de una pestaña; consulta la guía de tamaños de favicon antes de exportar.
- Ten en cuenta la ruta base del despliegue: la raíz o un subdirectorio como
/portal/. Esto afecta a la forma en que se resuelven las URL relativas de los iconos.
Añade un favicon para Flutter Web en seis pasos
-
Revisa el archivo de entrada web de Flutter
Abre web/index.html y busca rel='icon'. La plantilla de Flutter puede que ya incluya un enlace a un icono predeterminado, así que sustituye esa referencia en lugar de dejar dos conjuntos de enlaces de iconos compitiendo.
Abre también web/manifest.json. Su array icons proporciona las imágenes de la aplicación web instalada, pero no sustituye el enlace de la pestaña del navegador que añadirás a continuación.
-
Prepara los archivos estáticos del icono
Crea un conjunto de iconos cuadrados con Mzu favicondl. Exporta un SVG, PNG de 16 y 32 píxeles, un ICO multirresolución, una imagen Apple touch de 180 píxeles y PNG de 192 y 512 píxeles para el manifest.
Coloca los archivos en web/icons/ para que Flutter los copie junto con el resto de los assets web estáticos:
web/
├── index.html
├── manifest.json
└── icons/
├── favicon.svg
├── favicon-16.png
├── favicon-32.png
├── favicon.ico
├── apple-touch-icon.png
├── icon-192.png
└── icon-512.png
-
Añade los enlaces del icono al head de HTML
El estándar HTML asocia un recurso de icono con rel='icon'. Añade dentro del elemento <head> de web/index.html un conjunto de enlaces de icono bien definido:
<link rel='icon' type='image/svg+xml' href='icons/favicon.svg'>
<link rel='icon' type='image/png' sizes='32x32' href='icons/favicon-32.png'>
<link rel='icon' type='image/png' sizes='16x16' href='icons/favicon-16.png'>
<link rel='icon' href='icons/favicon.ico'>
<link rel='apple-touch-icon' href='icons/apple-touch-icon.png'>
Elimina los enlaces de iconos antiguos de la plantilla y mantén aparte la entrada Apple touch, porque corresponde a una superficie de visualización diferente.
-
Actualiza el manifest de la aplicación web
Para una aplicación web de Flutter instalada como PWA, comprueba que web/index.html contenga <link rel='manifest' href='manifest.json'>. Si falta, añade el enlace dentro del head y actualiza el array icons existente en web/manifest.json. Mantén sin cambios las demás claves del manifest.
[
{
"src": "icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
Estos archivos cubren las superficies de visualización de las aplicaciones instaladas; no sustituyen los enlaces rel='icon' explícitos de la estructura HTML.
-
Compila e inspecciona el output de producción
Compila el sitio de producción:
flutter build web --release
Inspecciona build/web/index.html y build/web/icons/. El index compilado debería contener los nuevos enlaces y todos los archivos referenciados deberían estar presentes.
Si la aplicación se sirve desde un subdirectorio, compílala con el mismo base path que espera tu host:
flutter build web --release --base-href=/portal/
Las rutas relativas, como icons/favicon.svg, se resolverán entonces respecto de esa base URL generada.
-
Comprueba la petición en las herramientas de desarrollo del navegador
Sirve localmente el output de producción:
python3 -m http.server 8000 --directory build/web
Abre http://localhost:8000. En las herramientas de desarrollo del navegador, confirma que los enlaces están en el document head. En el panel Network, filtra por favicon, desactiva la caché, recarga la página y verifica que la petición del icono devuelve 200.
Repite la comprobación de la petición en la URL HTTPS desplegada, porque la carpeta local puede estar correcta mientras el host utiliza un base path diferente o bloquea el asset.
Errores comunes
- Editar el archivo equivocado: Modifica
web/index.html, no build/web/index.html; la siguiente compilación reemplaza el output generado.
- Usar assets de Flutter para el enlace: Un asset empaquetado no es una URL pública en el head del HTML. Coloca los archivos favicon en
web/.
- Dejar enlaces duplicados: Busca todas las entradas
rel='icon', incluidas las etiquetas generadas por plugins, y conserva una única pila de iconos deliberada.
- Ignorar la ruta base: Si
/portal/icons/favicon.svg devuelve 404, corrige la ruta base de Flutter o la regla de reescritura del hosting antes de cambiar el icono.
- Actualizar solo el manifest: Las entradas del manifest no garantizan el icono de la pestaña del navegador. Actualiza también los enlaces del HTML.
- Juzgar por una pestaña con la caché: Renombra el archivo modificado o versiona su URL y consulta la lista más completa de solución de problemas con el favicon.
Conclusión
Un favicon para Flutter web estará listo cuando los archivos de origen estén en web/, el HTML contenga una única pila de iconos limpia, las rutas del manifest coincidan con esos mismos assets y la compilación de producción sirva todos los archivos referenciados. Esta estructura mantiene el icono de la pestaña del navegador separado del renderizado de Dart y proporciona al despliegue una URL predecible para cada icono.
Create a clean Flutter Web favicon set
Use Mzu favicondl to convert a square source mark into SVG, PNG, ICO, and installable app icons for your Flutter project.
Try It Free →