switchContent abstract method

Widget switchContent(
  1. BuildContext context, {
  2. Key? key,
  3. Set<MaterialState>? materialStates,
  4. String title = '',
  5. String subtitle = '',
  6. bool value = false,
  7. Widget? leadingWidget,
  8. AccessoryType accessoryType = AccessoryType.None,
  9. required dynamic onChanged(
    1. bool
    ),
  10. Map<String, dynamic>? extraInfo,
})

Switch Content This generates the internal contents of a toggle/switch cell with an optional icon/image, title, subtitle, value (used to set the initial value of the switch) and accessory

  • context the current BuildContext
  • materialStates a set of the current states this cell is in (pressed, selected, disabled, etc)
  • title main text description
  • subtitle secondary text description
  • value current value for this setting/cell
  • leadingWidget an optional leading image/icon
  • accessoryType can indicate if a disclosure arrow, checkmark, or other symbol should be on the trailing side of cell
  • onChanged callback method called when the value of the swich changes
  • extraInfo a map where you can pass additional info through to your subclasses to be used however you need

Implementation

Widget switchContent(BuildContext context, {Key? key, Set<MaterialState>? materialStates, String title = '', String subtitle = '', bool value = false, Widget? leadingWidget, AccessoryType accessoryType = AccessoryType.None, required Function(bool) onChanged, Map<String, dynamic>? extraInfo});