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

Dont make a param optional if it already is

This commit is contained in:
Mohammed Salman
2022-01-21 23:12:18 +03:00
parent f998dc01d6
commit 32df06dc44

View File

@@ -355,14 +355,13 @@ class TemplateGenerator {
if (f.arguments.isNotEmpty && namedArgs) { if (f.arguments.isNotEmpty && namedArgs) {
rt.write("{"); rt.write("{");
} }
final typeSuffix = namedArgs ? "?" : ""; rt.write(f.arguments.map((x) {
rt.write(f.arguments final typeName = getTypeName(template, x.type, templates, true);
.map((x) => return typeName +
getTypeName(template, x.type, templates, true) + (namedArgs && !typeName.endsWith("?") ? "?" : "") +
typeSuffix + " " +
" " + x.name;
x.name) }).join(","));
.join(","));
if (f.arguments.isNotEmpty && namedArgs) { if (f.arguments.isNotEmpty && namedArgs) {
rt.write("}"); rt.write("}");
} }