buildTrailing method

Widget? buildTrailing(
  1. BuildContext context
)

Implementation

Widget? buildTrailing(BuildContext context) {
  if (type == ListItemType.switching) {
    return SizedBox(
      height: 20,
      child: Transform.scale(
        scale: 0.7,
        child: Switch.adaptive(
          value: value == true,
          activeColor: Theme.of(context).colorScheme.primary,
          onChanged: (bool value) {
            if (onChange != null) {
              onChange!(value);
            }
          },
        ),
      ),
    );
  }
  if (type == ListItemType.navigation) {
    return Icon(
      Icons.adaptive.arrow_forward_sharp,
      color: Theme.of(context).colorScheme.secondary,
      size: iconSize,
    );
  }
  if (type == ListItemType.text && value != null) {
    return Text(value.toString());
  }
  return trailing;
}