import 'package:fikoyt_merkez/apps/mesaici/model/calisma_kayit.dart'; import 'package:fikoyt_merkez/apps/mesaici/widgets/aktif_kart/gunluk_izinli.dart'; import 'package:fikoyt_merkez/apps/mesaici/widgets/aktif_kart/kumulatif_satir.dart'; import 'package:fikoyt_merkez/apps/mesaici/widgets/aktif_kart/maas_tablosu.dart'; import 'package:fikoyt_merkez/apps/mesaici/widgets/aktif_kart/raporlu.dart'; import 'package:fikoyt_merkez/apps/mesaici/widgets/aktif_kart/saat_tablosu.dart'; import 'package:fikoyt_merkez/apps/mesaici/widgets/aktif_kart/yillik_izinli.dart'; import 'package:fikoyt_merkez/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_merkez/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../../../../core/fikoyt.service.dart'; // ignore: must_be_immutable class AktifKart extends StatelessWidget { AktifKart({super.key, this.kayit}); Rx? kayit = CalismaKayit().obs; @override Widget build(BuildContext context) { return Container( decoration: const BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(5), ), boxShadow: [ BoxShadow( color: Colors.black12, offset: Offset(0, 0), spreadRadius: 1, blurRadius: 0.0, blurStyle: BlurStyle.outer), ]), child: Column( children: [ Row( children: [ // const Text( // "📅", // style: TextStyle(fontSize: 16), // ), SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: const CircleBorder( // borderRadius: BorderRadius.all(Radius.circular(5)), side: BorderSide.none, ), padding: const EdgeInsets.all(0), child: const Text("📅"), // color: Colors.white, onPressed: () { // if (kDebugMode) { // Scaffold.of(context).openEndDrawer(); print('clicked'); // } }, ), ), Expanded( child: Obx( () => FikoButton1( text: "${kayit?.value.calismaGunu != null ? kayit?.value.calismaGunu?.formatla('dd MMMM yyyy EEEE') : 'Çalışma Gününü Seçiniz'}", textSize: 13, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, // radius: 0, backColor: Colors.transparent, onPressed: () async { kayit?.value.calismaGunu = await FikoYTService.tarihSec( context, varsayilanTarih: kayit?.value.calismaGunu); kayit?.refresh(); }, ), ), ), SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: const CircleBorder( // borderRadius: BorderRadius.all(Radius.circular(5)), side: BorderSide.none, ), padding: const EdgeInsets.all(0), child: const Text("♻️"), // color: Colors.white, onPressed: () { // if (kDebugMode) { // Scaffold.of(context).openEndDrawer(); print('clicked'); // } }, ), ), ], ), const Divider( height: 2, ), Padding( padding: const EdgeInsets.all(5), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.gunTuru = GunTuru.CALISMA_GUNU; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: kayit?.value.gunTuru == GunTuru.CALISMA_GUNU ? Colors.teal : Colors.grey.shade200, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), foregroundColor: kayit?.value.gunTuru == GunTuru.CALISMA_GUNU ? Colors.white : Colors.teal, textStyle: const TextStyle( fontSize: 10, fontWeight: FontWeight.bold, ), ), child: const Text('Çalışma Günü'), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.gunTuru = GunTuru.DINLENME_GUNU; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: kayit?.value.gunTuru == GunTuru.DINLENME_GUNU ? Colors.teal : Colors.grey.shade200, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), foregroundColor: kayit?.value.gunTuru == GunTuru.DINLENME_GUNU ? Colors.white : Colors.teal, textStyle: const TextStyle( fontSize: 10, fontWeight: FontWeight.bold, ), ), child: const Text('Dinlenme Günü'), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.gunTuru = GunTuru.HAFTA_TATILI; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: kayit?.value.gunTuru == GunTuru.HAFTA_TATILI ? Colors.teal : Colors.grey.shade200, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), foregroundColor: kayit?.value.gunTuru == GunTuru.HAFTA_TATILI ? Colors.white : Colors.teal, textStyle: const TextStyle( fontSize: 10, fontWeight: FontWeight.bold, ), ), child: const Text('Hafta Tatili'), ), ), ), ], ), ), /** NOT: Orta Bölüm */ Padding( padding: const EdgeInsets.all(5), child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ /** NOT: Sol Göstergeler */ Column( children: [ Icon( Icons.auto_awesome, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.pan_tool, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.nfc, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.wifi, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.gps_fixed, color: Colors.grey.shade300, size: 16, ), ], ), /** NOT: Orta Veri Girişleri */ Expanded( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 0), child: Column( children: [ Obx( () => Visibility( visible: kayit?.value.raporlu != true && kayit?.value.gunlukIzinli != true && kayit?.value.yillikIzinli != true, child: SaatTablosu(kayit: kayit), ), ), /** */ Obx( () => Visibility( visible: kayit?.value.raporlu == true, child: Raporlu(kayit: kayit), ), ), /** */ Obx( () => Visibility( visible: kayit?.value.gunlukIzinli == true, child: GunlukIzinli(kayit: kayit), ), ), /** */ Obx( () => Visibility( visible: kayit?.value.yillikIzinli == true, child: YillikIzinli(kayit: kayit), ), ), /** */ const SizedBox( height: 5, ), /** Maaş Tablosu */ MaasTablosu(kayit: kayit), /** */ KumultatifSatir(kayit: kayit), Row( children: [ TextButton( onPressed: () {}, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(16), backgroundColor: Colors.blue.shade400, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.horizontal( left: Radius.circular(50), right: Radius.circular(50), ), ), textStyle: const TextStyle( fontSize: 10, color: Colors.white, ), ), child: const Padding( padding: EdgeInsets.symmetric(horizontal: 10), child: Text( "Giriş Yap", style: TextStyle( color: Colors.white, ), ), ), ), const Spacer(), TextButton( onPressed: () {}, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(16), backgroundColor: Colors.red.shade400, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.horizontal( left: Radius.circular(50), right: Radius.circular(50), ), ), textStyle: const TextStyle( fontSize: 10, color: Colors.white, ), ), child: const Padding( padding: EdgeInsets.symmetric(horizontal: 10), child: Text( "🗑️ Kartı Sil", style: TextStyle( color: Colors.white, ), ), ), ), TextButton( onPressed: () {}, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(16), backgroundColor: Colors.red.shade400, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.horizontal( left: Radius.circular(50), right: Radius.circular(50), ), ), textStyle: const TextStyle( fontSize: 10, color: Colors.white, ), ), child: const Padding( padding: EdgeInsets.symmetric(horizontal: 10), child: Text( "Çıkış Yap", style: TextStyle( color: Colors.white, ), ), ), ), TextButton( onPressed: () {}, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(16), backgroundColor: Colors.green.shade400, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.horizontal( left: Radius.circular(50), right: Radius.circular(50), ), ), textStyle: const TextStyle( fontSize: 10, color: Colors.white, ), ), child: const Padding( padding: EdgeInsets.symmetric(horizontal: 10), child: Text( "💾 Kaydet", style: TextStyle( color: Colors.white, ), ), ), ), ], ), ], ), ), ), /** NOT: Sağ Göstergeler */ Column( children: [ Icon( Icons.auto_awesome, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.pan_tool, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.nfc, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.wifi, color: Colors.grey.shade300, size: 16, ), const SizedBox( height: 10, ), Icon( Icons.gps_fixed, color: Colors.grey.shade300, size: 16, ), ], ), ], ), ), Padding( padding: const EdgeInsets.all(5), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.servisGecikmesi = !kayit!.value.servisGecikmesi; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero, ), ), child: Icon( Icons.bus_alert, size: 16, color: kayit?.value.servisGecikmesi == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.resmiTatil = !kayit!.value.resmiTatil; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: Icon( Icons.flag, size: 16, color: kayit?.value.resmiTatil == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.raporlu = !kayit!.value.raporlu; kayit?.value.gunlukIzinli = false; kayit?.value.yillikIzinli = false; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: Icon( Icons.heart_broken, size: 16, color: kayit?.value.raporlu == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.gunlukIzinli = !kayit!.value.gunlukIzinli; kayit?.value.raporlu = false; kayit?.value.yillikIzinli = false; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: Icon( Icons.hotel, size: 16, color: kayit?.value.gunlukIzinli == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.yillikIzinli = !kayit!.value.yillikIzinli; kayit?.value.raporlu = false; kayit?.value.gunlukIzinli = false; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: Icon( Icons.pool, size: 16, color: kayit?.value.yillikIzinli == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.yolParasiVar = !kayit!.value.yolParasiVar; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: Icon( Icons.local_gas_station, size: 16, color: kayit?.value.yolParasiVar == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: Obx( () => TextButton( onPressed: () { kayit?.value.yemekParasiVar = !kayit!.value.yemekParasiVar; kayit?.refresh(); }, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: Icon( Icons.fastfood, size: 16, color: kayit?.value.yemekParasiVar == true ? Colors.orange : Colors.grey.shade300, ), ), ), ), Expanded( child: TextButton( onPressed: () {}, style: TextButton.styleFrom( alignment: Alignment.center, fixedSize: const Size.fromHeight(20), backgroundColor: Colors.grey.shade50, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.zero), ), child: const Icon( Icons.chat_bubble, size: 16, ), ), ), ], ), ), ], ), ); } }