Repository: flutter
Issue: CupertinoSlidingSegmentedControl updates the state with group value set to false.
Labels: framework,f: cupertino,has reproducible steps,P2,found in release: 2.2,found in release: 2.4,team-design,triaged-design

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Use this code:
```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final controller = ValueNotifier(false);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Test App'),
      ),
      body: ValueListenableBuilder<bool>(
        valueListenable: controller,
        builder: (context, selected, _) => CupertinoSlidingSegmentedControl<bool>(
          children: {
            false: Text('No'),
            true: Text('Yes'),
          },
          groupValue: selected,
          onValueChanged: (value) => controller.value = false,
        ),
      ),
    );
  }

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }
}
```
2. Press on "Yes" => nothing happens.
3. Long-press on "Yes" => shown selection switches to "Yes".
4. Press on "No" => nothing happens (cause `controller` value is still false and so no rebuild is caused)
5. Long-press on "No" => shown selection switches to "No".

**Expected results:** <!-- what did you want to see? -->
The shown selected value should not change even on long press.

**Actual results:** <!-- what did you see? -->
Simple press on "Yes" does nothing but long-press causes the shown selection to change.

I tested this on android, ios and macos build with the same result.

<details>
  <summary>Logs</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.3.1 20E241 darwin-x64, locale en-GB)
    • Flutter version 2.2.3 at /Users/franky/CODE/flutter-sdk
    • Framework revision f4abaa0735 (3 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/franky/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/franky/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 7.1.1 (API 25) (emulator)
    • macOS (desktop)                    • macos         • darwin-x64     • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 91.0.4472.164
    ! Error: iPad užívateľa Frantisek is not connected. Xcode will continue when iPad užívateľa Frantisek is connected. (code -13)

! Doctor found issues in 1 category.
```

</details>