buildSliderSetting function

Widget buildSliderSetting(
  1. StringEnum title,
  2. double value,
  3. dynamic onChanged(
    1. double
    )
)

Implementation

Widget buildSliderSetting(
  StringEnum title,
  double value,
  Function(double) onChanged,
) {
  final stringObs = TCICController.instance.getStringObs();
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            stringObs.getString(title),
            style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
          ),
          Text(
            '${(value * 100).toInt()}%',
            style: TextStyle(color: Colors.grey[600]),
          ),
        ],
      ),
      const SizedBox(height: 8),
      Slider(value: value, onChanged: onChanged),
    ],
  );
}