From fc60062b144eb63c2a815bcb045da5a9736e8eb0 Mon Sep 17 00:00:00 2001 From: Bernardo Veras Date: Tue, 23 Aug 2022 20:22:29 -0300 Subject: [PATCH 1/2] add new configuration to capitalize key to map ... --- package.json | 9 +++++++++ src/extension.js | 1 + 2 files changed, 10 insertions(+) diff --git a/package.json b/package.json index a2d4938..116a708 100644 --- a/package.json +++ b/package.json @@ -209,6 +209,15 @@ ], "default": false, "description": "If true, uses equatable for value equality and hashcode." + }, + "dart_data_class_generator.capitalize.enabled": { + "type": "boolean", + "enum": [ + true, + false + ], + "default": false, + "description": "If true, the key will be capitalized." } } } diff --git a/src/extension.js b/src/extension.js index 268493e..d5c8140 100644 --- a/src/extension.js +++ b/src/extension.js @@ -607,6 +607,7 @@ class ClassField { this.rawType = type; this.name = toVarName(name); this.key = json ? name : varToKey(this.name); + if (readSetting('capitalize.enabled')) this.key = capitalize(this.key); this.line = line; this.isFinal = isFinal; this.isConst = isConst; From ccaa4c549910c05db240b51a9abb418a56f9c9cd Mon Sep 17 00:00:00 2001 From: Bernardo Veras Date: Tue, 23 Aug 2022 20:27:11 -0300 Subject: [PATCH 2/2] increment version --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1c7f7..cd232de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 0.5.4 + +Added new setting to capitalize Key + ## 0.5.0 Added support for enums diff --git a/package.json b/package.json index 116a708..bed2602 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Dart Data Class Generator", "description": "Create dart data classes easily, fast and without writing boilerplate or running code generation.", "publisher": "dotup", - "version": "0.5.3", + "version": "0.5.4", "engines": { "vscode": "^1.37.0" },