Skip to content

Commit

Permalink
apptreesoftware#2, map literals
Browse files Browse the repository at this point in the history
  • Loading branch information
unicomp21 committed Sep 26, 2021
1 parent e09953e commit 05efcac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class {{.Name}} {
factory {{.Name}}.fromJson(Map<String,dynamic> json) {
{{- range .Fields -}}
{{if .IsMap}}
var {{.Name}}Map = {{.Type}}();
var {{.Name}}Map = {{.Type[3:len(.Type)]}}{};
(json['{{.JSONName}}'] as Map<String, dynamic>).forEach((key, val) {
{{if .MapValueField.IsMessage}}
{{.Name}}Map[key] = {{.MapValueField.Type}}.fromJson(val as Map<String,dynamic>);
Expand Down

0 comments on commit 05efcac

Please sign in to comment.