niku 0.1.1 niku: ^0.1.1 copied to clipboard
Property builder for styling Widget
Niku #
Property builder for styling Widget
Why #
Styling widget in Flutter is hard to maintain.
Since everything is a widget, a style property like Padding
, Align
, FractionallySizedBox
, Tooltip
is nested to compose a simple widget.
Niku
allow developer to style property using builder or SwiftUI modifier like
to compose styling.
By reducing the nested hell andbracket usage in Flutter which made styling Flutter widget more maintainable.
// Traditional Flutter
Center(
child: Tooltip(
message: "A Flat Button",
child: Padding(
padding: EdgeInsets.symmetric(vertical: 20)
child: FractionallySizedBox(
widthFactor: .7,
child: FlatButton(
onPressed: () {},
color: Colors.blue
child: Text(
"Flat Button",
style: const TextStyle(
fontSize: 21,
color: Colors.white
)
)
)
)
)
)
);
// Niku
NikuFlatButton(
NikuText("Flat Button")
.fontSize(21)
.color(Colors.blue)
.build()
)
.py(20)
.niku()
.fractionWidth(.7)
.tooltip("A Flat Button")
.center()
.build();
Getting Started #
Niku required no dependencies at all.
Starting by adding niku
to pubspec.yaml
:
dependencies:
flutter:
sdk: flutter
niku: 0.1.0
Then you're ready to create your awesome Flutter project with effortless styling!
Documentation #
Currently, Niku is experimental library for styling user interface.
Niku contains available Widget:
- Niku
- Niku base for styling widget
- NikuText
- Niku extension for
Text
- Niku extension for
- Column
- Niku extension for
Row
- Niku extension for
- Row
- Niku extension for
Column
- Niku extension for
- NikuTextField
- Niku extension for
TextFormField
- Niku extension for
- NikuFlatButton
- Niku extension for
FlatButton
- Niku extension for
- NikuRaisedButton
- Niku extension for
RaisedButton
- Niku extension for
- NikuOtlineButton
- Niku extension for
OutlineButton
- Niku extension for