Skip to main content

Posts

Showing posts with the label flutter shared preference

Flutter: SharedPreferences tutorial | How to setup SharedPreferences ?

Introduction Data saving and storing is a common practice in applications. We have many options like SQL, NoSQL and SharedPreference. The first two options are mainly focused on large amounts of data with large transactions with constant efficiency. If you want only to store the user progress in terms of levels the user crossed or name and age of user or if the user wants to turn off or on the music of the application. Here comes the SharedPreferences data saving type. So we will learn how to save data in our app using SharedPreference and then call the data. Table of contents Approach Project setup Code Conclusion Approach We need to add the plugin for SharedPreference in our project. After that, we need to instantiate the SharedPreference object in our class. After that, if we need to save data we will call the .set() method and for retrieving we need to call .ge...