运营商 '[]'

The operator '[]'

app.post('/signup', (req, res) async {
    var body = await req.parseBody();

    var name = body['name'];
    var email = body['email'];
    var phone = body['phone'];
    var pass = body['pass'];
    var image = body['image'];
  });

21:21:错误:未为 class 'void' 定义运算符“[]”。 尝试将运算符更正为现有运算符,或定义“[]”运算符。

我想你正在使用 Angel,所以试试这个:

await req.parseBody();

var name = req.bodyAsMap['name'];