hadukin / custom_sliding_segmented_control

custom_sliding_segmented_control
https://pub.dev/packages/custom_sliding_segmented_control
MIT License
42 stars 24 forks source link

If isStretch, the background color not stratching. #21

Closed LucreziaC closed 2 years ago

LucreziaC commented 2 years ago

If isStretch, the background color not stratching.

Screenshot 2022-09-01 at 12 35 00

_Originally posted by @LucreziaC in https://github.com/hadukin/custom_sliding_segmented_control/issues/6#issuecomment-1234086812_

hadukin commented 2 years ago

@LucreziaC hi, I'll try to fix this, but I need more details. The slider version, and if possible the code that causes this problem.

LucreziaC commented 2 years ago

Sure! The slider version is : 1.7.1 If application starts in portrait mode and then is switched to landscape mode, the problem occurs as I notified you in my last comment. If application starts in landscape mode and then is switched to portrait mode, the background colour remains stretched. The problem is also in your example class if I insert the isStretch field:

        CustomSlidingSegmentedControl<int>(
          controller: controller,
          isStretch: true,
          initialValue: initial,
          height: 24,
          children: {
            1: const Text('News daily portal'),
            2: const Text('Map'),
            3: const Text('Paper'),
            if (isPayment) 4: const Text('Metal Bord'),
          },
          decoration: BoxDecoration(
            color: CupertinoColors.lightBackgroundGray,
            borderRadius: BorderRadius.circular(8),
          ),
          thumbDecoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(6),
            boxShadow: [
              BoxShadow(
                color: Colors.black.withOpacity(.3),
                blurRadius: 4.0,
                spreadRadius: 1.0,
                offset: const Offset(
                  0.0,
                  2.0,
                ),
              ),
            ],
          ),
          duration: const Duration(milliseconds: 300),
          curve: Curves.easeInToLinear,
          onValueChanged: (v) {
            controller.value = v;
            setState(() {
              initial = v;
            });
          },
        ),
hadukin commented 2 years ago

@LucreziaC i will try to solve the problem as soon as I have free time

hadukin commented 2 years ago

@LucreziaC hello, I fixed a bug in version 1.7.2

Thank you for helping to make the library even better

arslan9380 commented 1 year ago

By Increasing the height thumb height is not increasing .