|
@@ -205,23 +205,11 @@ namespace FlutterCodeGenerator.ModelTypes
|
|
|
{
|
|
|
if (listModelType.GenericArgumentModelType is EnumModelType)
|
|
|
{
|
|
|
- source.AppendLine($"\t\tif ({child.Name_Lower} != null)");
|
|
|
- source.AppendLine($"\t\t\t{{");
|
|
|
- source.AppendLine($"\t\t\t\tList<String> {child.Name_Lower}List = {child.Name_Lower}!.map((e) {{");
|
|
|
- source.AppendLine($"\t\t\t\t\treturn e.index.toString();");
|
|
|
- source.AppendLine($"\t\t\t\t}}).toList();");
|
|
|
- source.AppendLine($"\t\t\t\tmap['{child.Name_Upper}'] = '[' + {child.Name_Lower}List.join(', ') + ']';");
|
|
|
- source.AppendLine($"\t\t\t}}");
|
|
|
- }
|
|
|
- else if (listModelType.GenericArgumentModelType is StringModelType)
|
|
|
- {
|
|
|
- source.AppendLine($"\t\tif ({child.Name_Lower} != null)");
|
|
|
- source.AppendLine($"\t\t\tmap['{child.Name_Upper}'] = '['+ {child.Name_Lower}!.join(',')+']';");
|
|
|
- }
|
|
|
- else if (listModelType.GenericArgumentModelType is SimpleModelType)
|
|
|
- {
|
|
|
- source.AppendLine($"\t\tif ({child.Name_Lower} != null)");
|
|
|
- source.AppendLine($"\t\t\tmap['{child.Name_Upper}'] = '['+ {child.Name_Lower}!.map((e) => e.toString()).join(',')+']';");
|
|
|
+ source.AppendLine($"\t\tif ({child.Name_Lower} != null) {{");
|
|
|
+ source.AppendLine($"\t\t\tList<int> {child.Name_Lower}List = [];");
|
|
|
+ source.AppendLine($"\t\t\t{child.Name_Lower}!.forEach((e) => {child.Name_Lower}List.add(e.index));");
|
|
|
+ source.AppendLine($"\t\t\tmap['{child.Name_Upper}'] = {child.Name_Lower}List;");
|
|
|
+ source.AppendLine($"\t\t}}");
|
|
|
}
|
|
|
else
|
|
|
{
|