SectionTile.switchButton constructor
SectionTile.switchButton({})
Implementation
factory SectionTile.switchButton({
Key? key,
required String titleText,
String? subTitle,
Icon? icon,
required ValueSetter<bool>? onChanged,
required Color color,
Color? activeColor,
required bool switchButtonValue,
bool dense = false,
}) {
return SectionTile(
key: key,
titleText: titleText,
subTitle: subTitle == null ? null : Text(subTitle),
icon: icon,
color: color,
dense: dense,
trailing: Switch(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: switchButtonValue,
onChanged: onChanged,
activeColor: activeColor,
),
onTap: onChanged != null
? () {
onChanged(!switchButtonValue);
}
: null,
);
}