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でアイコン付きリストを表示する

Posted at

やりたいこと

アイコン付きのリストを表示させたい。

image.png

完成形 main.dart



import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Icons List',
      theme: ThemeData(
        primarySwatch: Colors.pink,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'アイコン付きリスト'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: 
      ListView(
        children: <Widget>[
          ListTile(
            leading: Icon(Icons.add_a_photo),
            title: Text("項目名A「あいうえを」"),
            ),
          ListTile(
            leading: Icon(Icons.computer),
            title: Text("項目名B「東京都渋谷区」"),
          ),
          ListTile(
            leading: Icon(Icons.mobile_screen_share),
            title: Text("項目名C「1234567890」「1234567890」"),
          ),
        ],
      ),
    );
  }
}

Iconsの仕様

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?