Niku class

Niku Widget for styling widget

Style property builder for building Widget

Example usage:

Niku(Container())
  .background(Colors.blue)
  .p(21)
  .build()

Meta property list:

  • build() - Apply styles and build Widget
  • builder() - Add custom widget

Style property list: padding, p - Padding of container

  • padding, p - Apply padding to all side
  • px - Apply padding to x axis
  • py - Apply padding to y axis
  • pt - Apply padding top
  • pl - Apply padding left side
  • pb - Apply padding bottom
  • pl - Apply padding right side
  • margin, m - Margin of container
    • margin, m - Apply margin to all side
    • mx - Apply margin to x axis
    • my - Apply margin to y axis
    • mt - Apply margin top
    • ml - Apply margin left side
    • mb - Apply margin bottom
    • ml - Apply margin right side
  • align - Set self alignment
    • align - Accept Alignment to align self
    • topLeft - Apply widget to top-left
    • topCenter - Apply widget to top-center
    • topRight - Apply widget to top-right
    • centerLeft - Apply widget to center-left
    • center - Apply widget to center
    • centerRight - Apply widget to center-right
    • bottomLeft - Apply widget to bottom-left
    • bottomCenter - Apply widget to bottom-center
    • bottomRight - Apply widget to bottom-right
  • fullSize - Apply both full width and height to self
    • fullWidth - Apply full width to self
    • fullHeight - Apply full height to self
  • aspectRatio - Apply aspect ratio to self
  • expanded - Apply exapnded to self
  • fractionSize, sizePercent - Set both width and height in percent
    • fractionWidth, widthPercent - Set width in percent
    • fractionHeight, heightPercent - Set height in percent
  • container - Add new container to widget
  • constraints - Set minimum and maximum size for widget
    • maxSize - Set widget both max width and height
      • maxWidth - Set widget max width
      • maxHeight - Set Widget max height
    • minSize - Set widget both min width and height
      • minWidth - Set widget min width
      • minHeight - Set Widget min height
  • size - Set size of widget
    • width - Set width of widget
    • height - Set height of widget
  • fitted - Apply FittedBox to widget
  • background, bg - Apply background to widget
  • opacity - Apply opacity to widget
  • rounded - Add border radius to widget
  • boxDecoration - Apply BoxDecoration to widget
  • heroTag - Apply Hero to widget
  • ignorePointer - Apply IgnorePointer to widget
  • absorbPointer - Apply AbsorbPointer to widget
  • tooltip - Add tooltip to widget
  • transform - Add transform to widget
  • material - Add Material to widget
  • inkwell - Add InkWell to widget
  • border - Decorate with border using Border
  • backdropFilter - Apply BackdropFilter to Widget
  • positioned - Apply Positioned to widget
  • scrollable, singleChildScrollView - Add singleChildScrollView to widget
  • flex, flexible - Apply Flexible to Widget
  • shadows - Add shadows to widget
  • semantics - Add semantic to widget

Animation & Motion

  • animated, animatedBuilder - Wrap widget in animated builder
  • animatedContainer - Wrap widget in AnimatedContainer

Event Listener

  • on - Add multiple event listener at once
    • tapDown - This is called after a short timeout, even if the winning gesture has not yet been selected. If the tap gesture wins, onTapUp will be called, otherwise onTapCancel will be called
    • tapUp - This triggers immediately before onTap in the case of the tap gesture winning. If the tap gesture did not win, onTapCancel is called instead
    • tap - This triggers when the tap gesture wins. If the tap gesture did not win, onTapCancel is called instead
    • tapCancel - This is called after onTapDown, and instead of onTapUp and onTap, if the tap gesture did not win
    • secondaryTab - This triggers when the tap gesture wins. If the tap gesture did not win, onSecondaryTapCancel is called instead
    • secondaryTapDown - This is called after a short timeout, even if the winning gesture has not yet been selected. If the tap gesture wins, onSecondaryTapUp will be called, otherwise onSecondaryTapCancel will be called
    • secondaryTapUp - This triggers in the case of the tap gesture winning. If the tap gesture did not win, onSecondaryTapCancel is called instead
    • secondaryTapCancel - The pointer that previously triggered onDoubleTapDown will not end up causing a double tap
    • tertiaryTapDown - Triggered immediately after the down event of the second tap
    • tertiaryTapUp - This triggers in the case of the tap gesture winning. If the tap gesture did not win, onTertiaryTapCancel is called instead
    • tertiaryTapCancel - This is called after onTertiaryTapDown, and instead of onTertiaryTapUp, if the tap gesture did not win
    • doubleTapDown - Triggered immediately after the down event of the second tap
    • doubleTap - The user has tapped the screen with a primary button at the same location twice in quick succession
    • doubleTapCancel - The pointer that previously triggered onDoubleTapDown will not end up causing a double tap
    • longPress - Triggered when a pointer has remained in contact with the screen at the same location for a long period of time
    • longPressStart - Triggered when a pointer has remained in contact with the screen at the same location for a long period of time
    • longPressMoveUpdate - A pointer has been drag-moved after a long press with a primary button
    • longPressUp - A pointer that has triggered a long-press with a primary button has stopped contacting the screen
    • longPressEnd - A pointer that has triggered a long-press with a primary button has stopped contacting the screen
    • secondaryLongPress - Triggered when a pointer has remained in contact with the screen at the same location for a long period of time
    • secondaryLongPressStart - Triggered when a pointer has remained in contact with the screen at the same location for a long period of time
    • secondaryLongPressMoveUpdate - A pointer has been drag-moved after a long press with a secondary button
    • secondaryLongPressUp - A pointer that has triggered a long-press with a secondary button has stopped contacting the screen
    • secondaryLongPressEnd - A pointer that has triggered a long-press with a secondary button has stopped contacting the screen
    • verticalDragDown - A pointer has contacted the screen with a primary button and might begin to move vertically
    • verticalDragStart - A pointer has contacted the screen with a primary button and has begun to move vertically
    • verticalDragUpdate - A pointer that is in contact with the screen with a primary button and moving vertically has moved in the vertical direction
    • verticalDragEnd - A pointer that was previously in contact with the screen with a primary button and moving horizontally is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen
    • verticalDragCancel - The pointer that previously triggered onHorizontalDragDown did not complete
    • horizontalDragDown - A pointer has contacted the screen with a primary button and might begin to move horizontally
    • horizontalDragStart - A pointer has contacted the screen with a primary button and has begun to move horizontally
    • horizontalDragUpdate - A pointer that is in contact with the screen with a primary button and moving horizontally has moved in the horizontal direction
    • horizontalDragEnd - A pointer that is in contact with the screen with a primary button and moving horizontally has moved in the horizontal direction
    • horizontalDragCancel - The pointer that previously triggered onHorizontalDragDown did not complete
    • forcePressStart - The pointer is in contact with the screen and has pressed with sufficient force to initiate a force press. The amount of force is at least ForcePressGestureRecognizer.startPressure
    • forcePressPeak - The pointer is in contact with the screen and has pressed with the maximum force. The amount of force is at least ForcePressGestureRecognizer.peakPressure
    • forcePressUpdate - A pointer is in contact with the screen, has previously passed the ForcePressGestureRecognizer.startPressure and is either moving on the plane of the screen, pressing the screen with varying forces or both simultaneously
    • forcePressEnd - The pointer is no longer in contact with the screen
    • panDown - A pointer has contacted the screen with a primary button and might begin to move
    • panStart - A pointer has contacted the screen with a primary button and has begun to move
    • panUpdate - A pointer that is in contact with the screen with a primary button and moving has moved again
    • panEnd - A pointer that was previously in contact with the screen with a primary button and moving is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen
    • panCancel - The pointer that previously triggered onPanDown did not complete
    • scaleStart - The pointers in contact with the screen have established a focal point and initial scale of 1.0
    • scaleUpdate - The pointers in contact with the screen have indicated a new focal point and/or scale
    • scaleEnd - The pointers are no longer in contact with the screen
Available extensions

Constructors

Niku([Widget widget = const SizedBox.shrink()])
Niku Widget for styling widget

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

absorbPointer(bool absorbing) Niku

Available on Niku, provided by the BaseProperty extension

Apply AbsorbPointer to widget
align(AlignmentGeometry align) Niku

Available on Niku, provided by the BaseProperty extension

Apply alignment to widget
animated({required Widget builder(BuildContext context, Widget child), required AnimationController animation}) Niku

Available on Niku, provided by the BaseProperty extension

Wrap widget in animated builder
animatedBuilder({required Widget builder(BuildContext context, Widget child), required AnimationController animation}) Niku

Available on Niku, provided by the BaseProperty extension

Wrap widget in animated builder
animatedContainer({Alignment? alignment, EdgeInsets? padding, Color? color, Decoration? decoration, BoxDecoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsets? margin, Matrix4? transform, AlignmentGeometry? transformAlignment, Clip clipBehavior = Clip.none, Curve curve = Curves.linear, required Duration duration, VoidCallback? onEnd}) Niku

Available on Niku, provided by the BaseProperty extension

Wrap widget in animated container
aspectRatio(double aspectRatio) Niku

Available on Niku, provided by the BaseProperty extension

Apply aspect ratio to self
backdropFilter(ImageFilter filter) Niku

Available on Niku, provided by the BaseProperty extension

Add backdrop filter to widget
backgroundColor(Color color) Niku

Available on Niku, provided by the BaseProperty extension

Apply background to widget
bg(Color color) Niku

Available on Niku, provided by the BaseProperty extension

Apply background to widget
border(Border border) Niku

Available on Niku, provided by the BaseProperty extension

Decorate with border using Border
bottomCenter() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to bottom center
bottomLeft() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to bottom left
bottomRight() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to bottom right
boxDecoration(BoxDecoration boxDecoration) Niku

Available on Niku, provided by the BaseProperty extension

Apply BoxDecoration to widget
build() Widget
Apply styles and build Widget
builder(Widget builder(Widget child)) Niku
Add custom widget
center() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to center
centerLeft() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to center left
centerRight() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to center right
constraints(BoxConstraints constraints) Niku

Available on Niku, provided by the BaseProperty extension

Set minimum and maximum size for widget
container() Niku

Available on Niku, provided by the BaseProperty extension

Add new container to widget
expanded([int flex = 1]) Niku

Available on Niku, provided by the BaseProperty extension

Apply expanded to self
fitted() Niku

Available on Niku, provided by the BaseProperty extension

Apply FittedBox for widget
flex([int flex = 1]) Niku

Available on Niku, provided by the BaseProperty extension

Apply Flexible to widget
flexible([int flex = 1]) Niku

Available on Niku, provided by the BaseProperty extension

Apply Flexible to widget
fractionHeight(double fraction) Niku

Available on Niku, provided by the BaseProperty extension

Set height in percent
fractionSize(double width, double height) Niku

Available on Niku, provided by the BaseProperty extension

Set both width and height in percent
fractionWidth(double fraction) Niku

Available on Niku, provided by the BaseProperty extension

Set width in percent
fullHeight() Niku

Available on Niku, provided by the BaseProperty extension

Apply full width to self
fullSize() Niku

Available on Niku, provided by the BaseProperty extension

Apply both full width and height to self
fullWidth() Niku

Available on Niku, provided by the BaseProperty extension

Apply full width to self
height(double height) Niku

Available on Niku, provided by the BaseProperty extension

Set height of Widget
heightPercent(double percent) Niku

Available on Niku, provided by the BaseProperty extension

Set height in percent
heroTag(String heroTag) Niku

Available on Niku, provided by the BaseProperty extension

Apply Hero to widget
ignorePointer(bool ignoring) Niku

Available on Niku, provided by the BaseProperty extension

Apply IgnorePointer to widget
inkwell({Color? hover, Color? focus, Color? highlight, Color? splash, double? radius, bool autofocus = false, VoidCallback? onTap}) Niku

Available on Niku, provided by the BaseProperty extension

Add InkWell to widget
m(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to all side
margin(EdgeInsets margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin using EdgeInsets
material({double elevation = 0, Color? color, Color? shadowColor}) Niku

Available on Niku, provided by the BaseProperty extension

Add Material to widget
maxHeight(double maxHeight) Niku

Available on Niku, provided by the BaseProperty extension

Set maximum height for widget
maxSize(double maxWidth, double maxHeight) Niku

Available on Niku, provided by the BaseProperty extension

Set maximum size for widget
maxWidth(double maxWidth) Niku

Available on Niku, provided by the BaseProperty extension

Set maximum width for widget
mb(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to bottom
minHeight(double minHeight) Niku

Available on Niku, provided by the BaseProperty extension

Set minimum height for widget
minSize(double minWidth, double minHeight) Niku

Available on Niku, provided by the BaseProperty extension

Set minimum size for widget
minWidth(double minWidth) Niku

Available on Niku, provided by the BaseProperty extension

Set minimum width for widget
ml(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to left side
mr(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to right side
mt(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to top
mx(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to x axis
my(double margin) Niku

Available on Niku, provided by the BaseProperty extension

Apply margin to y axis
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on({void tapDown(TapDownDetails)?, void tapUp(TapUpDetails)?, VoidCallback? tap, VoidCallback? tapCancel, VoidCallback? secondaryTap, void secondaryTapDown(TapDownDetails)?, void secondaryTapUp(TapUpDetails)?, VoidCallback? secondaryTapCancel, void tertiaryTapDown(TapDownDetails)?, void tertiaryTapUp(TapUpDetails)?, VoidCallback? tertiaryTapCancel, void doubleTapDown(TapDownDetails)?, VoidCallback? doubleTap, VoidCallback? doubleTapCancel, VoidCallback? longPress, void longPressStart(LongPressStartDetails)?, void longPressMoveUpdate(LongPressMoveUpdateDetails)?, VoidCallback? longPressUp, void longPressEnd(LongPressEndDetails)?, VoidCallback? secondaryLongPress, void secondaryLongPressStart(LongPressStartDetails)?, void secondaryLongPressMoveUpdate(LongPressMoveUpdateDetails)?, VoidCallback? secondaryLongPressUp, void secondaryLongPressEnd(LongPressEndDetails)?, void verticalDragDown(DragDownDetails)?, void verticalDragStart(DragStartDetails)?, void verticalDragUpdate(DragUpdateDetails)?, void verticalDragEnd(DragEndDetails)?, VoidCallback? verticalDragCancel, void horizontalDragDown(DragDownDetails)?, void horizontalDragStart(DragStartDetails)?, void horizontalDragUpdate(DragUpdateDetails)?, void horizontalDragEnd(DragEndDetails)?, VoidCallback? horizontalDragCancel, void forcePressStart(ForcePressDetails)?, void forcePressPeak(ForcePressDetails)?, void forcePressUpdate(ForcePressDetails)?, void forcePressEnd(ForcePressDetails)?, void panDown(DragDownDetails)?, void panStart(DragStartDetails)?, void panUpdate(DragUpdateDetails)?, void panEnd(DragEndDetails)?, VoidCallback? panCancel, void scaleStart(ScaleStartDetails)?, void scaleUpdate(ScaleUpdateDetails)?, void scaleEnd(ScaleEndDetails)?}) Niku

Available on Niku, provided by the BaseProperty extension

Event Listener
opacity(double opacity) Niku

Available on Niku, provided by the BaseProperty extension

Apply opacity to widget
p(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to all side
padding(EdgeInsets padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding using EdgeInsets
pb(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to bottom
pl(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to left side
positioned({double? top, double? left, double? bottom, double? right}) Niku

Available on Niku, provided by the BaseProperty extension

Add Positioned to widget
pr(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to right side
pt(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to top
px(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to x axis
py(double padding) Niku

Available on Niku, provided by the BaseProperty extension

Apply padding to y axis
rounded([double borderRadius = 999999]) Niku

Available on Niku, provided by the BaseProperty extension

Apply border radius to widget
scrollable({ScrollController? controller, Axis scrollDirection = Axis.vertical, bool? primary, bool reverse = false, ScrollPhysics? scrollPhysics, DragStartBehavior dragStartBehavior = DragStartBehavior.start, String? restorationId}) Niku

Available on Niku, provided by the BaseProperty extension

Add singleChildScrolLView to widget
semantics({bool container = false, bool explicitChildNodes = false, bool excludeSemantics = false, bool? enabled, bool? checked, bool? selected, bool? toggled, bool? button, bool? slider, bool? link, bool? header, bool? textField, bool? readOnly, bool? focusable, bool? focused, bool? inMutuallyExclusiveGroup, bool? obscured, bool? multiline, bool? scopesRoute, bool? namesRoute, bool? hidden, bool? image, bool? liveRegion, int? maxValueLength, int? currentValueLength, String? label, String? value, String? increasedValue, String? decreasedValue, String? hint, String? onTapHint, String? onLongPressHint, TextDirection? textDirection, SemanticsSortKey? sortKey, SemanticsTag? tagForChildren, VoidCallback? onTap, VoidCallback? onLongPress, VoidCallback? onScrollLeft, VoidCallback? onScrollRight, VoidCallback? onScrollUp, VoidCallback? onScrollDown, VoidCallback? onIncrease, VoidCallback? onDecrease, VoidCallback? onCopy, VoidCallback? onCut, VoidCallback? onPaste, VoidCallback? onDismiss, MoveCursorHandler? onMoveCursorForwardByCharacter, MoveCursorHandler? onMoveCursorBackwardByCharacter, SetSelectionHandler? onSetSelection, VoidCallback? onDidGainAccessibilityFocus, VoidCallback? onDidLoseAccessibilityFocus, Map<CustomSemanticsAction, VoidCallback>? customSemanticsActions}) Niku

Available on Niku, provided by the BaseProperty extension

Add semantic to widget
shadows(List<BoxShadow> shadows) Niku

Available on Niku, provided by the BaseProperty extension

Add shadows to widget
singleChildScrollView({ScrollController? controller, Axis scrollDirection = Axis.vertical, bool? primary, bool reverse = false, ScrollPhysics? scrollPhysics, DragStartBehavior dragStartBehavior = DragStartBehavior.start, String? restorationId}) Niku

Available on Niku, provided by the BaseProperty extension

Add singleChildScrolLView to widget
size(double width, double height) Niku

Available on Niku, provided by the BaseProperty extension

Set height of Widget
sizePercent(double width, double height) Niku

Available on Niku, provided by the BaseProperty extension

Set height in percent
tooltip(String tip) Niku

Available on Niku, provided by the BaseProperty extension

Apply tooltip to widget
topCenter() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to top center
topLeft() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to top left
topRight() Niku

Available on Niku, provided by the BaseProperty extension

Apply widget to top right
toString() String
A string representation of this object.
inherited
transform(Matrix4 transform) Niku

Available on Niku, provided by the BaseProperty extension

Apply transform to widget
width(double width) Niku

Available on Niku, provided by the BaseProperty extension

Set width of widget
widthPercent(double percent) Niku

Available on Niku, provided by the BaseProperty extension

Set width in percent

Operators

operator ==(Object other) bool
The equality operator.
inherited