Last active
June 4, 2020 15:24
-
-
Save Yhomarth/76a612ce9c31345ba06a0565523ba897 to your computer and use it in GitHub Desktop.
Sample of shared preference on flutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:shared_preferences/shared_preferences.dart'; | |
| class PreferenciasUsuario { | |
| static final PreferenciasUsuario _instancia = new PreferenciasUsuario._(); | |
| factory PreferenciasUsuario() { | |
| return _instancia; | |
| } | |
| SharedPreferences _prefs; | |
| initPrefs() async { | |
| this._prefs = await SharedPreferences.getInstance(); | |
| } | |
| PreferenciasUsuario._(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment