import 'package:eatvio_app/core/locator_service.dart'; import 'package:shared_preferences/shared_preferences.dart'; abstract class CredentialsStorage { static bool haveCredentialsInStorage() { try { if (sl().getString('email') == null || sl().getString('password') == null) { return false; } else { return true; } } catch (e) { return false; } } static Map getCredentialsFromStorage() { return { 'email': (sl().getString('email'))!, 'password': (sl().getString('password'))!, }; } static Future saveCredentials(String email, String password) async { await sl().setString('email', email); await sl().setString('password', password); } static Future removeCredentials() async { sl().remove('email'); sl().remove('password'); } }