【发布时间】:2019-08-29 10:42:56
【问题描述】:
我需要从 SQLite 数据库的 2 列中检索值,并且我正在使用辅助查询对其进行查询。
我尝试通过索引值。
print("In the login List : "+ lg[0].toString());
但我得到了
In the login List : {email: xxxx@gmail.com, password: xxxx}
Future<bool> loginUser(String username, String password) async {
bool isSuccess;
Database db = await this.database;
List<Map<String, dynamic>> lg = await db.query(regTable,
columns: [colEmail, colPassword],
where: "$colEmail = ? AND $colPassword = ?",
whereArgs: [username, password]);
if (lg.length > 0) {
print("In the login List : "+ lg[0].toString());
isSuccess = true;
} else {
isSuccess = false;
}
return isSuccess;
}
我需要能够分别检索电子邮件和密码。
喜欢,
print(Email : lg(email));
【问题讨论】:
标签: database list sqlite dart flutter