Skip to content

Commit c405dac

Browse files
committed
v6.28.1
1 parent 206b27a commit c405dac

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [6.28.1] - 2025-04-30
2+
3+
* Fix: `_whenStateAction` method in `NyState`
4+
15
## [6.28.0] - 2025-04-24
26

37
* Added: `nylo.broadcastEvents()`to broadcast events to all listeners.

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ packages:
419419
path: ".."
420420
relative: true
421421
source: path
422-
version: "6.27.0"
422+
version: "6.28.1"
423423
path:
424424
dependency: transitive
425425
description:
@@ -669,10 +669,10 @@ packages:
669669
dependency: transitive
670670
description:
671671
name: timezone
672-
sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d
672+
sha256: dd14a3b83cfd7cb19e7888f1cbc20f258b8d71b54c06f79ac585f14093a287d1
673673
url: "https://pub.dev"
674674
source: hosted
675-
version: "0.10.0"
675+
version: "0.10.1"
676676
typed_data:
677677
dependency: transitive
678678
description:

lib/widgets/ny_state.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,24 @@ abstract class NyState<T extends StatefulWidget> extends NyBaseState<T> {
6060
}
6161

6262
String action = data['action'];
63+
dynamic actionData = data.containsKey('data') ? data['data'] : null;
64+
6365
if (stateActions.containsKey(action)) {
64-
await stateActions[action]!();
66+
final function = stateActions[action]!;
67+
68+
String functionString = function.runtimeType.toString();
69+
70+
// Determine if the function takes parameters based on its toString representation
71+
bool hasParameters = functionString.contains("(dynamic)") ||
72+
functionString.contains("(Object?)") ||
73+
!functionString.contains("()");
74+
75+
if (hasParameters) {
76+
await Function.apply(function, [actionData]);
77+
return;
78+
}
79+
80+
await Function.apply(function, []);
6581
}
6682
}
6783
}

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,10 @@ packages:
678678
dependency: "direct main"
679679
description:
680680
name: timezone
681-
sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d
681+
sha256: dd14a3b83cfd7cb19e7888f1cbc20f258b8d71b54c06f79ac585f14093a287d1
682682
url: "https://pub.dev"
683683
source: hosted
684-
version: "0.10.0"
684+
version: "0.10.1"
685685
typed_data:
686686
dependency: transitive
687687
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_support
22
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
3-
version: 6.28.0
3+
version: 6.28.1
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/6.x
66
issue_tracker: https://github.com/nylo-core/support/issues
@@ -37,7 +37,7 @@ dependencies:
3737
flutter_multi_formatter: ^2.13.7
3838
flutter_local_notifications: ^19.1.0
3939
path_provider: ^2.1.5
40-
timezone: ^0.10.0
40+
timezone: ^0.10.1
4141
flutter_timezone: ^4.1.0
4242
app_badge_plus: ^1.2.1
4343
mask_text_input_formatter: ^2.9.0

0 commit comments

Comments
 (0)