|
@@ -18,6 +18,7 @@ namespace FlutterCodeGenerator
|
|
|
private readonly string _rpcDart = "rpc.dart";
|
|
|
private Dictionary<string, ServiceMap> _serviceMapDictionary;
|
|
|
private List<string> _generatedServiceFileNameList;
|
|
|
+ private List<string> _generatedServiceModelFileNameList;
|
|
|
|
|
|
public static readonly string StringDartCore = "import 'dart:core';";
|
|
|
public static readonly string StringClientBase = "import 'package:fis_jsonrpc/client_base.dart';";
|
|
@@ -33,6 +34,7 @@ namespace FlutterCodeGenerator
|
|
|
_rpcTextPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "rpc.txt");
|
|
|
_serviceMapDictionary = new Dictionary<string, ServiceMap>();
|
|
|
_generatedServiceFileNameList = new List<string>() { "platform.dart" };
|
|
|
+ _generatedServiceModelFileNameList = new List<string>();
|
|
|
AlreadyGeneratedList = new Dictionary<ComplexModelType, string>();
|
|
|
LoadDll();
|
|
|
|
|
@@ -90,6 +92,7 @@ namespace FlutterCodeGenerator
|
|
|
{
|
|
|
File.WriteAllText(serviceModelDartPath, serviceModelDartString);
|
|
|
serviceDartString.AppendLine($"import '{serviceModelDartFileName}';");
|
|
|
+ _generatedServiceModelFileNameList.Add(serviceModelDartFileName);
|
|
|
}
|
|
|
serviceDartString.AppendLine();
|
|
|
serviceDartString.AppendLine(serviceString);
|
|
@@ -132,6 +135,10 @@ namespace FlutterCodeGenerator
|
|
|
{
|
|
|
dartString.AppendLine($"export '{fileName}';");
|
|
|
}
|
|
|
+ foreach (var fileName in _generatedServiceModelFileNameList.OrderBy(x => x))
|
|
|
+ {
|
|
|
+ dartString.AppendLine($"export '{fileName}';");
|
|
|
+ }
|
|
|
File.WriteAllText(indexFilePath, dartString.ToString());
|
|
|
}
|
|
|
}
|