Flutter Tutorial - Shared Preferences - Store & Load Data For Data Persistence

HeyFlutter․com · 73K views · 2021 · 10:59

Open on YouTube

Software (other)Software practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering Flutter questions about saving small amounts of data on the user's device, such as likes or settings, and when SharedPreferences values are not persisting.

Recommended by 3 people across 3 different months, 2021 to 2023.

What it is

A roughly 11-minute Flutter tutorial by Johannes Milke (HeyFlutter) showing how to use the SharedPreferences plugin to store and load data locally so it survives app restarts. It walks through a simple example app and provides the source code on GitHub.

What people said

Recommends Sosu Alfred · 2021-09 · Stack Overflow · on “How can I save user data on user's local device in Flutter?”

To store data locally on the user device you do not need to implement any auth functionality. To persist data locally on a device you can use any of the following Sqflite [LINK] , Moor [LINK] , Shared Preferences [LINK] , GetX Storage [LINK] I find GetX Storage the easiest way to store data that has no relationships. This is a tutorial on shared preferences: [this video] This is also a tutorial for GetX Storage: [LINK]

Recommends liam spiegel · 2022-12 · Stack Overflow · on “how to store likes data in flutter”

Solution Use Shared Preferences [LINK] ! This is something like a database on the device you are currently running. So if the user makes a like you can save that on their device! To add Shared Preferences to your app look this [this video] video Hope it helps!

Recommends Elia Driesner · 2023-06 · Stack Overflow · on “Flutter shared prefrences dont save”

Solution: [this video] He made a class for handeling everything, i did it myself and now its working, just wanted to let others with the same problem know how to solve it