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 a2d4938..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" }, @@ -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;