import 'package:shared_preferences/shared_preferences.dart'; /// Persists whether the 9-screen help/tutorial carousel (`PantallaTutorialAyuda`) /// has already been shown, so it renders once on the genuine first-run /// sequence rather than on every launch. /// /// Same injectable-`SharedPreferences`, versioned-key convention as /// `ServicioBienvenida` -- a plain one-time boolean flag, not a per-app-version /// "due again" scheme like `ServicioContenidoApp` uses: no existing user has /// this flag set yet, regardless of whether they are a fresh install or an /// upgrade, so a single flag already satisfies "show once, ever". class ServicioTutorialAyuda { ServicioTutorialAyuda({SharedPreferences? prefs}) : _prefs = prefs; static const _keyTutorialVisto = 'pluri_tutorial_visto_v1'; final SharedPreferences? _prefs; /// Injected startup instance (S3-R4); getInstance() is only a fallback. Future _resolverPrefs() async => _prefs ?? SharedPreferences.getInstance(); Future debeMostrarTutorial() async { final prefs = await _resolverPrefs(); return !(prefs.getBool(_keyTutorialVisto) ?? false); } Future marcarTutorialVisto() async { final prefs = await _resolverPrefs(); await prefs.setBool(_keyTutorialVisto, true); } }