Skip to content

Commit 345f34a

Browse files
committed
chore(release): bump version to 7.1.25
1 parent ae62c76 commit 345f34a

10 files changed

Lines changed: 288 additions & 88 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [7.1.25] - 2026-07-06
2+
3+
### Fixed
4+
* `make:api_service` — acronym-spelled names (e.g. `PaymentsAPIService`) no longer produce a doubled `ApiServiceApiService` class name; the suffix is now stripped case-insensitively and falls back to `api` for suffix-only input
5+
* Generated API service now always imports `package:nylo_framework/nylo_framework.dart` (previously omitted when a custom `--url` was supplied, breaking the `NyApiService` reference)
6+
* Generated `env.g.dart` now escapes single quotes and backslashes in keys and values, so secrets containing `'` or `\` can't break the generated Dart string literal
7+
8+
### Changed
9+
* `make:api_service` info hint now points to `bootstrap/decoders.dart` (was `config/decoders.dart`)
10+
* Generated `env.g.dart` adds explicit local variable type annotations and a `dart:typed_data` import (satisfies the `specify_nonobvious_local_variable_types` lint)
11+
* Bump `nylo_support` dependency from `^7.27.2` to `^7.27.3`
12+
* Bump `flutter_local_notifications` dependency from `^22.0.0` to `^22.0.1`
13+
* Bump `dio` dependency from `^5.9.2` to `^5.10.0`
14+
115
## [7.1.24] - 2026-06-08
216

317
### Changed

example/pubspec.lock

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ packages:
55
dependency: transitive
66
description:
77
name: app_badge_plus
8-
sha256: c74952a7cc24fee60e0fd3d88c660636611d7234c35674f8e7501cdaf07265d6
8+
sha256: "60b24ecbcb792f5b185a837b066ee436ef9f6435f2a3006eb314d0c6a80f1d75"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "1.3.0"
11+
version: "1.3.1"
1212
app_links:
1313
dependency: transitive
1414
description:
1515
name: app_links
16-
sha256: a350a5b37579b7227aaf9a59c07114617cd4283852e193f743b2b3d2d7483c18
16+
sha256: "9d3c82f634c7f5b5c752f7ee46b67724246043f5e1d5fc1b433dd5b38d780dbe"
1717
url: "https://pub.dev"
1818
source: hosted
19-
version: "7.1.1"
19+
version: "7.2.0"
2020
app_links_linux:
2121
dependency: transitive
2222
description:
@@ -29,10 +29,10 @@ packages:
2929
dependency: transitive
3030
description:
3131
name: app_links_platform_interface
32-
sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f"
32+
sha256: "78a18580eecac98108d1eef52a7db668bc317714f5205e616973363326efe333"
3333
url: "https://pub.dev"
3434
source: hosted
35-
version: "2.0.2"
35+
version: "2.0.3"
3636
app_links_web:
3737
dependency: transitive
3838
description:
@@ -117,10 +117,10 @@ packages:
117117
dependency: transitive
118118
description:
119119
name: connectivity_plus
120-
sha256: "62ffa266d9a23b79fb3fcbc206afc00bb979417ba57b1324c546b5aab95ba057"
120+
sha256: cad0e811a289ea2a941119dc483c204ec1684cbb9a8fc7351fe4a230b8313160
121121
url: "https://pub.dev"
122122
source: hosted
123-
version: "7.1.1"
123+
version: "7.2.0"
124124
connectivity_plus_platform_interface:
125125
dependency: transitive
126126
description:
@@ -165,18 +165,18 @@ packages:
165165
dependency: transitive
166166
description:
167167
name: dio
168-
sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c
168+
sha256: ea2bad3c89a27635ce2d85cce4d6b199da49a5a48ec77b03e45b65a3b90922b0
169169
url: "https://pub.dev"
170170
source: hosted
171-
version: "5.9.2"
171+
version: "5.10.0"
172172
dio_web_adapter:
173173
dependency: transitive
174174
description:
175175
name: dio_web_adapter
176-
sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340"
176+
sha256: dd58dc3861eb36edb13b217efc006a1c21e5bbc341de8c229b85634fa5e362e4
177177
url: "https://pub.dev"
178178
source: hosted
179-
version: "2.1.2"
179+
version: "2.2.0"
180180
dispose_scope:
181181
dependency: transitive
182182
description:
@@ -189,10 +189,10 @@ packages:
189189
dependency: transitive
190190
description:
191191
name: equatable
192-
sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b"
192+
sha256: "3bce007a596ff8b3119c45d68aaef631272537c03d30e5d4534dd24bf4c5eaa2"
193193
url: "https://pub.dev"
194194
source: hosted
195-
version: "2.0.8"
195+
version: "2.1.0"
196196
error_stack:
197197
dependency: transitive
198198
description:
@@ -250,10 +250,10 @@ packages:
250250
dependency: transitive
251251
description:
252252
name: flutter_local_notifications
253-
sha256: be38e3854d2baabcda8e16966a5fe8748cebb655bb94701494da0f052c2fc352
253+
sha256: a0d7141f14cabcee42967470a858dfc99dd6cfb70d3cab404bacfcafa9e84e70
254254
url: "https://pub.dev"
255255
source: hosted
256-
version: "22.0.0"
256+
version: "22.0.1"
257257
flutter_local_notifications_linux:
258258
dependency: transitive
259259
description:
@@ -282,10 +282,10 @@ packages:
282282
dependency: transitive
283283
description:
284284
name: flutter_local_notifications_windows
285-
sha256: "5aeed973a0c1480706784fad05c5c3a911335ebb561b2274b47fe80b375201e1"
285+
sha256: "6f43bdd03b171b7a90f22647506fea33e2bb12294b7c7c7a3d690e960a382945"
286286
url: "https://pub.dev"
287287
source: hosted
288-
version: "3.1.0"
288+
version: "3.1.1"
289289
flutter_localizations:
290290
dependency: transitive
291291
description: flutter
@@ -385,10 +385,10 @@ packages:
385385
dependency: transitive
386386
description:
387387
name: get_time_ago
388-
sha256: cd111914562ca2b938afbc73f715fab1f37795cc053924d08f6de59878781388
388+
sha256: "883e14a3d47471779582b2681734e494748f97301b35e5f6a5b50185788e042a"
389389
url: "https://pub.dev"
390390
source: hosted
391-
version: "2.3.2"
391+
version: "2.4.0"
392392
gtk:
393393
dependency: transitive
394394
description:
@@ -539,15 +539,15 @@ packages:
539539
path: ".."
540540
relative: true
541541
source: path
542-
version: "7.1.23"
542+
version: "7.1.24"
543543
nylo_support:
544544
dependency: transitive
545545
description:
546546
name: nylo_support
547-
sha256: "7e08e7c13510757d0d4ab6b88daf74b7d9efab8672ee72af48f34bb958fcf7dd"
547+
sha256: "58d0682324e011bed87b371c150caf26d8e0519e1692ee62c1646559144a6c4c"
548548
url: "https://pub.dev"
549549
source: hosted
550-
version: "7.27.2"
550+
version: "7.27.3"
551551
objective_c:
552552
dependency: transitive
553553
description:
@@ -576,10 +576,10 @@ packages:
576576
dependency: transitive
577577
description:
578578
name: path_provider
579-
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
579+
sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825
580580
url: "https://pub.dev"
581581
source: hosted
582-
version: "2.1.5"
582+
version: "2.1.6"
583583
path_provider_android:
584584
dependency: transitive
585585
description:
@@ -600,18 +600,18 @@ packages:
600600
dependency: transitive
601601
description:
602602
name: path_provider_linux
603-
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
603+
sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16"
604604
url: "https://pub.dev"
605605
source: hosted
606-
version: "2.2.1"
606+
version: "2.2.2"
607607
path_provider_platform_interface:
608608
dependency: transitive
609609
description:
610610
name: path_provider_platform_interface
611-
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
611+
sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda"
612612
url: "https://pub.dev"
613613
source: hosted
614-
version: "2.1.2"
614+
version: "2.1.3"
615615
path_provider_windows:
616616
dependency: transitive
617617
description:
@@ -640,10 +640,10 @@ packages:
640640
dependency: transitive
641641
description:
642642
name: patrol_log
643-
sha256: "16ab747b28621640115d9493138eae82a1d410a613857cb0caf9000ce62fc546"
643+
sha256: "080608c3402480e18f7dce5a7ee17bf2e23fc191eedffb73a8a635506ce6d4bf"
644644
url: "https://pub.dev"
645645
source: hosted
646-
version: "0.9.0"
646+
version: "0.9.1"
647647
petitparser:
648648
dependency: transitive
649649
description:
@@ -728,10 +728,10 @@ packages:
728728
dependency: transitive
729729
description:
730730
name: shared_preferences_android
731-
sha256: a2c49fc1fed7140cadd892d765bd47edbe4ac0b9c7e7e3c493dcb58126f99cf0
731+
sha256: "93ae5884a9df5d3bb696825bceb3a17590754548b5d740eba51500afc8d088f5"
732732
url: "https://pub.dev"
733733
source: hosted
734-
version: "2.4.25"
734+
version: "2.4.26"
735735
shared_preferences_foundation:
736736
dependency: transitive
737737
description:
@@ -845,10 +845,10 @@ packages:
845845
dependency: transitive
846846
description:
847847
name: timezone
848-
sha256: "784a5e34d2eb62e1326f24d6f600aaaee452eb8ca8ef2f384a59244e292d158b"
848+
sha256: "981d1020d6ef8fe1e7b3de5054e5b25579ae7c403d7734adc508ffc47668e9cb"
849849
url: "https://pub.dev"
850850
source: hosted
851-
version: "0.11.0"
851+
version: "0.11.1"
852852
typed_data:
853853
dependency: transitive
854854
description:

lib/metro/commands/make/api_service.dart

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ class _MakeApiServiceCommand extends NyCustomCommand {
4646
message: 'API service name is required',
4747
);
4848

49-
String cleanApiServiceName = apiServiceName.snakeCase.replaceAll(
50-
RegExp(r'(_?api_service)'),
51-
"",
52-
);
53-
54-
ReCase classReCase = ReCase(cleanApiServiceName);
49+
ReCase classReCase = ReCase(cleanApiServiceName(apiServiceName));
5550

5651
// Get model option or default to 'Model'
5752
String modelName = result.getString("model") ?? "Model";
@@ -77,6 +72,25 @@ class _MakeApiServiceCommand extends NyCustomCommand {
7772
'$networkingPath/${classReCase.snakeCase}_api_service.dart',
7873
);
7974

80-
info('Add the API service to your config/decoders.dart file');
75+
info('Add the API service to your bootstrap/decoders.dart file');
76+
}
77+
}
78+
79+
/// Strips a trailing API service suffix from [rawName] and returns the resource
80+
/// name in snake_case.
81+
///
82+
/// The suffix is matched case-insensitively so acronym spellings such as
83+
/// `APIService` (which `snakeCase` would split into `a_p_i_service`) are handled
84+
/// correctly and don't leave the class name doubled (e.g. `APIServiceApiService`).
85+
/// When the input is nothing but the suffix (e.g. `APIService`), it falls back
86+
/// to `api` so a non-empty name is always produced.
87+
String cleanApiServiceName(String rawName) {
88+
String stripped = rawName.replaceFirst(
89+
RegExp(r'[-_ ]?api[-_ ]?service$', caseSensitive: false),
90+
"",
91+
);
92+
if (stripped.trim().isEmpty) {
93+
return "api";
8194
}
95+
return ReCase(stripped).snakeCase;
8296
}

lib/metro/stubs/api_service_stub.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ String apiServiceStub(
77
required String baseUrl,
88
}) =>
99
'''import '/bootstrap/decoders.dart';
10-
${baseUrl == "getEnv('API_BASE_URL')" ? "import 'package:nylo_framework/nylo_framework.dart';" : ""}${model.originalText != 'Model' ? "\nimport '/app/models/${model.snakeCase}.dart';" : ""}
10+
import 'package:nylo_framework/nylo_framework.dart';${model.originalText != 'Model' ? "\nimport '/app/models/${model.snakeCase}.dart';" : ""}
1111
1212
class ${rc.pascalCase}ApiService extends NyApiService {
1313
${rc.pascalCase}ApiService() : super(decoders: modelDecoders);

lib/metro/stubs/env_stub.dart

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ String envStub({
1818
);
1919
buffer.writeln('');
2020
buffer.writeln("import 'dart:convert';");
21+
buffer.writeln("import 'dart:typed_data';");
2122
buffer.writeln('');
2223

2324
// Start class
@@ -39,15 +40,19 @@ String envStub({
3940
buffer.writeln(
4041
' /// APP_KEY for decryption (obfuscated at compile time).',
4142
);
42-
buffer.writeln(" static const String _appKey = '$appKey';");
43+
buffer.writeln(
44+
" static const String _appKey = '${_escapeSingleQuoted('$appKey')}';",
45+
);
4346
}
4447
buffer.writeln('');
4548

4649
// Encrypted values map
4750
buffer.writeln(' /// Encrypted environment values.');
4851
buffer.writeln(' static const Map<String, String> _encrypted = {');
4952
for (final entry in encryptedMap.entries) {
50-
buffer.writeln(" '${entry.key}': '${entry.value}',");
53+
buffer.writeln(
54+
" '${_escapeSingleQuoted(entry.key)}': '${_escapeSingleQuoted(entry.value)}',",
55+
);
5156
}
5257
buffer.writeln(' };');
5358
buffer.writeln('');
@@ -60,8 +65,10 @@ String envStub({
6065
// XOR decrypt method
6166
buffer.writeln(' /// Decrypts a base64-encoded XOR-encrypted string.');
6267
buffer.writeln(' static String _decrypt(String encrypted) {');
63-
buffer.writeln(' final encryptedBytes = base64Decode(encrypted);');
64-
buffer.writeln(' final keyBytes = utf8.encode(_appKey);');
68+
buffer.writeln(
69+
' final Uint8List encryptedBytes = base64Decode(encrypted);',
70+
);
71+
buffer.writeln(' final Uint8List keyBytes = utf8.encode(_appKey);');
6572
buffer.writeln(' final decryptedBytes = <int>[];');
6673
buffer.writeln('');
6774
buffer.writeln(' for (var i = 0; i < encryptedBytes.length; i++) {');
@@ -107,8 +114,8 @@ String envStub({
107114
buffer.writeln(' }');
108115
buffer.writeln('');
109116
buffer.writeln(' // Decrypt and parse the value');
110-
buffer.writeln(' final decrypted = _decrypt(_encrypted[key]!);');
111-
buffer.writeln(' final parsed = _parseValue(decrypted);');
117+
buffer.writeln(' final String decrypted = _decrypt(_encrypted[key]!);');
118+
buffer.writeln(' final dynamic parsed = _parseValue(decrypted);');
112119
buffer.writeln('');
113120
buffer.writeln(' // Cache the result');
114121
buffer.writeln(' _cache[key] = parsed;');
@@ -133,3 +140,9 @@ String envStub({
133140

134141
return buffer.toString();
135142
}
143+
144+
/// Escapes [value] for safe interpolation inside a single-quoted Dart string
145+
/// literal. Backslashes are escaped first, then single quotes, so a key or value
146+
/// containing `'` or `\` cannot break the generated `env.g.dart`.
147+
String _escapeSingleQuoted(String value) =>
148+
value.replaceAll('\\', '\\\\').replaceAll("'", "\\'");

lib/nylo_framework.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ export 'package:date_field/date_field.dart';
1515
export 'package:dio/dio.dart';
1616

1717
/// Nylo version
18-
const String nyloVersion = 'v7.1.24';
18+
const String nyloVersion = 'v7.1.25';

0 commit comments

Comments
 (0)