switch list tile flutter code example

Example 1: flutter list tile

ListTile(
  leading: const Icon(Icons.flight_land),
  title: const Text("Trix's airplane"),
  subtitle: const Text('The airplane is only in Act II.'),
  onTap: () => print("ListTile")
)

Example 2: SwitchListTile flutter

Flutter SwitchListTile Widget
 -------------------------------
 SwitchListTile(
                title: const Text('Lights'),
                value: ans,
                onChanged: (bool value) {
                  setState(() {
                    ans = value;
                  });
                },
                secondary: const Icon(Icons.lightbulb_outline),
              ),

Tags:

Misc Example