Use Local Storage in Flutter

Use the shared_preferences Plugin

Add shared_preferences as a dependency in your pubspec.yaml file:

SharedPreferences storage = await SharedPreferences.getInstance();
int counter = (storage.getInt('counter') ?? 0) + 1;

await storage.setInt('counter', counter);

Use SQLite

Use regular files

Subscribe to My Newsletter

The latest programming-related news, articles and resources - sent to your inbox monthly. Unsubscribe anytime.