From a449b5da939530da941471b4dfb1ae47f3968f7a Mon Sep 17 00:00:00 2001
From: Anthony
Date: Sun, 31 Jan 2021 10:39:56 +0000
Subject: [PATCH] Fix called on null
---
CHANGELOG.md | 5 +++++
README.md | 2 +-
lib/widgets/ny_state.dart | 8 ++++----
pubspec.yaml | 2 +-
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c1b67e..6b496c0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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`
diff --git a/README.md b/README.md
index 51b102e..a785121 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
-## 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.
diff --git a/lib/widgets/ny_state.dart b/lib/widgets/ny_state.dart
index 1aaff83..af85fac 100644
--- a/lib/widgets/ny_state.dart
+++ b/lib/widgets/ny_state.dart
@@ -17,8 +17,8 @@ abstract class NyState extends State {
widgetDidLoad() async {}
- pop() {
- Navigator.of(context).pop();
+ pop({dynamic result}) {
+ Navigator.of(context).pop(result);
}
routeTo(String routeName,
@@ -31,7 +31,7 @@ abstract class NyState extends State {
Curve transitionCurve,
Map params,
CustomSailorTransition customTransition,
- Function() onPop}) {
+ Function(dynamic value) onPop}) {
NyArgument nyArgument = NyArgument(data);
NyNavigator.instance.router
.navigate(
@@ -46,6 +46,6 @@ abstract class NyState extends State {
params: params,
customTransition: customTransition,
)
- .then((v) => onPop());
+ .then((v) => onPop != null ? onPop(v) : (v) {});
}
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 072be1c..1c4a216 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -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