showGuestModal static method
Muestra el diálogo y configura la redirección (Privado)
Implementation
static void showGuestModal(BuildContext context, {String? redirectRoute, dynamic arguments}) {
Sint.dialog(
AlertDialog(
backgroundColor: AppColor.scaffold,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
title: Text(AppTranslationConstants.accountRequired.tr,
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)
),
content: Text(AppTranslationConstants.guestActionPrompt.tr,
style: TextStyle(color: Colors.white70),
),
actions: [
TextButton(
onPressed: () => Navigator.of(context, rootNavigator: true).pop(),
child: Text(AppTranslationConstants.continueExploring.tr, style: TextStyle(color: Colors.grey)),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppColor.getReleaseShelfColor(),
foregroundColor: Colors.white,
shape: const StadiumBorder()
),
onPressed: () {
// Sint.back();
// 2. Apagar modo invitado (para que RootPage sepa que vamos al Login real)
AppConfig.instance.isGuestMode = false;
// 3. Ir al Login llevando la "Promesa" de redirección
Sint.offAllNamed(
AppRouteConstants.login,
arguments: {
'nextRoute': redirectRoute,
'nextArgs': arguments
}
);
},
child: Text(AppTranslationConstants.loginSignup.tr,),
),
],
),
barrierDismissible: true, // Permite cerrar tocando fuera
);
}