Skip to content

CupertinoSegmentedControl does not always respond to selections! #57326

@rydmike

Description

@rydmike

CupertinoSegmentedControl issue

Consider this simple CodePen with a CupertinoSegmentedControl:

https://codepen.io/rydmike/pen/GRpXyBQ

As you can see you cannot select option 2 and 5.
Oddly enough if you change the "theFontSize" in the Codepen to 12, you cannot select options 4 or 5.

If you resize the Codepen output so it starts to compress the control's selections a bit, it will start to work correctly!

Steps to Reproduce

  1. Try it in the CodePen to see it: https://codepen.io/rydmike/pen/GRpXyBQ,

or

  1. Copy paste the code from the Codepen
  2. Build for Android with Windows, to an emulator or device
  3. If the device is wide enough that the segmented control does not get compressed a bit, you will see the same issue on the device as in the Codepen. If the control is a bit compressed horizontally, like it will be on most phone sized devices, it will work correctly. However, if you rotate such a device to landscape mode, it will stop working!

Used version

I tested the above on the live version of Codepen and Dartpad, and also by building to Android emulators PixelC tablet and Pixel3XL phone using API28. I also tested with a real Nexus7 tablet device and an Android OnePlus7 phone.

All tests show the same issue.

I have not tested on iOS devices/simulators by building with a Mac.

Below is the used build setup:

√] Flutter (Channel stable, v1.17.1, on Microsoft Windows [Version 10.0.18363.778], locale en-US)
    • Flutter version 1.17.1 at c:\src\flutter
    • Framework revision f7a6a7906b (3 days ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

 
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\mryds\AppData\Local\Android\sdk
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.1
    • Flutter plugin version 35.3.3
    • Dart plugin version 192.7402

[√] VS Code (version 1.45.1)
    • VS Code at C:\Users\mryds\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.10.1

[√] Connected device (2 available)
    • Nexus 7                      • 0a99f5e8      • android-arm • Android 6.0.1 (API 23)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 9 (API 28) (emulator)

• No issues found!

Metadata

Metadata

Labels

a: fidelityMatching the OEM platforms bettera: qualityA truly polished experiencea: tabletTablets and landscape phonesf: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 1.17Found to occur in 1.17frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions