Friday, March 30, 2018

Use Shared Preferences in a Flutter App to save variable values permanently



SharedPreferences allow us to save or store variable values in memory after app destroyed. Using this way you can keep values of variable even if you turned of your device. As a example flag value or a count value is a little thing, so we don't want to write lenghthy codes to store in databases, using few lines we can save these variables values. However if you want to store complex data/ relational data, you have to use databases or files(JSON, CSV or TXT).


You can visit this website to get details about how to use SharedPreferences in Dart.


This is the complete code for the Simple Poll App. I used this example app to explain SharedPreferences, ButtonBar Widget, BottomAppBar Widget and for other things.


2 comments:

  1. https://fluttercorner.com/how-to-store-and-get-data-from-shared-preferences-in-flutter/

    ReplyDelete
  2. How To Set Up Bottom Navigation Bar In Flutter App

    The Material Design specification describes a bottom navigation bar as a row of three buttons at the bottom of the screen that are used to select among as many destinations..

    For More Info:- How To Set Up Bottom Navigation Bar In Flutter App

    ReplyDelete