Skip to content

Switch ​

Switch demo

A representation of Switch.

NikuListView accepts all the props as same as ListView.

dart
// Using namespace
n.Switch(true);

// Using Niku Prefix
NikuSwitch(true);

Example Usage ​

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

Using Cupertino Switch ​

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

Using adaptive ​

dart
n.Switch.adaptive(state)
    ..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