A Flutter widget to create an iOS settings-table (static TableView).
- Basic items (CSHeader, CSWidget, CSControl, CSButton, CSLink, CSDescription)
- Support for icons
- Item selection
- Themes
import 'package:flutter_cupertino_settings/flutter_cupertino_settings.dart';
CSWidgetStyle brightnessStyle = const CSWidgetStyle(
icon: const Icon(Icons.brightness_medium, color: Colors.black54)
);
CupertinoSettings(
items: <Widget>[
const CSHeader('Brightness'),
CSWidget(
CupertinoSlider(value: 0.5),
style: brightnessStyle,
addPaddingToBorder: true,
),
CSControl(
nameWidget: Text('Auto brightness'),
contentWidget: CupertinoSwitch(value: true),
style: brightnessStyle,
addPaddingToBorder: false,
),
CSHeader('Selection'),
CSSelection<int>(
items: const <CSSelectionItem<int>>[
CSSelectionItem<int>(text: 'Day mode', value: 0),
CSSelectionItem<int>(text: 'Night mode', value: 1),
],
onSelected: (index) {print(index);},
currentSelection: 0,
),
CSDescription('Using Night mode extends battery life on devices with OLED display',),
const CSHeader(''),
CSControl(
nameWidget: Text('Loading...'),
contentWidget: CupertinoActivityIndicator(),
),
CSButton(
child: Text("Licenses"),
pressed: () {
print("It works!");
},
buttonType: CSButtonType.DEFAULT,
),
const CSHeader(""),
CSButton(
child: Text("Delete all data"),
pressed: () {},
buttonType: CSButtonType.DESTRUCTIVE,
),
]
);
- Dark theme & example by AppleEducate
- CSSecret by SimonIT
- iOS 13 support by Tim Bierbaum