แอปมักต้อง เก็บข้อมูลแบบ local บนอุปกรณ์ — การตั้งค่าของผู้ใช้, ข้อมูลที่ cache ไว้, เนื้อหา offline Flutter มีตัวเลือกหลายแบบ — shared_preferences (key-value), SQLite (relational) และอื่น ๆ — แต่ละแบบเหมาะกับความต้องการที่ต่างกัน
ตัวเลือกการจัดเก็บแบบ local
SHARED_PREFERENCES → simple KEY-VALUE storage (settings, flags, small data):
→ store primitives (strings, ints, bools) — like a simple persistent map
→ for: user preferences, tokens, simple flags (NOT large/structured data)
SQLITE (sqflite) → a full relational DATABASE on the device:
→ tables, SQL queries — for STRUCTURED, larger data; complex queries; relationships
HIVE / ISAR → fast NoSQL local databases (key-value/object stores) — popular, fast,
Dart-native (no SQL); good for structured local data
FILE storage → read/write files directly (path_provider for directories)
SECURE storage → flutter_secure_storage for SENSITIVE data (tokens, credentials) —
encrypted (keychain/keystore)
