import 'package:flutter/material.dart'; class AnimatedInteractiveDrawer extends StatefulWidget { const AnimatedInteractiveDrawer({super.key}); @override State createState() => _AnimatedInteractiveDrawerState(); } class _AnimatedInteractiveDrawerState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; @override void initState() { super.initState(); _controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 500), ); } @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Drawer( child: Container( decoration: const BoxDecoration( gradient: LinearGradient( colors: [ Color(0xFF1E202B), Color(0xFF323649), Color(0xFF1E202B), ], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const SizedBox(height: 50), const _AnimatedProfileHeader(), const SizedBox(height: 16), // Menü Öğeleri _buildInteractiveMenuItem(Icons.home, "Ana Sayfa"), _buildInteractiveMenuItem(Icons.settings, "Ayarlar"), _buildInteractiveMenuItem(Icons.favorite, "Favorilerim"), _buildInteractiveMenuItem(Icons.info, "Hakkında"), const Spacer(), // Çıkış Padding( padding: const EdgeInsets.all(16.0), child: _buildInteractiveMenuItem(Icons.exit_to_app, "Çıkış Yap"), ), ], ), ), ); } Widget _buildInteractiveMenuItem(IconData icon, String title) { return GestureDetector( onTap: () => debugPrint('$title tıklandı'), child: MouseRegion( onEnter: (event) => _controller.forward(), onExit: (event) => _controller.reverse(), child: AnimatedBuilder( animation: _controller, builder: (context, child) { final scale = 1.0 + _controller.value * 0.1; final glow = 0.2 + _controller.value * 0.5; return Transform.scale( scale: scale, child: Container( margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white.withOpacity(glow), borderRadius: BorderRadius.circular(12), boxShadow: [ BoxShadow( color: Colors.cyanAccent.withOpacity(glow), blurRadius: 20, spreadRadius: 5, ), ], ), child: Row( children: [ Icon(icon, color: Colors.white, size: 28), const SizedBox(width: 12), Text( title, style: const TextStyle( color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold, ), ), ], ), ), ); }, ), ), ); } } class _AnimatedProfileHeader extends StatelessWidget { const _AnimatedProfileHeader(); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Column( children: [ // Holografik Profil Avatarı Center( child: Stack( alignment: Alignment.center, children: [ // Arka Plan Halo AnimatedContainer( duration: const Duration(seconds: 2), curve: Curves.easeInOut, width: 120, height: 120, decoration: BoxDecoration( shape: BoxShape.circle, gradient: RadialGradient( colors: [Colors.cyan.withOpacity(0.4), Colors.blueAccent.withOpacity(0.2), Colors.transparent], ), ), ), // Profil Resmi Container( width: 100, height: 100, decoration: const BoxDecoration( shape: BoxShape.circle, gradient: LinearGradient( colors: [Colors.blue, Colors.purple], begin: Alignment.topLeft, end: Alignment.bottomRight, ), ), child: const Icon( Icons.person, size: 50, color: Colors.white, ), ), ], ), ), const SizedBox(height: 16), // Kullanıcı Adı const Text( "Kullanıcı Adı", style: TextStyle( color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold, ), ), const SizedBox(height: 8), // E-posta const Text( "kullanici@example.com", style: TextStyle( color: Colors.white70, fontSize: 14, ), ), ], ), ); } }