variablesToJson function
Implementation
Map<String, dynamic> variablesToJson(List<Variable>? variables) {
if (variables == null) return {};
final data = variables.map((e) => MapEntry(e.variableName, e.toJson()));
return Map.fromEntries(data);
}