// ignore_for_file: library_private_types_in_public_api import 'package:fikoyt_mesaici/apps/mesaici/model/model_hareketler.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/fikoyt.service.dart'; import 'package:fikoyt_ui/ui/ui.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:isar/isar.dart'; import 'package:vrouter/vrouter.dart'; class TakvimGun extends StatefulWidget { const TakvimGun({ super.key, required this.text, required this.hrktlr, required this.day, }); final String text; final List hrktlr; final DateTime day; @override State createState() => _TakvimGunState(); } class _TakvimGunState extends State { @override void initState() { // TODO: implement initState super.initState(); } @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( border: Border.all( color: Colors.black12, ), borderRadius: const BorderRadius.all( Radius.circular(5), ), color: Theme.of(context).extension()?.kartArkaPlanRenk?.withAlpha(150), ), clipBehavior: Clip.hardEdge, margin: const EdgeInsets.all(1), child: InkWell( onTap: () async { // ModelHareketler? hrkt = await FikoYTService.servisMesaici.isar?.modelHareketlers.where().filter().turuEqualTo(KartTuru.CALISMA_KARTI).calismaKarti((q) => q.tarihBetween(day.ilkSaatler(), day.sonSaatler())).sortByTarihDesc().findFirst(); // if (hrkt != null) { context.vRouter.to("/mesaici/hareketler/gun-hareketleri/${widget.day.formatla('dd.MM.yyyy EEEE')}"); // } }, child: Stack( alignment: Alignment.topCenter, children: [ Column( children: [ Center( child: FikoButton( text: widget.text, tema: FikoButtonTheme( yaziRengi: (widget.day.formatla("dd.MM.yyyy") == DateTime.now().formatla("dd.MM.yyyy")) ? Colors.white : (widget.day.weekday == DateTime.sunday || widget.day.weekday == DateTime.saturday) ? Colors.black : Colors.black, yaziSinirRengi: Colors.transparent, boyutYazi: 10, fontWeight: FontWeight.bold, arkaRenk: (widget.day.formatla("dd.MM.yyyy") == DateTime.now().formatla("dd.MM.yyyy")) ? Colors.blue : widget.hrktlr.dinlenmeGunuVar ? Colors.amber : widget.hrktlr.haftaTatiliVar ? Colors.yellow : Colors.cyanAccent, radius: 0, ), ), ), Stack( children: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ FikoButton( text: widget.hrktlr.isNotEmpty ? "🕒" : "🚫", tema: FikoButtonTheme( boyutYazi: 18, edgePadding: EdgeInsets.zero, arkaRenk: Colors.transparent, yaziRengi: Colors.white, ), ), ], ), Visibility( visible: widget.hrktlr.fazlaMesaiVar, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ FikoButton( text: "➕", tema: FikoButtonTheme( boyutYazi: 10, edgePadding: EdgeInsets.all(6), arkaRenk: Colors.transparent, yaziRengi: Colors.white, ), ), ], ), ), ], ), // Row( // children: [ // FikoButton1( // text: "0s", // edgePadding: EdgeInsets.zero, // textSize: 10, // backColor: Colors.transparent, // textStrokeColor: Colors.transparent, // textColor: Colors.black54, // ), // const Spacer(), // FikoButton1( // text: "+5s", // edgePadding: EdgeInsets.zero, // textSize: 10, // backColor: Colors.transparent, // textStrokeColor: Colors.transparent, // textColor: Colors.black54, // ), // ], // ), const Spacer(), SingleChildScrollView( scrollDirection: Axis.horizontal, child: FikoButton( text: widget.hrktlr.calismaSaatiToplam.insanizeSure(snGoster: false), tema: FikoButtonTheme( yaziRengi: Colors.green, yaziSinirRengi: Colors.transparent, boyutYazi: 9, edgePadding: EdgeInsets.zero, fontWeight: FontWeight.bold, arkaRenk: Colors.transparent, radius: 0, ), ), ), SingleChildScrollView( scrollDirection: Axis.horizontal, child: FikoButton( text: widget.hrktlr.brutToplamlar.toParaBirimi(), tema: FikoButtonTheme( yaziRengi: Colors.green, yaziSinirRengi: Colors.transparent, edgePadding: EdgeInsets.zero, boyutYazi: 9, fontWeight: FontWeight.bold, arkaRenk: Colors.transparent, radius: 0, ), ), ), ], ), Positioned( top: 14, right: 10, width: 7, child: Opacity( opacity: FikoYTService.servisMesaici.gunAciklamaVar(widget.day) ? 1 : 0.2, child: FikoButton( text: "💬", tema: FikoButtonTheme( boyutYazi: 10, edgePadding: EdgeInsets.zero, arkaRenk: Colors.transparent, yaziRengi: Colors.white, ), ), ), ), Positioned( top: 14, left: -3, // width: 5, child: Opacity( opacity: widget.hrktlr.resmiTatilVar ? 1 : 0.2, child: FikoButton( text: "🚩", tema: FikoButtonTheme( boyutYazi: 10, edgePadding: EdgeInsets.zero, arkaRenk: Colors.transparent, yaziRengi: Colors.white, ), ), ), ), Positioned( top: 26, left: -3, // width: 5, child: Opacity( opacity: widget.hrktlr.raporluVar ? 1 : 0.2, child: FikoButton( text: "💖", tema: FikoButtonTheme( boyutYazi: 10, edgePadding: EdgeInsets.zero, arkaRenk: Colors.transparent, yaziRengi: Colors.white, ), ), ), ), Positioned( top: 26, right: 10, width: 7, child: Opacity( opacity: widget.hrktlr.gunlukIzinVar ? 1 : 0.2, child: FikoButton( text: "🛏️", tema: FikoButtonTheme( boyutYazi: 10, edgePadding: EdgeInsets.zero, arkaRenk: Colors.transparent, yaziRengi: Colors.white, ), ), ), ), ], ), ), ); } }