Flutter 颤振:Get_Cli/无法使用Get_Cli 1.5.0在颤振中生成用户模型代码
我有一个Flutter 颤振:Get_Cli/无法使用Get_Cli 1.5.0在颤振中生成用户模型代码,flutter,dart,getx,flutter-getx,get-cli,Flutter,Dart,Getx,Flutter Getx,Get Cli,我有一个flatter2.0.6版本 支持空安全性 我在assets/models目录中创建了一个文件user.json 我在文件中编写了以下代码: { "name": "", "age": 0, "friends": ["",""] } 我运行了下面的命令: get generate model on home with assets/models/use
flatter2.0.6
版本
支持空安全性
我在assets/models
目录中创建了一个文件user.json
我在文件中编写了以下代码:
{
"name": "",
"age": 0,
"friends": ["",""]
}
我运行了下面的命令:
get generate model on home with assets/models/user.json
这个错误在我看来,我不知道该怎么解决
✖ + error_unexpected Could not format because the source could not be parsed:
line 4, column 3 of .: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
╷
4 │ List?<String> friends;
│ ^^^^
╵
line 4, column 3 of .: Expected to find ';'.
╷
4 │ List?<String> friends;
│ ^^^^
╵
line 4, column 17 of .: A function body must be provided.
╷
4 │ List?<String> friends;
│ ^^^^^^^
╵
line 4, column 17 of .: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
╷
4 │ List?<String> friends;
│ ^^^^^^^
╵
line 4, column 7 of .: The string '?' isn't a user-definable operator.
╷
4 │ List?<String> friends;
│ ^
╵
line 4, column 7 of .: Methods must have an explicit list of parameters.
╷
4 │ List?<String> friends;
│ ^
╵
line 4, column 7 of .: Operator declarations must be preceded by the keyword 'operator'.
╷
4 │ List?<String> friends;
│ ^
╵
line 4, column 8 of .: Types parameters aren't allowed when defining an operator.
╷
4 │ List?<String> friends;
│ ^^^^^^^^
╵
Time: 517 Milliseconds
'pub' is not recognized as an internal or external command,
operable program or batch file.
✖ + 错误\u无法格式化,因为无法分析源:
第4行,第3列。:必须使用关键字“const”、“final”、“var”或类型名声明变量。
╷
4.│ 列表朋友;
│ ^^^^
╵
第4行,第3列。:应找到“;”。
╷
4.│ 列表朋友;
│ ^^^^
╵
第4行第17列:必须提供功能体。
╷
4.│ 列表朋友;
│ ^^^^^^^
╵
第4行,第17列。:必须使用关键字“const”、“final”、“var”或类型名声明变量。
╷
4.│ 列表朋友;
│ ^^^^^^^
╵
第4行,第7列。:字符串“?”不是用户可定义的运算符。
╷
4.│ 列表朋友;
│ ^
╵
方法的第4行第7列必须有一个明确的参数列表。
╷
4.│ 列表朋友;
│ ^
╵
第4行,第7列。:运算符声明前面必须有关键字“Operator”。
╷
4.│ 列表朋友;
│ ^
╵
定义运算符时,不允许使用类型参数的第4行第8列。
╷
4.│ 列表朋友;
│ ^^^^^^^^
╵
时间:517毫秒
“pub”未被识别为内部或外部命令,
可操作的程序或批处理文件。