2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2026-04-03 17:58:21 +00:00
This commit is contained in:
Mohammed Salman
2022-01-24 20:21:39 +03:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

View File

@@ -72,6 +72,10 @@ printUsage() {
print(""); print("");
print("Available commands:"); print("Available commands:");
print("\tget-template\tGet a template from an IIP link."); print("\tget-template\tGet a template from an IIP link.");
print("\t\tFlags:");
print("\t\t\t-x, --getx\tGenerate apropriate getx bindings for resources.");
print(
"\t\t\t--namedargs\tUse named arguments instead of positional arguments for resource methods");
print("\tversion: print esiur version."); print("\tversion: print esiur version.");
print(""); print("");
print("Global options:"); print("Global options:");

View File

@@ -377,10 +377,12 @@ class TemplateGenerator {
}); });
template.properties.forEach((p) { template.properties.forEach((p) {
var ptTypeName = getTypeName(template, p.valueType, templates, true); final ptTypeName = getTypeName(template, p.valueType, templates, true);
rt.writeln("${ptTypeName} get ${p.name} { return get(${p.index}); }"); final suffix = p.valueType.type == DataType.String ? "?" : "";
rt.writeln( rt.writeln(
"set ${p.name}(${ptTypeName} value) { set(${p.index}, value); }"); "$ptTypeName$suffix get ${p.name} { return get(${p.index}); }");
rt.writeln(
"set ${p.name}($ptTypeName$suffix value) { set(${p.index}, value); }");
}); });
template.events.forEach((e) { template.events.forEach((e) {