Skip to content

Commit be01828

Browse files
authored
v2.0.2 release (OnPressed Animation bug fix)
# 2.0.2 (10-11-2023) ## Release Highlights Performance and Bug Fixes. ### Changes - [x] fix: Reversed animation and onTap as seperate concepts in InkWell widget ### Closes - [x] closes #45
2 parents 92dd2f0 + a2aa20e commit be01828

4 files changed

Lines changed: 25 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 2.0.2 (10-11-2023)
2+
3+
## Release Highlights
4+
Performance and Bug Fixes.
5+
6+
### Changes
7+
- [x] fix: Reversed animation and onTap as seperate concepts in InkWell widget
8+
9+
### Closes
10+
- [x] closes #45
11+
112
# 2.0.1 (09-11-2023)
213

314
## Release Highlights

example/lib/main.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ class ScreenWidget extends StatelessWidget {
130130
buttonHeight: 60,
131131
buttonWidth: 100,
132132
enableAnimation: true,
133-
onPressed: () {
134-
debugPrint("Hello Neubrutalism");
135-
},
133+
onPressed: () => debugPrint("hello"),
136134
text: Text(
137135
"Start",
138136
style: GoogleFonts.robotoCondensed(

lib/src/widgets/buttons/_button.dart

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,21 @@ class NeuButtonState extends State<NeuButton>
138138
Widget build(BuildContext context) {
139139
return InkWell(
140140
onTap: () {
141+
var doOnPressedAction = () => {
142+
if (widget.onPressed != null) {widget.onPressed!()}
143+
};
144+
141145
if (widget.enableAnimation) {
146+
// do the on pressed action after the
147+
// first part of animation
142148
_controller.forward().then((value) {
143-
if (widget.onPressed != null) {
144-
widget.onPressed!();
145-
_controller.reverse();
146-
}
149+
doOnPressedAction();
150+
_controller.reverse();
147151
});
148-
} else if (widget.onPressed != null) {
149-
widget.onPressed!();
152+
} else {
153+
// do on pressed action without any
154+
// animation
155+
doOnPressedAction();
150156
}
151157
},
152158
child: AnimatedBuilder(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: A Flutter package that provides a set of Neubrutalism-style UI
55
maintainer: Deepraj Baidya <@deepraj02>
66
repository: https://github.com/deepraj02/neubrutalism_ui.git
77
issue_tracker: https://github.com/deepraj02/neubrutalism_ui/issues/
8-
version: 2.0.1
8+
version: 2.0.2
99

1010
environment:
1111
sdk: ">=2.19.0 <4.0.0"

0 commit comments

Comments
 (0)