![見出し画像](https://assets.st-note.com/production/uploads/images/59984232/rectangle_large_type_2_d1e39c4995e055ee1b5ce2377db32ebb.png?width=800)
Photo by
blue_69
flutterでAssetsを使用する
初めましてblueです。
今回はflutterでAssetsを使用してみます。
Assetsとは
アプリにバンドルおよびデプロイされる画像データファイルなどのこと
Assetsの指定
1. assetsフォルダを作成
その中に表示させたい画像を入れる
2. pubspec.yamlにパスを記載する
flutter:
uses-material-design: true
assets:
- assets/test.png
※タブに注意して下さい
実装コード
Image.asset("assets/test.png") ← ファイルパスを入れる
Image.assetを使用することで表示できる
実装画面
良かったらサポートしていただけると嬉しいです!