NikuButton class

Niku extension for Material various Button Including:

  • TextButton
  • TextButton.icon
  • Elevated
  • Elevated.icon
  • OutlinedButton
  • OutlinedButton.icon

Style property builder for building Flat Button

Example usage:

NikuButton(Text("Flat Button"))
  .bg(Colors.blue)
  .px(40)
  .py(20)
  .rounded(8)
  .my(8)
  .build()

NikuButton(Text("Flat Button"))
  .bg(Colors.blue)
  .px(40)
  .py(20)
  .rounded(8)
  .my(8)
  .elevated()

Meta property list:

Style Property list:

  • onPressed - Callback when button is pressed
  • onLongPressed - Callback when button is long pressed
  • padding, p - Padding of container
    • padding, p - apply padding to all side
    • px - apply padding to x axis
    • py - apply padding y axis
    • pt - apply padding top side
    • pl - apply padding left side
    • pb - apply padding bottom side
    • pl - apply padding right side
  • margin, m - Padding of container
    • margin, m - apply margin to all side
    • mx - apply margin to x axis
    • my - apply margin y axis
    • mt - apply margin top side
    • ml - apply margin left side
    • mb - apply margin bottom side
    • ml - apply margin right side
  • backgroundColor, bg - Apply color to background
    • bg - Shorten form for applying to all button state
    • highlight - Apply highlight color
    • backgroundColor
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • foregroundColor, fg - Apply color to foreground (ie. Text color)
    • fg - Shorten form for applying to all button state
    • foregroundColor
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • overlay, splash, overlayColor - Apply color to splash (ripple effect)
    • overlay, splash - Shorten form for applying to all button state
    • overlayColor
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • shadow, shadowColor - Apply color to shadow of ElevatedButton
    • shadow - Shorten form for applying to all button state
    • shadowColor
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • elevation - Apply elevation to button
    • base
    • disabled
    • dragged
    • error
    • hovered
    • pressed
    • selected
  • borderSide, b - Apply styling to border
    • b - Shorten form for applying to all button state
    • border
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • borderWidth, bw - Apply width to border
    • bw - Shorten form for applying to all button state
    • borderWidth
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • borderColor, bc - Apply color to border
    • bc - Shorten form for applying to all button state
    • borderColor
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • borderStyle, bs - Apply BorderStyle to border
    • bs - Shorten form for applying to all button state
    • borderStyle
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • shape, s - Apply shape to button
    • s - Shorten form for applying to all button state
    • shape
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • cursor, mouseCursor - Apply cursor to border
    • cursor, mouseCursor
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • clip - Apply clip to button
  • autofocus - Determine whether button should be auto focus
  • cursor - Set cursor when hovered on widget
  • minSize, minimumSize - Set minimum size of button
    • minSize - Shorten form for applying to all button state
    • minimumSize
      • base
      • disabled
      • dragged
      • error
      • hovered
      • pressed
      • selected
  • animationDuration, duration - Animaiton Duration of elevation effect
  • focusNode - An object that can be used by a stateful widget to obtain the keyboard focus and to handle keyboard events
  • visualDensity - Defines the visual density of user interface components
  • tapTargetSize - Configures the tap target and layout size of certain Material widgets
  • rounded - Apply border radius to button, will override shape
  • label - Add label to IconButton

Constructors

NikuButton(Widget child)
Niku extension for Material various Button Including:

Properties

child Widget
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

align(Alignment align) NikuButton
Apply alignment to widget
alignment(Alignment align) NikuButton
Apply alignment to widget
animationDuration(Duration duration) NikuButton
Animaiton Duration of elevation effect
apply(NikuButton instance) NikuButton
Apply existing NikuButton's property to current style
autofocus(bool autofocus) NikuButton
Determine whether button should be auto focus
b(BorderSide input) NikuButton
Apply styling to border
backgroundColor({Color? base, Color? disabled, Color? dragged, Color? error, Color? focused, Color? hovered, Color? pressed, Color? selected}) NikuButton
Apply color to background
bc(Color color) NikuButton
Apply styling to border color
bg(Color color) NikuButton
Apply color to background
borderColor({Color base = Colors.black12, Color disabled = Colors.black12, Color dragged = Colors.black12, Color error = Colors.black12, Color focused = Colors.black12, Color hovered = Colors.black12, Color pressed = Colors.black12, Color selected = Colors.black12}) NikuButton
Apply styling to border color
borderSide({BorderSide? base, BorderSide? disabled, BorderSide? dragged, BorderSide? error, BorderSide? focused, BorderSide? hovered, BorderSide? pressed, BorderSide? selected}) NikuButton
Apply styling to border
borderStyle({BorderStyle base = BorderStyle.solid, BorderStyle disabled = BorderStyle.solid, BorderStyle dragged = BorderStyle.solid, BorderStyle error = BorderStyle.solid, BorderStyle focused = BorderStyle.solid, BorderStyle hovered = BorderStyle.solid, BorderStyle pressed = BorderStyle.solid, BorderStyle selected = BorderStyle.solid}) NikuButton
Apply BorderStyle to border
borderWidth({double base = 1, double disabled = 1, double dragged = 1, double error = 1, double focused = 1, double hovered = 1, double pressed = 1, double selected = 1}) NikuButton
Apply styling to border width
bottomCenter() NikuButton
Apply widget to bottom center
bottomLeft() NikuButton
Apply widget to bottom left
bottomRight() NikuButton
Apply widget to bottom right
bs(BorderStyle style) NikuButton
Apply BorderStyle to border
build({Key? key}) Widget
Apply styles and build as TextButton
bw(double width) NikuButton
Apply styling to border width
center() NikuButton
Apply widget to center
centerLeft() NikuButton
Apply widget to center left
centerRight() NikuButton
Apply widget to center right
clip(Clip clip) NikuButton
Apply clip to button
cursor({MouseCursor? base, MouseCursor? disabled, MouseCursor? dragged, MouseCursor? error, MouseCursor? focused, MouseCursor? hovered, MouseCursor? pressed, MouseCursor? selected}) NikuButton
Set cursor when hovered on widget
duration(Duration duration) NikuButton
Animaiton Duration of elevation effect
elevated({Key? key}) Widget
Apply styles and build as ElevatedButton
elevatedIcon({Key? key}) Widget
Apply styles and build as ElevatedButton
elevation({double? base, double? disabled, double? dragged, double? error, double? focused, double? hovered, double? pressed, double? selected}) NikuButton
Apply elevation to button
fg(Color base) NikuButton
Apply color to foreground (ie. Text color)
focusNode(FocusNode focusNode) NikuButton
An object that can be used by a stateful widget to obtain the keyboard focus and to handle keyboard events
foregroundColor({Color? base, Color? disabled, Color? dragged, Color? error, Color? focused, Color? hovered, Color? pressed, Color? selected}) NikuButton
Apply color to foreground (ie. Text color)
highlight(Color highlight) NikuButton
Apply highlight color
immediate() NikuButton
Immediate animation
label(Widget label) NikuButton
Add label to IconButton
m(double margin) NikuButton
Apply margin to top
margin(EdgeInsets padding) NikuButton
Apply margin using EdgeInset
mb(double margin) NikuButton
Apply margin to bottom
minimumSize(Size? base, Size? disabled, Size? dragged, Size? error, Size? focused, Size? hovered, Size? pressed, Size? selected) NikuButton
Apply custom shape to button
minSize(Size input) NikuButton
Set minimum size of button
ml(double margin) NikuButton
Apply margin to left side
mouseCursor({MouseCursor? base, MouseCursor? disabled, MouseCursor? dragged, MouseCursor? error, MouseCursor? focused, MouseCursor? hovered, MouseCursor? pressed, MouseCursor? selected}) NikuButton
Set cursor when hovered on widget
mr(double margin) NikuButton
Apply margin to right side
mt(double margin) NikuButton
Apply margin to top
mx(double margin) NikuButton
Apply margin to x axis
my(double margin) NikuButton
Apply margin to y axis
niku({Key? key}) Niku
Switch to Niku() property as TextButton
nikuElevated({Key? key}) Niku
Switch to Niku() property as ElevatedButton
nikuElevatedIcon({Key? key}) Niku
Switch to Niku() property as ElevatedButton.icon
nikuOutlined({Key? key}) Niku
Switch to Niku() property as OutlinedButton
nikuOutlinedIcon({Key? key}) Niku
Switch to Niku() property as OutlinedButton.icon
nikuTextButton({Key? key}) Niku
Switch to Niku() property as TextButton
nikuTextButtonIcon({Key? key}) Niku
Switch to Niku() property as TextButton.icon
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onLongPressed(VoidCallback callback) NikuButton
Callback when button is long pressed
onPressed(VoidCallback callback) NikuButton
Callback when button is pressed
outlined({Key? key}) Widget
Apply styles and build as OutlinedButton
outlinedIcon({Key? key}) Widget
Apply styles and build as OutlinedButton
overlay(Color base) NikuButton
Apply color to splash (ripple effect)
overlayColor({Color? base, Color? disabled, Color? dragged, Color? error, Color? focused, Color? hovered, Color? pressed, Color? selected}) NikuButton
Apply color to button background
p(double padding) NikuButton
Apply padding to all side
padding(EdgeInsets padding) NikuButton
Apply padding using EdgeInset
pb(double padding) NikuButton
Apply padding to bottom
pl(double padding) NikuButton
Apply padding to left side
pr(double padding) NikuButton
Apply padding to right
pt(double padding) NikuButton
Apply padding to top
px(double padding) NikuButton
Apply padding to x axis
py(double padding) NikuButton
Apply padding to y axis
rounded([double radius = 999999]) NikuButton
Apply border radius to button, will override shape
s(RoundedRectangleBorder input) NikuButton
Apply custom shape to button
set({VoidCallback? onPressed, VoidCallback? onLongPressed, FocusNode? focusNode, bool autofocus = false, Clip clipBehavior = Clip.none, NikuMaterialPropertyContainer<Color>? backgroundColor, NikuMaterialPropertyContainer<Color>? foregroundColor, NikuMaterialPropertyContainer<Color>? overlayColor, NikuMaterialPropertyContainer<Color>? shadowColor, NikuMaterialPropertyContainer<double>? elevation, double pt = 0, double pb = 0, double pl = 0, double pr = 0, double mt = 0, double mb = 0, double ml = 0, double mr = 0, NikuMaterialPropertyContainer<Size>? minimumSize, NikuMaterialPropertyContainer<BorderSide>? side, NikuMaterialPropertyContainer<RoundedRectangleBorder>? shape, NikuMaterialPropertyContainer<MouseCursor>? mouseCursor, VisualDensity? visualDensity, MaterialTapTargetSize? tapTargetSize, Duration? animationDuration, bool enableFeedback = false, AlignmentGeometry? alignment, Widget? label}) NikuButton
shadow(Color base) NikuButton
Apply color to shadow of ElevatedButton
shadowColor({Color? base, Color? disabled, Color? dragged, Color? error, Color? focused, Color? hovered, Color? pressed, Color? selected}) NikuButton
Apply color to shadow of ElevatedButton
shape({RoundedRectangleBorder? base, RoundedRectangleBorder? disabled, RoundedRectangleBorder? dragged, RoundedRectangleBorder? error, RoundedRectangleBorder? focused, RoundedRectangleBorder? hovered, RoundedRectangleBorder? pressed, RoundedRectangleBorder? selected}) NikuButton
Apply custom shape to button
splash(Color base) NikuButton
Apply color to splash (ripple effect)
tapTargetSize(MaterialTapTargetSize tapTargetSize) NikuButton
Configures the tap target and layout size of certain Material widgets
textButton({Key? key}) Widget
Apply styles and build as TextButton
textButtonIcon({Key? key}) Widget
Apply styles and build as TextButton
topCenter() NikuButton
Apply widget to top center
topLeft() NikuButton
Apply widget to top left
topRight() NikuButton
Apply widget to top right
toString() String
A string representation of this object.
inherited
visualDensity(FocusNode focusNode) NikuButton
Defines the visual density of user interface components. Equivalent to

Operators

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