Skip to content

Commit ae879b1

Browse files
agordn52Anthony Gordon
authored andcommitted
chore(release): bump version to 7.23.0
1 parent 924f652 commit ae879b1

4 files changed

Lines changed: 42 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [7.23.0] - 2026-04-30
2+
3+
### Added
4+
5+
* **`NyStateManaged` widget** - A new `StatefulWidget` that accepts a `child` (either a `State` instance or a function returning one) and an optional `stateName`, allowing pre-built states to be wired into the widget tree directly via `createState`. Exported from `package:nylo_support/widgets/ny_widgets.dart`
6+
17
## [7.22.0] - 2026-04-28
28

39
### Added

lib/widgets/ny_widgets.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export 'src/pullable.dart';
88
export 'src/collection_view.dart';
99
export 'src/language_switcher.dart';
1010
export 'src/ny_stateful_widget.dart';
11+
export 'src/ny_state_managed_widget.dart';
1112
export 'src/ny_state.dart';
1213
export 'src/ny_page.dart';
1314
export 'src/button_state.dart';
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'package:flutter/cupertino.dart';
2+
3+
class NyStateManaged extends StatefulWidget {
4+
/// Child state
5+
final dynamic child;
6+
7+
/// State name
8+
final String? stateName;
9+
10+
NyStateManaged({super.key, this.child, String? stateName})
11+
: stateName = stateName;
12+
13+
@override
14+
StatefulElement createElement() => StatefulElement(this);
15+
16+
@override
17+
// ignore: no_logic_in_create_state
18+
State<StatefulWidget> createState() {
19+
if (child == null) {
20+
throw UnimplementedError();
21+
}
22+
if (child is State) {
23+
return child!;
24+
}
25+
if (child is Function) {
26+
dynamic child = this.child();
27+
assert(child is State, "Child must be a State");
28+
if (child is State) {
29+
return child;
30+
}
31+
}
32+
throw UnimplementedError();
33+
}
34+
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
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: 7.22.0
3+
version: 7.23.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/7.x
66
issue_tracker: https://github.com/nylo-core/support/issues

0 commit comments

Comments
 (0)