Browse Source

修复当属性为小写字母时,生成的dart为大写的问题。

Felix 2 years ago
parent
commit
e991800f00
1 changed files with 5 additions and 0 deletions
  1. 5 0
      LetterConverterHelper.cs

+ 5 - 0
LetterConverterHelper.cs

@@ -26,6 +26,11 @@ namespace FlutterCodeGenerator
         {
             if (string.IsNullOrEmpty(input))
                 return input;
+            var firstChar = input[0];
+            if (firstChar >= 'a' && firstChar <= 'z')//该首字母小写
+            {
+                return input;
+            }
             var str = input.First().ToString().ToUpper() + input.Substring(1);
             return str;
         }