Skip to content

Commit

Permalink
🎉 feat - 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Mar 6, 2021
1 parent 85b2fe1 commit 022e22c
Show file tree
Hide file tree
Showing 23 changed files with 2,938 additions and 143 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
## [0.5.0]
Breaking Change
- Deprecated:
- FlatButton
- RaisedButton
- ElevatedButton
- Move `button.dart` to `oldButton.dart`
- Move `NikuButton` to `button.dart`
- Importing `package:niku/niku.dart` won't import `oldButton.dart`
- Only support Flutter 2.0.0 or newer

Feature:
- Add `NikuButton` for new building new universal Button including
- TextButton
- TextButton.icon
- ElevatedButton
- ElevatedButton.icon
- OutlinedButton
- OutlinedButton.icon

## [0.4.0] - 2021/3/4
Feature:
- Add support for Sound Null Safety of Flutter 2
- Only support Flutter 2.0.0 or newer

Refactor:
- Constructor to use `this` as parameter
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ Niku is style property builder for styling user interface inspired by SwiftUI.
- Niku extension for `Column`
- [Stack](https://github.com/saltyaom/niku/blob/main/doc/widget/stack.md)
- Niku extension for `Stack`
- [TextField](https://github.com/saltyaom/niku/blob/main/doc/widget/textfield.md)
- Niku extension for `TextFormField`
- [Button](https://github.com/saltyaom/niku/blob/main/doc/widget/button.md)
- Niku extension for `TextButton`, `ElevatedButton` and `OutlinedButton`
- [IconButton](https://github.com/saltyaom/niku/blob/main/doc/widget/iconButton.md)
- Niku extension for `IconButton`
- [Available Extension](https://github.com/saltyaom/niku/blob/main/doc/extension/README.md)
- [niku](https://github.com/saltyaom/niku/blob/main/doc/extension/niku.md)
- Add `.niku()` extension for widget

- Deprecated
- [FlatButton](https://github.com/saltyaom/niku/blob/main/doc/widget/flatButton.md)
- Niku extension for `FlatButton`
- [RaisedButton](https://github.com/saltyaom/niku/blob/main/doc/widget/raisedButton.md)
- Niku extension for `RaisedButton`
- [OutlineButton](https://github.com/saltyaom/niku/blob/main/doc/widget/outlineButton.md)
- Niku extension for `OutlineButton`
- [IconButton](https://github.com/saltyaom/niku/blob/main/doc/widget/iconButton.md)
- Niku extension for `IconButton`

- [Available Extension](https://github.com/saltyaom/niku/blob/main/doc/extension/README.md)
- [niku](https://github.com/saltyaom/niku/blob/main/doc/extension/niku.md)
- Add `.niku()` extension for widget

8 changes: 6 additions & 2 deletions doc/widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ Niku contains available Widget:
- Niku extension for `Stack`
- [TextField](https://github.com/saltyaom/niku/blob/main/doc/widget/textfield.md)
- Niku extension for `TextFormField`
- [Button](https://github.com/saltyaom/niku/blob/main/doc/widget/button.md)
- Niku extension for `TextButton`, `ElevatedButton` and `OutlinedButton`
- [IconButton](https://github.com/saltyaom/niku/blob/main/doc/widget/iconButton.md)
- Niku extension for `IconButton`

Deprecated Widget:
- [FlatButton](https://github.com/saltyaom/niku/blob/main/doc/widget/flatButton.md)
- Niku extension for `FlatButton`
- [RaisedButton](https://github.com/saltyaom/niku/blob/main/doc/widget/raisedButton.md)
- Niku extension for `RaisedButton`
- [OutlineButton](https://github.com/saltyaom/niku/blob/main/doc/widget/outlineButton.md)
- Niku extension for `OutlineButton`
- [IconButton](https://github.com/saltyaom/niku/blob/main/doc/widget/iconButton.md)
- Niku extension for `IconButton`

#### Also See [Available Extension](https://github.com/saltyaom/niku/blob/main/doc/extension/README.md)

Expand Down
14 changes: 1 addition & 13 deletions doc/widget/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ Style property builder for building Widget
##### [Table of Content](https://github.com/saltyaom/niku/blob/main/doc/widget/README.md)

### Example usage:
```
```dart
Niku(Container())
.background(Colors.blue)
.p(21)
.build()
```

### Prerequisite:
niku: >= 0.1.0

### Availability:
```dart
// All Widget
Expand Down Expand Up @@ -84,24 +81,15 @@ padding, p - Padding of container
- absorbPointer - Apply [AbsorbPointer] to widget
- tooltip - Add tooltip to widget
- transform - Add transform to widget

##### Prerequisite:
niku: >= 0.1.2
- material - Add [Material] to widget
- inkwell - Add [InkWell] to widget
- border - Decorate with border using [Border]

### Prerequisite:
niku: >= 0.3.0
- backdropFilter - Apply [BackdropFilter] to Widget
- positioned - Apply [Positioned] to widget
- scrollable, singleChildScrollView - Add [singleChildScrollView] to widget
- flex, flexible - Apply [Flexible] to Widget

### Event Listener
##### Prerequisite:
niku: >= 0.1.2

- 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
Expand Down
201 changes: 201 additions & 0 deletions doc/widget/button.md
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)
5 changes: 1 addition & 4 deletions doc/widget/column.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Style property builder for building `Column`
##### [Table of Content](https://github.com/saltyaom/niku/blob/main/doc/widget/README.md)

### Example usage:
```
```dart
NikuColumn([
Text("0"),
Text("1")
Expand All @@ -16,9 +16,6 @@ NikuColumn([
.build()
```

### Prerequisite:
niku: >= 0.1.0

### Availability:
```dart
// All Widget
Expand Down
11 changes: 5 additions & 6 deletions doc/widget/flatButton.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

Style property builder for building `FlatButton`

### 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
NikuFlatButton(Text("Flat Button"))
.color(Colors.blue)
.px(40)
Expand All @@ -15,17 +18,13 @@ NikuFlatButton(Text("Flat Button"))
.build()
```

### Prerequisite:
niku: >= 0.1.0

### Availability:
```dart
// All Widget
import 'package:niku/niku.dart';
// With relatated widget
// Prerequistited: niku >= 0.1.2
import 'package:niku/widget/button.dart';
import 'package:niku/widget/oldButton.dart';
// Just widget
import 'package:niku/widget/flatButton.dart';
Expand Down
5 changes: 1 addition & 4 deletions doc/widget/iconButton.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ Style property builder for building Raised Button
##### [Table of Content](https://github.com/saltyaom/niku/blob/main/doc/widget/README.md)

### Example usage:
```
```dart
NikuIconButton(Icon(Icons.edit))
.color(Colors.blue)
.p(40)
.build()
```

### Prerequisite:
niku: >= 0.1.2

### Availability:
```dart
// All Widget
Expand Down
Loading

0 comments on commit 022e22c

Please sign in to comment.