NikuFlatButton class
Niku extension for Material Flat Button
Style property builder for building Flat Button
Example usage:
NikuFlatButton(Text("Flat Button"))
.color(Colors.blue)
.px(40)
.py(20)
.rounded(8)
.my(8)
.build()
Meta property list:
- niku() - Switch to Niku() property
- build() - Apply styles and build FlatButton as Widget
- base() - Apply styles and build only base of FlatButton as Widget
- apply() - Apply existing NikuFlatButton's property to current style
- style() - Apply existing NikuFlatButton's property to current style and build
- styleBase() - Apply existing NikuFlatButton's property to current style and build only base
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
- alignment, align - Set text 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
- setColor - Apply color to all button property
- setColor - Apply all color property using named property
- bg, color - Apply color to button background
- disabled - Background color of button when disabled
- hover - Background color of button when hovered
- focus - Background color of button when focused
- highlight - Background color of button when highlighted
- splash - Splash/Ripple color of button
- textColor - Set text color of button, won't override existing color
- colorBrightness - Set brightness of background
- shape - Apply custom shape to button
- clip - Apply clip to button
- minWidth - Set min width of button
- height - Set height of button
- autofocus - Determine whether button should be auto focus
- theme - Apply style to button using existing theme
- rounded - Apply border radius to button, will override shape
Constructors
- NikuFlatButton(Widget child)
- Niku extension for Material Flat Button
Properties
Methods
-
apply(
NikuFlatButton instance) → NikuFlatButton - Apply existing NikuFlatButton's property to current style
-
autofocus(
bool autofocus) → NikuFlatButton - Determine whether button should be auto focus
-
base(
{Key? key}) → Widget - Apply styles and build only base of FlatButton as Widget
-
bg(
Color color) → NikuFlatButton - Apply color to button background
-
brightness(
Brightness brightness) → NikuFlatButton - Set brightness of background
-
build(
{Key? key}) → Widget - Apply styles and build FlatButton as Widget
-
clip(
Clip clip) → NikuFlatButton - Apply clip to button
-
color(
Color color) → NikuFlatButton - Apply color to button background
-
disabled(
Color color) → NikuFlatButton - Background color of button when disabled
-
focus(
Color color) → NikuFlatButton - Background color of button when focused
-
height(
double height) → NikuFlatButton - Set height of button
-
highlight(
Color color) → NikuFlatButton - Background color of button when highlighted
-
hover(
Color color) → NikuFlatButton - Background color of button when hovered
-
m(
double margin) → NikuFlatButton - Apply margin to top
-
margin(
EdgeInsets padding) → NikuFlatButton -
Apply margin using
EdgeInset
-
mb(
double margin) → NikuFlatButton - Apply margin to bottom
-
minWidth(
double minWidth) → NikuFlatButton - Set min width of button
-
ml(
double margin) → NikuFlatButton - Apply margin to left side
-
mr(
double margin) → NikuFlatButton - Apply margin to right side
-
mt(
double margin) → NikuFlatButton - Apply margin to top
-
mx(
double margin) → NikuFlatButton - Apply margin to x axis
-
my(
double margin) → NikuFlatButton - Apply margin to y axis
-
niku(
) → Niku - Switch to Niku() property
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onLongPressed(
VoidCallback callback) → NikuFlatButton - Callback when button is long pressed
-
onPressed(
VoidCallback callback) → NikuFlatButton - Callback when button is pressed
-
p(
double padding) → NikuFlatButton - Apply padding to all side
-
padding(
EdgeInsets padding) → NikuFlatButton -
Apply padding using
EdgeInset
-
pb(
double padding) → NikuFlatButton - Apply padding to bottom
-
pl(
double padding) → NikuFlatButton - Apply padding to left side
-
pr(
double padding) → NikuFlatButton - Apply padding to right
-
pt(
double padding) → NikuFlatButton - Apply padding to top
-
px(
double padding) → NikuFlatButton - Apply padding to x axis
-
py(
double padding) → NikuFlatButton - Apply padding to y axis
-
rounded(
[double radius = 999999]) → NikuFlatButton - Apply border radius to button, will override shape
-
set(
{VoidCallback? onPressed, VoidCallback? onLongPressed, double pt = 0, double pb = 0, double pl = 0, double pr = 0, double mt = 0, double mb = 0, double ml = 0, double mr = 0, Color? color, Color? disabledColor, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, Color? textColor, Brightness? colorBrightness, ShapeBorder? shape, Clip clipBehavior = Clip.antiAlias, double? height, bool autofocus = false, double? minWidth, ButtonTextTheme? buttonTextTheme}) → NikuFlatButton -
setColor(
{Color? color, Color? disabled, Color? focus, Color? hover, Color? highlight, Color? splash}) → NikuFlatButton - Apply all color property using named property
-
shape(
ShapeBorder shape) → NikuFlatButton - Apply custom shape to button
-
splash(
Color color) → NikuFlatButton - Splash/Ripple color of button
-
style(
NikuFlatButton instance) → Widget - Apply existing NikuFlatButton's property to current style and build
-
styleBase(
NikuFlatButton instance) → Widget - Apply existing NikuFlatButton's property to current style and build only base
-
textColor(
Color color) → NikuFlatButton - Set text color of button, won't override existing color
-
theme(
ButtonTextTheme theme) → NikuFlatButton - Apply style to button using existing theme
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited