import 'dart:io'; import 'package:fikoyt_sistem/apps/core/base_window.dart'; import 'package:fikoyt_sistem/apps/uyar/uye/ana_sayfa/ana_sayfa.dart'; import 'package:fikoyt_ui/core/http_overrides.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:fikoyt_ui/ui/windows_baslik_cubugu/windows_uygulama_baslik.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; void main() async { HttpOverrides.global = HttpSSlIptalUzerineYaz(); // ignore: unused_local_variable // await FikoYTCoreService.init( settings: FikoYTServiceSettings( appSettings: FikoYTAppSettings( uygulamaIsmi: "FikoYT Uyar", routes: [ VWidget( path: '/', widget: BaseWindow( solMenuUst: Padding( padding: const EdgeInsets.all(8.0), child: Column( children: [ Image.asset("packages/fikoyt_ui/assets/core/icons/fikoyt-4.png", height: 32), Align( alignment: Alignment.centerRight, child: Text( "Premium", style: TextStyle(color: Colors.black45, fontSize: 12, fontWeight: FontWeight.bold), ), ), ], ), ), solMenuAlt: Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ FikoYTButton( text: "🎧", tema: FikoYTButtonTheme(fontSize: 16, edgePadding: EdgeInsets.all(5), radius: 5), onPressed: () {}, ), Spacer(), FikoYTButton( text: "⚙️", tema: FikoYTButtonTheme(fontSize: 16, edgePadding: EdgeInsets.all(5), radius: 5), onPressed: () {}, ), ], ), ), solMenu: Column( children: [ SolMenuItem(icon: Icons.dashboard, label: 'Ana pencere', selected: true, onTap: () {}), SolMenuItem(icon: Icons.shopping_cart_checkout, label: 'Stoklar', selected: false, onTap: () {}), SolMenuItem(icon: Icons.person, label: 'Pdks', selected: false, onTap: () {}), SolMenuItem(icon: Icons.polymer_rounded, label: 'Projeler', selected: false, onTap: () {}), ], ), child: AnaSayfa(), ), ), ], title: "FikoYT Sistem", firstRouteUrl: "/kisi/ana-sayfa", ), systemUiMode: SystemUiMode.immersiveSticky, systemUiOverlay: SystemUiOverlay.values, fikoytWebSocketUrl: "https://fikoyt.com:9000", fikoytServerIstekOnEk: "/fapiv1/fikoyt.com.", connectWebSocket: true, socketMiddleWare: (Socket socket) { socket.onConnect( (data) async => FikoYTCoreService.ioEmit("FikoYT.uyar.devices.connected", { "deviceUuid": await FikoYTCoreService.getDeviceID(), if (!kIsWeb) if (Platform.isAndroid) "type": "Android", if (!kIsWeb) if (Platform.isWindows) "type": "PC", "others": await FikoYTCoreService.getDeviceInfo(), "user": null, }), ); }, ), ); // WidgetsFlutterBinding.ensureInitialized(); await FikoYTCoreService.uygulamaCalistir(); } 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), ), ], ), ), ), ), ); } }