List<Todo>todos=[Todo('example'),Todo('example'),Todo('example'),Todo('example')];
//here should be the db provide class
for(Todo iteam in todos){
// do the insert functionality
// here try the way you insert single todo in db
db.insert(iteam.toJson())
}
1条答案
按热度按时间tf7tbtn21#
实际上,你不可能通过一个函数插入所有数据,但你可以在循环的帮助下做到。你可以在列表的长度的时候循环,并在它为真的时候插入!它太简单了