Skip to content

Commit 306acd2

Browse files
cgiulianicgiuliani
cgiuliani
authored and
cgiuliani
committed
fix: route recursion issue
1 parent e98fb61 commit 306acd2

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

configurator/lib/src/utils/parser.dart

+10-15
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,17 @@ class YamlParser {
160160

161161
routes.add(processed);
162162

163-
for (var c in _getChildren(processed, [])) {
164-
routes.add(c);
163+
void addChildrenRecursive(YamlRoute route) {
164+
for (YamlRoute c in route.children) {
165+
routes.add(c);
166+
167+
if (c.children.isNotEmpty) {
168+
addChildrenRecursive(c);
169+
}
170+
}
165171
}
172+
173+
addChildrenRecursive(processed);
166174
}
167175
} catch (e) {
168176
print(e);
@@ -217,18 +225,6 @@ class YamlParser {
217225
return result;
218226
}
219227

220-
static List<YamlRoute> _getChildren(YamlRoute route, List<YamlRoute> result) {
221-
for (YamlRoute c in route.children) {
222-
result.add(c);
223-
224-
if (c.children.isNotEmpty) {
225-
return _getChildren(c, result);
226-
}
227-
}
228-
229-
return result;
230-
}
231-
232228
static List<YamlI18n> processTranslationsMap(
233229
Map<String, dynamic> translationsMap) {
234230
List<YamlI18n> translations = [];
@@ -449,7 +445,6 @@ class I18nParser {
449445
List<String> path,
450446
) {
451447
for (var entry in input.entries) {
452-
453448
var translations = visitTranslations(
454449
locale,
455450
entry.value,

configurator/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: configurator
22
description: A new Flutter package project.
3-
version: 0.0.38
3+
version: 0.0.39
44
homepage:
55

66
environment:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.11/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-07-28 09:39:53.766371","version":"3.10.5"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.11/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/cgiuliani/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-08-02 17:53:57.520327","version":"3.10.5"}

configurator_flutter/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: configurator_flutter
22
description: A new Flutter package project.
3-
version: 0.0.38
3+
version: 0.0.39
44
homepage:
55

66
environment:
@@ -30,7 +30,7 @@ dependencies:
3030
git:
3131
url: [email protected]:camrongiuliani/configurator.git
3232
path: configurator
33-
ref: 0.0.38
33+
ref: 0.0.39
3434

3535
dev_dependencies:
3636
flutter_test:

0 commit comments

Comments
 (0)