import 'package:fikoyt_mesaici/apps/mesaici/model/ayarlar/model_ayarlar.dart'; import 'package:fikoyt_mesaici/apps/mesaici/pages/ayarlar/calisma_sureleri/molalar_list_view.dart'; import 'package:fikoyt_mesaici/apps/mesaici/servisler/fikoyt.mesaici.service.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_double_ext.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_duration_ext.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_mesaici/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class OzetAylikLogic extends GetxController { late FikoYTMesaiciService servisMesaici; /** */ @override void onInit() { servisMesaici = Get.put(FikoYTMesaiciService()); super.onInit(); } @override // ignore: unnecessary_overrides void onClose() { super.onClose(); } } class OzetAylik extends StatefulWidget { const OzetAylik({super.key}); @override State createState() => _OzetAylikState(); } class _OzetAylikState extends State { late OzetAylikLogic logic; @override void initState() { logic = Get.put(OzetAylikLogic()); // TODO: implement initState super.initState(); } @override void dispose() { Get.delete(); // TODO: implement dispose super.dispose(); } @override Widget build(BuildContext context) { return Obx( () { logic.servisMesaici.aktifAy.value; logic.servisMesaici.aktifCalisma?.value; logic.update(); return FutureBuilder( future: logic.servisMesaici.aylikOzet.aktifAyhesapla(), builder: (context, snapshot) => Container( padding: const EdgeInsets.all(5), margin: const EdgeInsets.all(5), 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(); if (kDebugMode) { print('clicked'); } // } }, ), ), Expanded( child: Obx( () => AnimatedFikoButton1( text: logic.servisMesaici.aktifAy.value.formatla('MMMM yyyy'), textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.black87, textSize: 14, ), ), ), 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(); if (kDebugMode) { print('clicked'); } // } }, ), ), ], ), const Divider( height: 2, ), /** NOT: Orta Bölüm */ Row( children: [ Expanded( child: Column( children: [ Text( "Çalışma Süresi", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "Ç.Günü Mesaileri", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "D.Günü Mesaileri", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ // Expanded( // child: AnimatedNumberFikoButton1( // text: (snapshot.data?.normalCalismaSuresi.inMilliseconds ?? 0).toDouble(), // textBuilder: (tweenValue) => "${Duration(milliseconds: tweenValue.toInt()).insanize} ", // textSize: 12, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), // textColor: Colors.black87, // textStrokeColor: Colors.transparent, // radius: 0, // backColor: Colors.yellow.shade200, // ), // ), Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.normalCalismaSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.calismaGunuMesaiSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.dinlenmeGunuMesaiSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), ], ), /** */ Row( children: [ Expanded( child: Column( children: [ Text( "H.Tatili Mesaileri", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "R.Tatil Mesaileri", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "İzinli Süre", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.haftaTatiliGunuMesaiSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.resmiTatilGunuMesaiSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.izinliGunSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), ], ), /** */ Row( children: [ Expanded( child: Column( children: [ Text( "Raporlu Süre", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "Yıllık İzin", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), // Expanded( // child: Column( // children: [ // Text( // "Σ Ç.Günü Ücreti", // style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), // ), // ], // ), // ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.raporluSure.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedFikoButton1( text: "${snapshot.data?.yillikIzinliGunSuresi.insanize ?? '❌ Yok'} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), // Expanded( // child: FikoButton1( // text: "❌ Yok", // textSize: 12, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), // textColor: Colors.black87, // textStrokeColor: Colors.transparent, // radius: 0, // backColor: Colors.yellow.shade200, // ), // ), ], ), /** */ Row( children: [ Expanded( child: Column( children: [ Text( "Σ Ek Ücretler", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "Σ F.Mesai Ücreti", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), Expanded( child: Column( children: [ Text( "Σ Genel Toplam", style: TextStyle(color: Colors.blue.shade500, fontWeight: FontWeight.bold), ), ], ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedNumberFikoButton1( text: snapshot.data?.ekUcretler, textBuilder: (tweenValue) => "${tweenValue.toParaBirimi()} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedNumberFikoButton1( text: snapshot.data?.fazlaMesaiUcreti, textBuilder: (tweenValue) => "${tweenValue.toParaBirimi()} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), Expanded( child: AnimatedNumberFikoButton1( text: snapshot.data?.odenecekUcret, textBuilder: (tweenValue) => "${tweenValue.toParaBirimi()} ", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black87, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade200, ), ), ], ), // Row( // mainAxisAlignment: MainAxisAlignment.spaceEvenly, // children: [ // Expanded( // child: AnimatedNumberFikoButton1( // text: snapshot.data?.toplamKesinti, // textBuilder: (tweenValue) => "Toplam Kesinti -> ${tweenValue.toParaBirimi()}", // textSize: 12, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), // textColor: Colors.blueAccent, // textStrokeColor: Colors.transparent, // radius: 0, // backColor: Colors.yellow.shade100, // onPressed: () {}, // ), // ), // ], // ), ], ), ), ); }, ); } }