fix: mover toggle dia/noche al navbar como icono

- Icono sol/luna con animacion de rotacion en navbar
- Navbar cambia color segun el tema (animado)
- Quitar toggle del sidebar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-27 08:41:27 -05:00
co-authored by Claude Sonnet 4.6
parent 9c61a35747
commit 6f39bbf9e2
2 changed files with 119 additions and 159 deletions
-75
View File
@@ -3,7 +3,6 @@ import 'package:prosapp_web_app/providers/auth_provider.dart';
import 'package:prosapp_web_app/providers/professional_provider.dart';
import 'package:prosapp_web_app/providers/services_provider.dart';
import 'package:prosapp_web_app/providers/sidemenu_provider.dart';
import 'package:prosapp_web_app/providers/theme_provider.dart';
import 'package:prosapp_web_app/router/router.dart';
import 'package:prosapp_web_app/services/navigation_service.dart';
import 'package:prosapp_web_app/services/notifications_service.dart';
@@ -26,7 +25,6 @@ class Sidebar extends StatelessWidget {
final sideMenuProvider = Provider.of<SideMenuProvider>(context);
final authProvider = Provider.of<AuthProvider>(context, listen: false);
final professionalProvider = Provider.of<ProfessionalProvider>(context);
final themeProvider = Provider.of<ThemeProvider>(context);
return Container(
width: 220,
@@ -190,79 +188,6 @@ class Sidebar extends StatelessWidget {
onPressed: () => authProvider.logout(),
),
const SizedBox(height: 20),
// ── Toggle día / noche ──
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
child: GestureDetector(
onTap: themeProvider.toggle,
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
decoration: BoxDecoration(
color: themeProvider.isDark
? const Color(0xFF1E293B)
: Colors.white.withOpacity(0.08),
borderRadius: BorderRadius.circular(10),
border: Border.all(
color: Colors.white.withOpacity(0.12),
),
),
child: Row(
children: [
AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
child: Icon(
themeProvider.isDark
? Icons.light_mode_outlined
: Icons.dark_mode_outlined,
key: ValueKey(themeProvider.isDark),
color: themeProvider.isDark
? Colors.amber
: const Color(0xFF8BAFD4),
size: 18,
),
),
const SizedBox(width: 10),
Text(
themeProvider.isDark ? 'Modo día' : 'Modo noche',
style: const TextStyle(
color: Color(0xFF8BAFD4),
fontSize: 13,
),
),
const Spacer(),
AnimatedContainer(
duration: const Duration(milliseconds: 250),
width: 36,
height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: themeProvider.isDark
? const Color(0xFF42A4EF)
: Colors.white.withOpacity(0.2),
),
child: AnimatedAlign(
duration: const Duration(milliseconds: 250),
alignment: themeProvider.isDark
? Alignment.centerRight
: Alignment.centerLeft,
child: Container(
margin: const EdgeInsets.all(3),
width: 14,
height: 14,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
),
),
],
),
),
),
),
],
),
);