This file contains 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'; | |
/* | |
Recordar instalar el paquete de: | |
shared_preferences: | |
Inicializar en el main | |
final prefs = new PreferenciasUsuario(); | |
await prefs.initPrefs(); | |
This file contains 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
//Post it in a handler to make sure it gets called if coming back from a lifecycle method. | |
new Handler().post(new Runnable() { | |
@Override | |
public void run() | |
{ | |
Intent intent = getActivity().getIntent(); | |
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | |
| Intent.FLAG_ACTIVITY_NO_ANIMATION); | |
getActivity().overridePendingTransition(0, 0); |