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 再不寫就要忘了 in 2020. You can also dive into monthly archives for 2020 by using the calendar at the top of this page.