import 'package:fikoyt_sistem/apps/uyar/core/base_sol_menu.dart'; import 'package:fikoyt_sistem/apps/uyar/core/uyar_service.dart'; import 'package:fikoyt_sistem/main.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:flutter/material.dart'; class AdminSolMenu extends StatelessWidget { AdminSolMenu({super.key}); final UyarService uyarServis = Get.put(UyarService()); @override Widget build(BuildContext context) { return BaseSolMenu( solMenuUst: Padding( padding: const EdgeInsets.all(8.0), child: Stack(alignment: Alignment.centerLeft, children: [ FikoYTButton( text: Icon(Icons.arrow_back, size: 22, color: Colors.greenAccent), tema: FikoYTButtonTheme(fontSize: 14, edgePadding: EdgeInsets.all(3), radius: 5), onPressed: () { context.vRouter.to("/uyar/kisi/ana-sayfa"); }, ), Column( children: [ Image.asset("packages/fikoyt_ui/assets/core/icons/fikoyt-4.png", height: 32), // Align( // alignment: Alignment.centerRight, // child: Text( // "Özel Üye", // style: TextStyle(color: Colors.black45, fontSize: 12, fontWeight: FontWeight.bold), // ), // ), ], ), ], ), ), solMenu: Column( children: [ SizedBox(height: 5), Stack( children: [ Row( spacing: 2, children: [ FikoYTButton( text: "👑", tema: FikoYTButtonTheme( fontSize: 14, edgePadding: EdgeInsets.all(3), radius: 5, backgroundColor: context.vRouter.url.startsWith("/uyar/admin") ? Colors.white : Colors.transparent, ), // onPressed: () { // // context.vRouter.to("/uyar/admin"); // }, ).animate( delay: Duration(milliseconds: 500), effects: [ FadeEffect(duration: 1000.ms, begin: 0.4, end: 1), ScaleEffect(duration: 2000.ms, begin: Offset(1, 1), end: Offset(1.1, 1.1)), ], onComplete: (controller) { controller.repeat(reverse: true); }, ), Spacer(), FikoYTButton( text: Icon(Icons.power_off, size: 22, color: Colors.red), tema: FikoYTButtonTheme(fontSize: 14, edgePadding: EdgeInsets.all(3), radius: 5), onPressed: () { context.vRouter.to("/uyar/kisi/ana-sayfa"); }, ), ], ), FikoytOvalResim( resimUrl: "https://fikoyt.com:9000/fapiv1/fikoyt.com.FikoYT.sistem.kullanici.${uyarServis.aktifKullanici.value?['_id']?.toString()}.profilResmi?boyut=128x?&t=0.8143431303498987", tema: FikoYTOvalResimTheme(borderColor: Colors.blue, radius: 36, spacing: 7), ), ], ), FikoYTButton( text: "${uyarServis.aktifKullanici.value?['isim'] ?? ""} ${uyarServis.aktifKullanici.value?['soyIsim'] ?? ""}", tema: FikoYTButtonTheme( fontSize: 12, fontWeight: FontWeight.w600, edgePadding: EdgeInsets.all(0), radius: 0, backgroundColor: Colors.transparent, textColor: Colors.black87, ), ), FikoYTButton( text: "Süper Yönetici", tema: FikoYTButtonTheme( fontSize: 12, fontWeight: FontWeight.bold, edgePadding: EdgeInsets.all(0), radius: 0, backgroundColor: Colors.transparent, textColor: Colors.yellow, textStrokeColor: Colors.black, textStrokeWidth: 2, ), ), Divider(height: 4), SizedBox(height: 5), SolMenuItem( icon: Icons.dashboard, label: 'Ana pencere', selected: context.vRouter.url.startsWith("/uyar/admin/ana-sayfa"), onTap: () { context.vRouter.to("/uyar/admin/ana-sayfa"); }, ), SolMenuItem( icon: Icons.person_2, label: 'Kullanıcılar', selected: context.vRouter.url.startsWith("/uyar/admin/kullanicilar"), onTap: () { context.vRouter.to("/uyar/admin/kullanicilar"); }, ), ], ), solMenuAlt: Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ FikoYTButton( text: "🎧", tema: FikoYTButtonTheme( fontSize: 16, edgePadding: EdgeInsets.all(5), radius: 5, backgroundColor: context.vRouter.url.startsWith("/uyar/uye/iletisim") ? Colors.white : Colors.transparent, ), onPressed: () { context.vRouter.to("/uyar/uye/iletisim"); }, ), Spacer(), FikoYTButton( text: "⚙️", tema: FikoYTButtonTheme( fontSize: 16, edgePadding: EdgeInsets.all(5), radius: 5, backgroundColor: context.vRouter.url.startsWith("/uyar/uye/ayarlar") ? Colors.white : Colors.transparent, ), onPressed: () { context.vRouter.to("/uyar/uye/ayarlar/ana-sayfa"); }, ), ], ), ), ); } } class SolMenuItem extends StatefulWidget { final IconData icon; final String label; final bool selected; final VoidCallback onTap; const SolMenuItem({super.key, required this.icon, required this.label, required this.selected, required this.onTap}); @override State createState() => _SolMenuItemState(); } class _SolMenuItemState extends State { bool isHovered = false; bool isPressed = false; bool isFocused = false; @override Widget build(BuildContext context) { final isSelected = widget.selected; Color getBackgroundColor() { if (isSelected) return Colors.white; if (isPressed) return Colors.black.withOpacity(0.05); if (isHovered) return Colors.white.withOpacity(0.15); return Colors.transparent; } Color getBorderColor() { // if (isSelected) return const Color(0xFF00A67E); // if (isFocused) return Colors.blueAccent.withOpacity(0.8); // if (isHovered) return Colors.grey.withOpacity(0.4); return Colors.transparent; } return Focus( onFocusChange: (focus) => setState(() => isFocused = focus), child: MouseRegion( onEnter: (_) => setState(() => isHovered = true), onExit: (_) => setState(() => isHovered = false), cursor: SystemMouseCursors.click, child: GestureDetector( onTapDown: (_) => setState(() => isPressed = true), onTapUp: (_) => setState(() => isPressed = false), onTapCancel: () => setState(() => isPressed = false), onTap: widget.onTap, child: AnimatedContainer( duration: const Duration(milliseconds: 100), margin: const EdgeInsets.symmetric(horizontal: 14, vertical: 0), padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10), decoration: BoxDecoration( color: getBackgroundColor(), borderRadius: BorderRadius.circular(6), border: Border.all(color: getBorderColor(), width: 0), ), child: Row( children: [ Icon(widget.icon, color: Colors.black87, size: 24), const SizedBox(width: 20), Text( widget.label, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.black87), ), ], ), ), ), ), ); } }