Skip to content
On this page

Comparison to Styled Widget

Niku and Styled Widget is almost the same.

Both provide you top-down styling widgets without nesting more parent.

The main difference between Niku and Styled Widget is that, Niku bothers re-implementing all other widgets to make it accepts cascade notation to make everything follows the same convention.

While Niku try to provide you to style all the widgets, Styled Widget only provide you: Parent, Icon, and Text.

Code Comparison

From Style Widget's "Japan Style" example

Styled Widget:

    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
    children: <Widget>[
    Text('ウエルカム') // Vertical text
    Styled.widget() // red circle
        .constrained(width: 200, height: 200)
            onTap: () => showBottomSheet(
                context: context,
                backgroundColor: Colors.transparent,
                builder: (context) => BottomSheet(),
).padding(vertical: 80)


    'ウエルカム'.n // Vertical text
        ..color = Color(0xff44517F)
        ..fontSize = 28
        ..w = 20,
    n.Box() // red circle
        ..size = [200, 200] = Color(0xffFF6160)
            tap: () => showBottomSheet(
                context: context,
                backgroundColor: Colors.transparent,
                builder: (context) => BottomSheet(),
    ..crossCenter = 80

Bottom Sheet

Styled Widget:

    mainAxisAlignment: MainAxisAlignment.end,
    children: <Widget>[
    Text('サインアップ') // button
        .padding(vertical: 15, horizontal: 30)
            color: Color(0xff41508D),
            borderRadius: BorderRadius.circular(35),
        .gestures(onTap: () => Navigator.pop(context)),
    Text('サインイン') // bottom description
        .padding(vertical: 30),
        height: 280,
        width: MediaQuery.of(context).size.width,
    .padding(all: 10)


    'サインアップ'.n // button
        ..color = Colors.white
        ..fontSize = 24 = 30 = 15 = Color(0xff41508D)
        ..n.rounded = 35
        ..on(tap: () => Navigator.pop(context)),
    'サインイン'.n // bottom description
        ..fontSize = 18
        ..color = Color(0xff455178)
        ..m = 30
    ..h = 280
    ..p = 10
    ..n.bgBlur = 20

Comparison Matrix

For a clear comparison, here's a comparison matrix for you to decide.

FeatureStyled WidgetNiku
ConventionFlutterTailwind, SwiftUI, Flutter
Composable widgetText, Icon, Parent30+ and expanding
Reusable Style✅ with Stylesheet
Responsive✅ useQuery, useScreen
Predefined UtilityLessMore
Automatic build
Platform Selector✅ with usePlatformSelector
TransitionBetterMore Verbose
Performance Tuning✅ Pseudo Constant
Learning CurveEasierA bit harder

Side note

Before settle down with which library to use, I highly recommended you to try Styled Widget first, because both library try to assist you with just the same thing but if you don't usually need to handle styling of "others" widget much, you most likely wants to go with Styled Widget.