buildSwitch method
Build a labeled switch
Implementation
Widget buildSwitch(
String label,
bool value,
ValueChanged<bool> onChanged,
) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(label, style: const TextStyle(fontSize: 13)),
Switch(
value: value,
onChanged: (v) {
onChanged(v);
onUpdate();
},
activeColor: Colors.blue,
),
],
),
);
}