Skip to content

Commit 2e29045

Browse files
committed
v1.2.4
1 parent 12f95b4 commit 2e29045

File tree

8 files changed

+44
-22
lines changed

8 files changed

+44
-22
lines changed

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [1.2.4] - 2025-03-09
2+
3+
* Update Laravel controller stubs
4+
* Dependency updates
5+
16
## [1.2.3] - 2025-02-27
27

38
* Dependency updates

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dart pub add scaffold_ui
4444
This will add the following to your pubspec.yaml:
4545
```yaml
4646
dependencies:
47-
scaffold_ui: ^1.2.3
47+
scaffold_ui: ^1.2.4
4848
```
4949
5050
## Setup Guides

example/.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ packages:
417417
dependency: transitive
418418
description:
419419
name: nylo_support
420-
sha256: "6be0333f52b24658bda8223a5748e2ac0334ecc7622b616437c97286cb64d1f4"
420+
sha256: "9f224d7bbdd75c05283339b9ee33df103deed345e9223990b759bbffdfef00bf"
421421
url: "https://pub.dev"
422422
source: hosted
423-
version: "6.20.0"
423+
version: "6.20.1"
424424
path:
425425
dependency: transitive
426426
description:
@@ -539,7 +539,7 @@ packages:
539539
path: ".."
540540
relative: true
541541
source: path
542-
version: "1.2.3"
542+
version: "1.2.4"
543543
shared_preferences:
544544
dependency: transitive
545545
description:

lib/stubs/laravel/laravel_login_controller_stub.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@ class LoginController extends Controller {
99
1010
/// Login the user
1111
login(String email, String password) async {
12-
LaravelAuthResponse? laravelAuthResponse = await api<LaravelAuthApiService>((request) => request.login(email, password), context: context);
13-
if (laravelAuthResponse?.status != 200) {
14-
showToastOops(description: laravelAuthResponse?.message ?? "");
15-
return;
12+
LaravelAuthResponse? laravelAuthResponse = await api<LaravelAuthApiService>(
13+
(request) => request.login(email, password),
14+
context: context, onSuccess: (Response response, dynamic data) {
15+
data as LaravelAuthResponse;
16+
if (data.status != 200) {
17+
showToastOops(description: data.message ?? "");
18+
return null;
1619
}
17-
event<LaravelAuthEvent>(data: {"user": laravelAuthResponse});
20+
return data;
21+
});
22+
23+
if (laravelAuthResponse == null) {
24+
return;
25+
}
26+
27+
await event<LaravelAuthEvent>(data: {"user": laravelAuthResponse});
1828
}
1929
}
2030
''';

lib/stubs/laravel/laravel_register_controller_stub.dart

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ class RegisterController extends Controller {
99
1010
/// Register the user
1111
register(String name, String email, String password) async {
12-
LaravelAuthResponse? laravelAuthResponse = await api<LaravelAuthApiService>((request) => request.register(
13-
name: name,
14-
email: email,
15-
password: password
16-
), context: context);
17-
if (laravelAuthResponse?.status != 200) {
18-
showToastOops(description: laravelAuthResponse?.message ?? "");
19-
return;
12+
LaravelAuthResponse? laravelAuthResponse = await api<LaravelAuthApiService>(
13+
(request) =>
14+
request.register(name: name, email: email, password: password),
15+
context: context, onSuccess: (Response response, dynamic data) {
16+
data as LaravelAuthResponse;
17+
if (data.status != 200) {
18+
showToastOops(description: data.message ?? "");
19+
return null;
2020
}
21-
await event<LaravelAuthEvent>(data: {"user": laravelAuthResponse});
21+
return data;
22+
});
23+
24+
if (laravelAuthResponse == null) {
25+
return;
26+
}
27+
28+
await event<LaravelAuthEvent>(data: {"user": laravelAuthResponse});
2229
}
2330
}
2431
''';

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: scaffold_ui
22
description: "The fastest way to scaffold services in your Nylo project! Auth & IAP integrations for Supabase, Firebase, Laravel, RevenueCat and more."
3-
version: 1.2.3
3+
version: 1.2.4
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/scaffold_ui
66
issue_tracker: https://github.com/nylo-core/scaffold_ui/issues
@@ -20,7 +20,7 @@ environment:
2020

2121
dependencies:
2222
args: ^2.6.0
23-
nylo_support: ^6.20.0
23+
nylo_support: ^6.20.1
2424
dart_console: ^4.1.1
2525
flutter:
2626
sdk: flutter

0 commit comments

Comments
 (0)