0

私はflutter 2.0.6リリースを持っていnull saftyます はサポートされています ディレクトリにファイルを作成しました ファイルuser.jsonassets/models次のコードを書きました:

{
   "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.
4

0 に答える 0