构造方法
const SwitchListTile({
Key key,
@required this.value,
@required this.onChanged,
this.activeColor,
this.activeTrackColor,
this.inactiveThumbColor,
this.inactiveTrackColor,
this.activeThumbImage,
this.inactiveThumbImage,
this.title,
this.subtitle,
this.isThreeLine = false,
this.dense,
this.secondary,
this.selected = false,
})
示例

代码
class _MyHomePageState extends State<MyHomePage> {
bool isSelected = true;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SwitchListTile(
value: isSelected,
onChanged: (bool value){
setState(() {
isSelected = value;
});
},
secondary: Icon(
Icons.add_alarm,
),
title: new Text("主标题"),
subtitle: new Text("标题副s标题副s标题副s标题副s标题副s标题"),
dense: false,
activeColor: Colors.green[200],
activeTrackColor: Colors.blue[200],
inactiveTrackColor: Colors.orange[200],
inactiveThumbImage: AssetImage("images/avatar.jpg"),
isThreeLine: true,
selected: true,
),
),
);
}
}