Learn about persistent storage in Flutter - how to persist data to disk in Flutter apps via shared_preferences plugin.

In this tutorial we are going to elaborate on what are the common ways to add support for persistent storage in Flutter apps. More precisely, we are going to create a real app, and showcase in details how to persist data to disk in Flutter apps.

persistent storage flutter

Most of the mobile applications today store some data that will be used again and again every time the application is launched. On mobile devices, the application can run in the background or exit at any time. While exiting, the app can be in any state. Now, it is necessary for the application code to take care of this without the users having to concern themselves on whether that data of a particular state has been appropriately stored for later access. The management and handling of such a state are known as data persistence which can be done by applying a persistent storage mechanism in the Flutter application. It is necessary to retain the data that was before the application has been shut off.

In this tutorial, we are going to learn about using persistent storage in the Flutter apps for data persistence. For that, we are going to make use of the package called shared_preferences. Then, we are going to implement the login state or user’s logged-in session handling as an example use-case to demonstrate the use of persistent storage in the Flutter. Along the way, we will also learn the use of different UI widgets as well as configurations to handle the state of different screens. So, let’s get started!

#flutter

Persistent Storage in Flutter
14.40 GEEK