简体   繁体   English

不能在 Flutter(Dart) 中使用 final

[英]Can't use final in Flutter(Dart)

I can't understand what's the problem in my code.我不明白我的代码有什么问题。 This is my code:这是我的代码:

在此处输入图像描述

And this is the error:这是错误:

在此处输入图像描述

You cannot declare variables inside a list.您不能在列表中声明变量。

Move this line final rows = await db.queryAllRows();将此行移至final rows = await db.queryAllRows(); and put it after this line: if (rowCount != 0) { .并将其放在这一行之后: if (rowCount != 0) {

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM