File System Operations
Learn to read from and write to the device's file system, enabling storage of larger files and custom data formats.
Storing Data in Files
Sometimes, your app needs to store data directly on the device. This is where file system operations come in! Unlike shared_preferences (for small key-value data) or sqflite (for structured data), file system operations allow you to manage files directly.
You can store larger pieces of data, like images, audio, or custom formatted text files, that don't fit well into a database or simple key-value pairs.
Where to Store Files?
Before you can read or write files, your app needs to know where it can store them. Flutter provides the path_provider package to help you find common directory paths safely across different platforms (iOS, Android, web, desktop).
- Application Documents Directory: This is where your app can store user-specific data that should persist.
- Temporary Directory: For data that doesn't need to persist across app launches, like cached files.
All lessons in this course
- Shared Preferences for Data
- SQLite Database Integration
- File System Operations
- Hive & NoSQL Local Storage