mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
New utility to convert KVMap to List
This commit is contained in:
@ -64,3 +64,14 @@ Map<String, String>? rowsToMap(List<KVRow>? kvRows, {bool isHeader = false}) {
|
||||
}
|
||||
return finalMap;
|
||||
}
|
||||
|
||||
List<KVRow>? mapToRows(Map<String, String>? kvMap) {
|
||||
if (kvMap == null) {
|
||||
return null;
|
||||
}
|
||||
List<KVRow> finalRows = [];
|
||||
for (var k in kvMap.keys) {
|
||||
finalRows.add(KVRow(k, kvMap[k]));
|
||||
}
|
||||
return finalRows;
|
||||
}
|
||||
|
Reference in New Issue
Block a user