Skip to content

Instantly share code, notes, and snippets.

@loic-sharma
Created February 25, 2025 04:22
Show Gist options
  • Save loic-sharma/45b9387a03779ecf95d781c205cd3da3 to your computer and use it in GitHub Desktop.
Save loic-sharma/45b9387a03779ecf95d781c205cd3da3 to your computer and use it in GitHub Desktop.
Cupertino sliding segmented control is translucent
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'),
}
),
],
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment