toMapBody method

String toMapBody(
  1. Map map
)

Implementation

String toMapBody(Map map) {
  final variable = map.keys;
  return '''Map<String, dynamic> toMap() {
  return {
    ${variable.map((e) => "if (${e.toString().camelCase} != null)  '${e.toString()}': ${getVariableToMapBody(e, map[e])}").join(',      \n')}${variable.isNotEmpty ? ',' : ''}
  };
}''';
}