Skip to content

Commit

Permalink
v5.76.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Jun 16, 2024
1 parent ff9cea4 commit 2b9dfcd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [5.76.0] - 2024-06-16

* Add support for the `child` parameter in NyStatefulWidget to be a Function that returns a State.
* Update pubspec.yaml

## [5.75.3] - 2024-06-14

* Add await to `ErrorStack.init`
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: transitive
description:
name: error_stack
sha256: cb189baf478bb896f204485fe6633728eacde26aa944ba9744e501f8a84901a4
sha256: "4a42065d1b3e82e60754ce2e4c462a558d376d6c584c45a7f56c5ab88c896ec9"
url: "https://pub.dev"
source: hosted
version: "1.7.1"
version: "1.7.3"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -275,7 +275,7 @@ packages:
path: ".."
relative: true
source: path
version: "5.75.3"
version: "5.76.0"
page_transition:
dependency: transitive
description:
Expand Down
14 changes: 12 additions & 2 deletions lib/widgets/ny_stateful_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class NyStatefulWidget<T extends BaseController>
final String? state;

/// Child state
final State? child;
final dynamic child;

NyStatefulWidget(String? path, {Key? key, this.child})
: state = path,
Expand All @@ -27,9 +27,19 @@ abstract class NyStatefulWidget<T extends BaseController>

@override
State<StatefulWidget> createState() {
if (child != null) {
if (child == null) {
throw UnimplementedError();
}
if (child is State) {
return child!;
}
if (child is Function) {
dynamic child = this.child();
assert(child is State, "Child must be a State");
if (child is State) {
return child;
}
}
throw UnimplementedError();
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: "direct main"
description:
name: error_stack
sha256: cb189baf478bb896f204485fe6633728eacde26aa944ba9744e501f8a84901a4
sha256: "4a42065d1b3e82e60754ce2e4c462a558d376d6c584c45a7f56c5ab88c896ec9"
url: "https://pub.dev"
source: hosted
version: "1.7.1"
version: "1.7.3"
fake_async:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nylo_support
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
version: 5.75.3
version: 5.76.0
homepage: https://nylo.dev
repository: https://github.com/nylo-core/support/tree/5.x
issue_tracker: https://github.com/nylo-core/support/issues
Expand Down Expand Up @@ -33,7 +33,7 @@ dependencies:
pretty_dio_logger: ^1.3.1
intl: ^0.19.0
skeletonizer: ^1.3.0
error_stack: ^1.7.1
error_stack: ^1.7.3
flutter_localizations:
sdk: flutter
flutter:
Expand Down

0 comments on commit 2b9dfcd

Please sign in to comment.