Skip to content

Commit effe148

Browse files
committed
v6.34.0
1 parent 3a5e527 commit effe148

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+326
-292
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [6.34.0] - 2025-07-17
2+
3+
* Added `lifecycleActions` to `Nylo.init`. This will allow you to global handle your app's lifecycle.
4+
* Add missing annotations
5+
* Update pubspec.yaml
6+
17
## [6.33.0] - 2025-07-14
28

39
* Added `lifecycleActions` to `NyPage`. This will allow you to handle lifecycle events in your pages.

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ packages:
419419
path: ".."
420420
relative: true
421421
source: path
422-
version: "6.32.0"
422+
version: "6.34.0"
423423
path:
424424
dependency: transitive
425425
description:

lib/alerts/toast_notification.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import '/nylo.dart';
99
/// Provide a valid [ToastNotificationStyleType]
1010
/// i.e. [ToastNotificationStyleType.SUCCESS]
1111
/// Set a title, description to personalise the message.
12-
showToastNotification(BuildContext context,
12+
void showToastNotification(BuildContext context,
1313
{ToastNotificationStyleType? style,
1414
String? title,
1515
IconData? icon,

lib/controllers/controller.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class NyRequest {
1919
}
2020

2121
/// Write [data] to controller
22-
setData(dynamic data) {
22+
void setData(dynamic data) {
2323
_args?.data = data;
2424
}
2525

@@ -81,7 +81,7 @@ abstract class BaseController {
8181
/// Initialize your controller with this method.
8282
/// It contains same [BuildContext] as the [NyStatefulWidget].
8383
@mustCallSuper
84-
construct(BuildContext context) async {
84+
Future<void> construct(BuildContext context) async {
8585
this.context = context;
8686
}
8787
}

lib/controllers/ny_controller.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ class NyController extends BaseController {
1818
}
1919

2020
/// Refreshes the page
21-
refreshPage() {
21+
void refreshPage() {
2222
updatePageState("refresh-page", {"setState": () {}});
2323
}
2424

2525
/// Set the state of the page
26-
setState({required Function() setState}) {
26+
void setState({required Function() setState}) {
2727
updatePageState("set-state", {"setState": setState});
2828
}
2929

3030
/// Pop the page
31-
pop({dynamic result}) {
31+
void pop({dynamic result}) {
3232
updatePageState("pop", {"result": result});
3333
}
3434

lib/dart_console/src/ffi/unix/termios.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ typedef cc_t = UnsignedChar;
6161
typedef speed_t = UnsignedLong;
6262

6363
// #define NCCS 20
64+
// ignore: constant_identifier_names
6465
const _NCCS = 20;
6566

6667
// struct termios {

lib/events/events.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class NyListener {
88
late NyEvent _event;
99

1010
/// Set the [event] that the listener was called from
11-
setEvent(NyEvent event) {
11+
void setEvent(NyEvent event) {
1212
_event = event;
1313
}
1414

lib/helpers/auth.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ mixin HasApiService<T extends NyApiService> {
1212
T? _apiService;
1313

1414
/// Set the onSuccess callback
15-
onApiSuccess(Function(Response response, dynamic data) onSuccess) {
15+
void onApiSuccess(Function(Response response, dynamic data) onSuccess) {
1616
_apiService ??= apiService;
1717
_apiService!.onSuccess(onSuccess);
1818
}
1919

2020
/// Set the onError callback
21-
onApiError(Function(dynamic error) onError) {
21+
void onApiError(Function(dynamic error) onError) {
2222
_apiService ??= apiService;
2323
_apiService!.onError(onError);
2424
}
@@ -69,7 +69,7 @@ class Auth {
6969
}
7070

7171
/// Get the user data.
72-
static data({String? key}) {
72+
static dynamic data({String? key}) {
7373
if (key != null) {
7474
Map<String, dynamic>? bpData = Backpack.instance.read(key);
7575
return (bpData?.containsKey(key) ?? false) ? bpData![key] : null;
@@ -78,7 +78,7 @@ class Auth {
7878
}
7979

8080
/// Update the auth user data.
81-
static update(Function(dynamic data) update) async {
81+
static Future<void> update(Function(dynamic data) update) async {
8282
dynamic data = await NyStorage.read(key());
8383
dynamic updatedData = await update(data);
8484
await authenticate(data: updatedData);
@@ -98,19 +98,19 @@ class Auth {
9898
}
9999

100100
/// Sync the auth user data to the backpack.
101-
static syncToBackpack() async {
101+
static Future<void> syncToBackpack() async {
102102
dynamic data = await NyStorage.readJson(key());
103103
Backpack.instance.save(key(), data);
104104
}
105105
}
106106

107107
/// Authenticate user
108-
authAuthenticate({dynamic data}) async {
108+
Future<void> authAuthenticate({dynamic data}) async {
109109
await Auth.authenticate(data: data);
110110
}
111111

112112
/// Logout user
113-
authLogout() async {
113+
Future<void> authLogout() async {
114114
await Auth.logout();
115115
}
116116

@@ -120,22 +120,22 @@ Future<bool> authIsAuthenticated() async {
120120
}
121121

122122
/// Get the user data
123-
authData({String? key}) {
123+
dynamic authData({String? key}) {
124124
return Auth.data(key: key);
125125
}
126126

127127
/// Update the auth user data
128-
authUpdate(Function(dynamic data) update) async {
128+
Future<void> authUpdate(Function(dynamic data) update) async {
129129
await Auth.update(update);
130130
}
131131

132132
/// Sync the auth user data to the backpack
133-
authSyncToBackpack() async {
133+
Future<void> authSyncToBackpack() async {
134134
await Auth.syncToBackpack();
135135
}
136136

137137
/// Get the auth key
138-
authKey() {
138+
String authKey() {
139139
return Auth.key();
140140
}
141141

lib/helpers/backpack.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Backpack {
3131
}
3232

3333
/// Update the session with a [key] and [value].
34-
sessionUpdate(String name, String key, dynamic value) {
34+
void sessionUpdate(String name, String key, dynamic value) {
3535
if (!_values.containsKey(name)) {
3636
_values[name] = {};
3737
}
@@ -47,7 +47,7 @@ class Backpack {
4747
}
4848

4949
/// Remove a session value using a [key].
50-
sessionRemove(String name, String key) {
50+
void sessionRemove(String name, String key) {
5151
if (_values.containsKey(name)) {
5252
_values[name].remove(key);
5353
}
@@ -107,17 +107,18 @@ class Backpack {
107107
}
108108

109109
/// Read data from the Backpack with a [key].
110-
backpackRead<T>(String key, {dynamic defaultValue}) =>
110+
T? backpackRead<T>(String key, {dynamic defaultValue}) =>
111111
Backpack.instance.read<T>(key, defaultValue: defaultValue);
112112

113113
/// Save a value using a [key] and [value].
114-
backpackSave(String key, dynamic value) => Backpack.instance.save(key, value);
114+
void backpackSave(String key, dynamic value) =>
115+
Backpack.instance.save(key, value);
115116

116117
/// Delete a value using a [key].
117-
backpackDelete(String key) => Backpack.instance.delete(key);
118+
void backpackDelete(String key) => Backpack.instance.delete(key);
118119

119120
/// Delete all values from [Backpack].
120-
backpackDeleteAll() => Backpack.instance.deleteAll();
121+
void backpackDeleteAll() => Backpack.instance.deleteAll();
121122

122123
/// Returns an instance of Nylo.
123124
Nylo backpackNylo({String key = 'nylo'}) => Backpack.instance.nylo(key: key);

0 commit comments

Comments
 (0)