Browse Source

Add DateTime? Type.

Felix 3 years ago
parent
commit
e939f1debc
3 changed files with 6 additions and 1 deletions
  1. 5 0
      MethodMap.cs
  2. 1 1
      ModeTypeGenerator.cs
  3. BIN
      WingInterfaceLibrary.dll

+ 5 - 0
MethodMap.cs

@@ -100,6 +100,11 @@ namespace FlutterCodeGenerator
                         dartString.AppendLine("\t\treturn result;");
                     }
                 }
+                else if (ReturnParameterModelType is DictionaryModelType dictionaryModelType)
+                {
+                    dartString.AppendLine($"\t\tvar result = (rpcRst as Map).cast<{dictionaryModelType.GenericArgumentModelTypeList[0].GetFlutterTypeName()},{dictionaryModelType.GenericArgumentModelTypeList[1].GetFlutterTypeName()}>();");
+                    dartString.AppendLine("\t\treturn result;");
+                }
             }
             dartString.AppendLine("\t}");
             return dartString.ToString();

+ 1 - 1
ModeTypeGenerator.cs

@@ -38,7 +38,7 @@ namespace FlutterCodeGenerator
                 {
                     return new StringModeType(argName);
                 }
-                else if (type == typeof(DateTime))
+                else if (type == typeof(DateTime) || type == typeof(DateTime?))
                 {
                     return new DateTimeModeType(argName);
                 }

BIN
WingInterfaceLibrary.dll