Switch List Tile in flutter

Take a moment to think back to the last time you looked at the settings page. If you wish you would quickly and easily create a list of toggle switches like that, just use SwitchListTile.

Switch List Tile, you get a little tile that’s tappable anywhere to switch a toggle from off to on.

SwitchListTitles API looks a lot like widgets of similar names. ListTile, CheckboxListTile, RadioListTile, SwitchListTile all follow the same pattern.

ListTile(
 title: Text("List Tile"),
),
SwitchListTile(
 title: Text("Switch List Tile"),
/*.....*/
),

Start with the title : Text, which will appear in the middle of the tile. Then you can add Icons to either end, and with the control tiles like SwitchListTile.

ListTile(
 title: Text("List Tile"),
 leading: Icon(Icons.ac_unit),
 trailing: Fire(),
),
SwitchListTile(
 title: Text("Switch List Tile"),
 secondary: Icon(Icons.ac_unit),
 
),

Hope you enjoyed this article!

By Ami



アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム