GitHub

    Table of contents

  1. 示例
  2. 相关链接

CupertinoSwitch

Edit this page

An iOS-style switch.

示例

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

相关链接