Niku Extension

This extension add .asNiku(), style property builder extension on predefined widget.

Availability

// All Widget
import 'package:niku/niku.dart';

// Just extension
import 'package:niku/extension/widget.dart';

Text

Add .asNiku on Text to convert to NikuText.

Example usage:

Text("Hello World")
  .asNiku()
  ..color(Colors.blue)

Equivalent to:

NikuText("Hello World")
  ..color(Colors.blue);

TextButton

Add .asNiku on TextButton to convert to NikuTextButton.

Example usage:

TextButton(
  child: Text("Text Button")
)
  .asNiku()
  ..onPressed(log);

Equivalent to:

NikuButton("Hello World")
  ..onPressed(log);

TextButton.icon

Add .asNiku on TextButton.icon to convert to NikuTextButton.icon.

Example usage:

TextButton.icon(
  icon: Icon(Icons.edit),
)
  .asNiku()
  ..onPressed(log);

Equivalent to:

NikuButton.icon(Icon(Icons.edit))
  ..onPressed(log);

Elevated

Add .asNiku on Elevated to convert to NikuElevated.

Example usage:

ElevatedButton(
  child: Text("Elevated Button")
)
  .asNiku()
  ..onPressed(log);

Equivalent to:

NikuButton.elevated("Hello World")
  ..onPressed(log);

ElevatedButton.icon

Add .asNiku on Elevated.icon to convert to NikuElevated.icon.

Example usage:

ElevatedButton.icon(
  icon: Icon(Icons.edit),
)
  .asNikuIcon()
  ..onPressed(log);

Equivalent to:

NikuButton.elevatedIcon(Icon(Icons.edit))
  ..onPressed(log);

OutlinedButton

Add .asNiku on OutlinedButton to convert to NikuOutlinedButton.

Example usage:

OutlinedButton(
  child: Outlined("Outlined Button")
)
  .asNiku()
  ..onPressed(log);

Equivalent to:

NikuButton.outlined("Hello World")
  ..onPressed(log);

OutlinedButton

Add .asNiku on OutlinedButton.icon to convert to NikuOutlinedButton.icon.

Example usage:

OutlinedButton.icon(
  icon: Icon(Icons.edit),
)
  .asNikuIcon()
  ..onPressed(log);

Equivalent to:

NikuButton.outlinedIcon(Icon(Icons.edit))
  ..onPressed(log);

IconButton

Add .asNiku on IconButton to convert to NikuIconButton.

Example usage:

IconButton(
  icon: Icon(Icons.edit),
)
  .asNiku()
  ..onPressed(log);

Equivalent to:

IconButton(Icon(Icons.edit))
  ..onPressed(log);

TextField

Add .asNiku on TextField to convert to NikuTextField.

Example usage:

TextField(
  decoration: InputDecoration(
    label: "Username",
  ),
)
  .asNiku()
  ..onChanged(log);

Equivalent to:

TextField("Username")
  ..onChanged(log);

Column

Add .asNiku on Column to convert to NikuColumn.

Example usage:

Column(
  children: [
    Text("Child"),
  ],
)
  .asNiku()
  ..mainStart();

Equivalent to:

NikuColumn([
  Text("Child"),
])
  ..mainStart();

Row

Add .asNiku on Row to convert to NikuRow.

Example usage:

Row(
  children: [
    Text("Child"),
  ],
)
  .asNiku()
  ..mainStart();

Equivalent to:

NikuRow([
  Text("Child"),
])
  ..mainStart();

Stack

Add .asNiku on Stack to convert to NikuStack.

Example usage:

Stack(
  children: [
    Text("Child"),
  ],
)
  .asNiku()
  ..mainStart();

Equivalent to:

NikuStack([
  Text("Child"),
])
  ..mainStart();

Wrap

Add .asNiku on Stack to convert to NikuWrap.

Example usage:

Wrap(
  children: [
    Text("Child"),
  ],
)
  .asNiku()
  ..start();

Equivalent to:

NikuStack([
  Text("Child"),
])
  ..start();