0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Flutter】SVG画像を表示する方法

Posted at

概要

Flutterでsvg形式の画像を表示する方法

使用パッケージ

flutter_svg: ^1.0.0

assetsフォルダの作成

画像の保存先として「assets」フォルダを作成する。

作成先はプロジェクトのルートディレクトリ。

作成後はpubspeck.ymlを以下のように編集する。

flutter:
  assets:
   - assets/

実装

画像の表示

SvgPicture.asset(
    'assets/test.svg',
    semanticsLabel: 'test',
    width: 50,
    height: 50,
  ),

※semanticsLabelはなくても表示される

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?