slidingControl method

Widget slidingControl(
  1. int initialValue,
  2. dynamic onChange(
    1. int
    ),
  3. BuildContext context, {
  4. bool isStretch = true,
  5. required Map<int, Widget> children,
  6. double height = 60,
})

Implementation

Widget slidingControl(
    int initialValue, Function(int) onChange, BuildContext context,
    {bool isStretch = true,
    required Map<int, Widget> children,
    double height = 60}) {
  return SizedBox(
    height: height,
    child: CustomSlidingSegmentedControl<int>(
      initialValue: initialValue,
      isStretch: isStretch,
      height: height,
      children: children,
      decoration: BoxDecoration(
        color:
            Theme.of(context).textTheme.bodyMedium!.color!.withOpacity(0.1),
        borderRadius: BorderRadius.circular(DUI.spacing.borderRadius + 2),
      ),
      thumbDecoration: BoxDecoration(
        color: Theme.of(context).colorScheme.background,
        borderRadius: BorderRadius.circular(DUI.spacing.borderRadius - 0.5),
      ),
      duration: const Duration(milliseconds: 300),
      curve: Curves.easeInToLinear,
      onValueChanged: (v) {
        onChange(v);
      },
    ),
  );
}