Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - How to save data locally?

Tags:

flutter

dart

I'm making a simple "dictionary" app to learn Flutter. The basic idea is that the user can add a word to his dictionary.

I have a class named Word (term, definition, examples in a list) but now I need to save the added words so the user can maintain them even when he closes the app.

I've heard about shared preferences and SQLite database but what would be the best approach in this case?

like image 456
btm2424 Avatar asked Sep 14 '25 22:09

btm2424


1 Answers

There are many packages for local storage in flutter:

Here is some:

1. Shared_preferences

Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.

2. Sqflite

Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine.

3. Hive

Lightweight and blazing fast key-value database written in pure Dart. Strongly encrypted using AES-256.

4. Sembast

NoSQL persistent embedded file system document-based database for Dart VM and Flutter with encryption support.

5. Flutter_secure_storage

Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.

6. Moor Moor is a safe and reactive persistence library for Dart applications

7. Floor

The typesafe, reactive, and lightweight SQLite abstraction for your Flutter applications. This library is the runtime dependency.

8. Localstorage

Simple json file-based storage fo flutter. Alternative to react-native AsyncStorage

9. Objectbox

ObjectBox is a super-fast NoSQL ACID compliant object database.

10. Json_store

A Flutter storage solution somewhat similar to a browser's localStorage (but super powered)

like image 192
Kabirou Agouda Avatar answered Sep 17 '25 12:09

Kabirou Agouda