Flutter 使用 SQLite 本地資料庫
依照官網的教學,是直接在main()
裡面進行所有操作,但是為了看起來更好閱讀更簡潔,建議新增一個單獨的資料夾database/
,裡面存放要建立的${dbName}.dart
檔案。
用TodoList當作範例:
資料夾結構如下:
lib/
- database/
⊢ TodoDB.dart
- pages/
⊢ TodoList.dart
- app.dart
- main.dart
These were the top 10 stories published by 再不寫就要忘了; you can also dive into yearly archives: 2019, 2020.