|
@@ -243,7 +243,14 @@ namespace FlutterCodeGenerator.ModelTypes
|
|
|
{
|
|
|
var argumentName1 = dictionaryModelType.GenericArgumentModelTypeList[0].GetFlutterTypeName();
|
|
|
var argumentName2 = dictionaryModelType.GenericArgumentModelTypeList[1].GetFlutterTypeName();
|
|
|
- source.AppendLine($"\t\t\t{child.Name_Lower}: map['{child.Name_Upper}']?.cast<{argumentName1},{argumentName2}>(),");
|
|
|
+ if(dictionaryModelType.GenericArgumentModelTypeList[0] is SimpleModelType && dictionaryModelType.GenericArgumentModelTypeList[1] is SimpleModelType)
|
|
|
+ {
|
|
|
+ source.AppendLine($"\t\t\t{child.Name_Lower}: map['{child.Name_Upper}']?.cast<{argumentName1},{argumentName2}>(),");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ source.AppendLine($"\t\t\t{child.Name_Lower}: map['{child.Name_Upper}'] != null ? map['{child.Name_Upper}'] as Map<{argumentName1},{argumentName2}> : null,");
|
|
|
+ }
|
|
|
}
|
|
|
else if (child is UserDefinedGenericModelType userDefinedGenericModelType)
|
|
|
{
|