Added Agent Details including Task Details
This commit is contained in:
@@ -85,6 +85,18 @@ class JsonReader {
|
||||
return int.tryParse(raw.toString());
|
||||
}
|
||||
|
||||
/// Maps a json array of plain values onto a list of strings.
|
||||
static List<String> stringList(Map<String, dynamic> json, String key) {
|
||||
final raw = value(json, key);
|
||||
if (raw is! List) {
|
||||
return const <String>[];
|
||||
}
|
||||
return raw
|
||||
.where((entry) => entry != null)
|
||||
.map((entry) => entry.toString())
|
||||
.toList(growable: false);
|
||||
}
|
||||
|
||||
/// Maps a json array onto a list of models, tolerating a missing property.
|
||||
static List<T> list<T>(
|
||||
Map<String, dynamic> json,
|
||||
|
||||
Reference in New Issue
Block a user