Playing with Shared Preferences in Flutter🎉
2 min readFeb 1, 2021
Hi guys, Hope you all are doing fine. Today we will take about the usage of shared preferences in a flutter 😃
What are Shared Preferences?
In simple words shared preferences allow you to store small amounts of primitive data as key/value pairs in a file on the device.
Let’s start 😉
How do we use shared preferences in Flutter?
First, install the shared preference dependency in your project 👌
Step 1: Add dependency
Step 2: Creating a service class for the shared preferences.
Step 2: Storing data in SF 🔒
Step 3: Getting data from SF✊🏼
Step 4: Removing data from SF️🔥
How to check the data is present in SF or not?
For this, we have a method called to contain.
Hurray…!!!🥳🥳🥳
Now we know how to use shared preferences✌🏽. Support me by giving clap and follow me if you like it🙏🏽