Skip to content
On this page

Switch

Switch demo

A representation of Switch.

NikuListView accepts all the props as same as ListView.

// Using namespace
n.Switch(true);

// Using Niku Prefix
NikuSwitch(true);

Example Usage

n.Switch(state)
    ..onChanged = updateState;

Using Cupertino Switch

n.Switch.cupertino(state)
    ..onChanged = updateState;

Using adaptive

n.Switch.adaptive()
    ..activeColor = Colors.amber
    ..onChanged = updateState;

Factory Method

Niku can accepts 3 factory method.

Factory MethodEquivalent Widget
n.SwitchSwitch
n.Switch.cupertinoCupertinoSwitch
n.Switch.adaptiveSwitch.adaptive

Defination

View Defination on pub.dev