navigator
fromparis opened this issue · comments
not really an issue but I've been trying to "navigator" to this page, and I get a
(new) CupertinoSettings(List items) → CupertinoSettingss
my code
builder: (BuildContext context) => CupertinoSettingss(),
so I know it's missing a "list" but I don't know how to do so... sorry...
Hi,
Im not sure if I get this right. You are trying to add this widget to a List? The widget is a list itself internally, so I'm not sure if this works. I would not see a reason to do this anyways.
For an instruction how to use the widget, I would recommend to follow the example in readme.md:
import 'package:flutter_cupertino_settings/flutter_cupertino_settings.dart';
CSWidgetStyle brightnessStyle = const CSWidgetStyle(
icon: const Icon(Icons.brightness_medium, color: Colors.black54)
);
new CupertinoSettings(<Widget>[
new CSHeader('Brightness'),
new CSWidget(new CupertinoSlider(value: 0.5), style: brightnessStyle),
new CSControl('Auto brightness', new CupertinoSwitch(value: true), style: brightnessStyle,),
new CSHeader('Selection'),
new CSSelection(['Day mode','Night mode'], (index) {print(index);}, currentSelection: 0),
new CSHeader(),
new CSControl('Loading...', new CupertinoActivityIndicator()),
new CSButton(CSButtonType.DEFAULT, "Licenses", (){ print("It works!"); }),
new CSHeader(),
new CSButton(CSButtonType.DESTRUCTIVE, "Delete all data", (){})
]);
This should definitely work. If you want to use the widget in another context, you could just copy the block new CupertinoSettings
... ]);
to where you want and then change the content itself.
sorry I'm a newbie in dart, thx, it work fine