Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use JsonPath.readValues()
  • Loading branch information
f3ath committed Nov 24, 2023
commit 6b8c5b498452422568a14ce8d151bc804a603e4a
6 changes: 3 additions & 3 deletions lib/src/flutter_flow/flutter_flow_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ dynamic getJsonField(
String jsonPath, [
bool isForList = false,
]) {
final field = JsonPath(jsonPath).read(response);
final field = JsonPath(jsonPath).readValues(response);
if (field.isEmpty) {
return null;
}
if (field.length > 1) {
return field.map((f) => f.value).toList();
return field.toList();
}
final value = field.first.value;
final value = field.first;
return isForList && value is! Iterable ? [value] : value;
}

Expand Down