-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
2,938 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
## Niku extension for Material Flat Button | ||
|
||
Niku extension for Material various Button | ||
Including: | ||
- TextButton | ||
- TextButton.icon | ||
- Elevated | ||
- Elevated.icon | ||
- OutlinedButton | ||
- OutlinedButton.icon | ||
|
||
### Deprecated API, use [NikuButton](https://github.com/saltyaom/niku/blob/main/doc/widget/button.md) instead | ||
|
||
##### [Table of Content](https://github.com/saltyaom/niku/blob/main/doc/widget/README.md) | ||
|
||
|
||
### Example usage: | ||
```dart | ||
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() | ||
``` | ||
|
||
### Availability: | ||
```dart | ||
// All Widget | ||
import 'package:niku/niku.dart'; | ||
// Just widget | ||
import 'package:niku/widget/oldButton.dart'; | ||
``` | ||
|
||
### Meta property list: | ||
- niku() - Switch to Niku() property | ||
- build(), textButton() - Build as [TextButton] | ||
- elevated() - Build as [ElevatedButton] | ||
- outlined() - Build as [OutlinedButton] | ||
- textButtonIcon() - Build as [TextButton.icon] | ||
- elevatedIcon() - Build as [ElevatedButton.icon] | ||
- outlinedIcon() - Build as [OutlinedButton.icon] | ||
- apply() - Apply existing NikuFlatButton's property to current style | ||
|
||
### 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] | ||
##### [Table of Content](https://github.com/saltyaom/niku/blob/main/doc/widget/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.