Skip to content

Commit

Permalink
Fix called on null
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Jan 31, 2021
1 parent 97de153 commit a449b5d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.5.2] - 2021-01-31

* Fix `onPop` called on null
* Pass new "result" into `pop` method

## [0.5.1] - 2021-01-30

* `flutter format`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://github.com/nylo-core/framework"><img alt="GitHub stars" src="https://img.shields.io/github/stars/nylo-core/framework?style=plastic"></a>
</p>

## Nylo Framework (Beta v0.5.0)
## Nylo Framework (Beta v0.5.2)

Nylo is a micro-framework for Flutter which is designed to help simplify app development. Every project provides a simple bolierplate and MVC pattern to help you build apps easier.

Expand Down
8 changes: 4 additions & 4 deletions lib/widgets/ny_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ abstract class NyState<T extends StatefulWidget> extends State<T> {

widgetDidLoad() async {}

pop() {
Navigator.of(context).pop();
pop({dynamic result}) {
Navigator.of(context).pop(result);
}

routeTo(String routeName,
Expand All @@ -31,7 +31,7 @@ abstract class NyState<T extends StatefulWidget> extends State<T> {
Curve transitionCurve,
Map<String, dynamic> params,
CustomSailorTransition customTransition,
Function() onPop}) {
Function(dynamic value) onPop}) {
NyArgument nyArgument = NyArgument(data);
NyNavigator.instance.router
.navigate(
Expand All @@ -46,6 +46,6 @@ abstract class NyState<T extends StatefulWidget> extends State<T> {
params: params,
customTransition: customTransition,
)
.then((v) => onPop());
.then((v) => onPop != null ? onPop(v) : (v) {});
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nylo_framework
description: Micro-framework for Flutter that's built to simplify app development for Flutter projects.
version: 0.5.1
version: 0.5.2
homepage: https://nylo.dev
repository: https://github.com/nylo-core/framework
issue_tracker: https://github.com/nylo-core/framework/issues
Expand Down

0 comments on commit a449b5d

Please sign in to comment.