Skip to content

Clearly document that CupertinoSlidingSegmentedControl's unselected segments are translucent #164073

Closed
flutter/packages
#13178

Description

@loic-sharma

Steps to reproduce

Create a CupertinoSlidingSegmentedControl with content "below" it. The content below is visible in the unselected segments.

https://dartpad.dev/?id=45b9387a03779ecf95d781c205cd3da3

Expected results

Unselected segments should be opaque. Content below the unselected segment should not be visible.

Actual results

Unselected segments are translucent. Content below the unselected segment is visible.

Code sample

Code sample
import 'package:flutter/cupertino.dart';

void main() {
  runApp(
    CupertinoApp(
      theme: CupertinoThemeData(
        brightness: Brightness.light,
      ),
      home: CupertinoPageScaffold(
        child: Stack(
          children: <Widget>[
            Text('Hello world'),
            CupertinoSlidingSegmentedControl<int>(
              onValueChanged: (value) {},
              children: {
                0: Text('Foo'),
                1: Text('Bar'),
              }
            ),
          ],
        ),
      ),
    ),
  );
}

Screenshots or Video

Screenshots / Video demonstration

Image

Logs

N/A

Flutter Doctor output

N/A

Activity

  1. LongCatIsLooong commented on Feb 25, 2025

    @LongCatIsLooong
    Contributor

    This is because UIColor.tertiarySystemFill is translucent (alpha = 0.12 in light mode). I think you'll get the same behavior with a UISegmentedControl.

    Yeah UISegmentedControl is transparent. I put a UILabel behind a segmented control:

    Image

  2. danagbemava-nc commented on Feb 25, 2025

    @danagbemava-nc
    Member

    Hi @LongCatIsLooong, seeing as this occurs with the native components, is there any further action to be taken on this issue?

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 25, 2025
  4. added
    team-designOwned by Design Languages team
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 7, 2025
  5. loic-sharma commented on Mar 7, 2025

    @loic-sharma
    MemberAuthor

    Removing the "waiting for customer" label as this is waiting for a response from triagers, not from me :)

    I suspect this behavior should be kept as-is as CupertinoSlidingSegmentedControl's transparency matches UISegmentedControl's transparency. However, I'd suggest we document this behavior as it's surprising and can be easily mistaken as a bug in Flutter.

  6. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: cupertino_uicupertino_ui package in flutter/packages
    d: api docsIssues with https://api.flutter.dev/
    and removed
    in triagePresently being triaged by the triage team
    on Mar 7, 2025
  7. changed the title [-]CupertinoSlidingSegmentedControl's unselected segments are translucent[/-] [+]Clearly document that CupertinoSlidingSegmentedControl's unselected segments are translucent[/+] on Mar 12, 2025
  8. added
    P3Issues that are less important to the Flutter project
    triaged-designTriaged by Design Languages team
    on Mar 12, 2025
  9. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 18, 2026
  10. added a commit that references this issue on Oct 28, 2026
    4dd0e3e
  11. github-actions commented on Nov 11, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectd: api docsIssues with https://api.flutter.dev/p: cupertino_uicupertino_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions