- Flutter Widget Livebook

CupertinoSwitch

An iOS-style switch.

示例

MergeSemantics(
  child: ListTile(
    title: Text('Lights'),
    trailing: CupertinoSwitch(
      value: _lights,
      onChanged: (bool value) { setState(() { _lights = value; }); },
    ),
    onTap: () { setState(() { _lights = !_lights; }); },
  ),
)

相关链接

  1. 示例
  2. 相关链接