2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2026-04-03 17:58:21 +00:00

Make strings nullable

This commit is contained in:
Mohammed Salman
2022-01-24 20:15:36 +03:00
parent 42087e2795
commit 599a9078b2
2 changed files with 9 additions and 3 deletions

View File

@@ -377,10 +377,12 @@ class TemplateGenerator {
});
template.properties.forEach((p) {
var ptTypeName = getTypeName(template, p.valueType, templates, true);
rt.writeln("${ptTypeName} get ${p.name} { return get(${p.index}); }");
final ptTypeName = getTypeName(template, p.valueType, templates, true);
final suffix = p.valueType.type == DataType.String ? "?" : "";
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) {