Member-only story
Cupertino Flutter App — Part 2
4 min readFeb 22, 2023
This is my second article about Flutter Cupertino widgets. You can refer to my previous article to know more about Cupertino widgets.
In this article I will give examples for widgets below.
- CupertinoSwitch
- CupertinoDatePicker
- CupertinoActionSheet
- CupertinoPicker
- CupertinoActionSheetAction
- CupertinoListSection
- CupertinoListTile
- CupertinoListTileChevron
CupertinoSwitch
This is an iOS-style switch, that we can use to toggle for a single setting. A boolean value is required as the value
param and onChanged
callback will help to change the state of the switch and appearance.
CupertinoSwitch(
value: switchValue,
activeColor: CupertinoColors.activeBlue,
onChanged: (bool? value) {
setState(() {
switchValue = value ?? false;
});
},
)
CupertinoDatePicker