// 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_mesaici/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:flutter/material.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: Colors.white.withValues(alpha: 20), ), 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: FikoButton1( text: widget.text, textColor: (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, textStrokeColor: Colors.transparent, textSize: 10, fontWeight: FontWeight.bold, backColor: (widget.day.formatla("dd.MM.yyyy") == DateTime.now().formatla("dd.MM.yyyy")) ? Colors.blue : (widget.day.weekday == DateTime.sunday || widget.day.weekday == DateTime.saturday) ? Colors.amber : Colors.cyanAccent, radius: 0, ), ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ FikoButton1( text: "🕒", textSize: 18, edgePadding: EdgeInsets.zero, backColor: Colors.transparent, textColor: 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, // ), // ], // ), Spacer(), SingleChildScrollView( scrollDirection: Axis.horizontal, child: AnimatedFikoButton1( text: widget.hrktlr.calismaSaatiToplam.insanizeSure(snGoster: false), textColor: Colors.green, textStrokeColor: Colors.transparent, textSize: 9, edgePadding: EdgeInsets.zero, fontWeight: FontWeight.bold, backColor: Colors.transparent, radius: 0, ), ), SingleChildScrollView( scrollDirection: Axis.horizontal, child: AnimatedFikoButton1( text: widget.hrktlr.brutToplamlar.toParaBirimi(), textColor: Colors.green, textStrokeColor: Colors.transparent, edgePadding: EdgeInsets.zero, textSize: 9, fontWeight: FontWeight.bold, backColor: Colors.transparent, radius: 0, ), ), ], ), Positioned( top: 12, right: 10, width: 7, child: Opacity( opacity: widget.hrktlr.altKartSayisi > 0 ? 1 : 0.2, child: FikoButton1( text: "💬", textSize: 10, edgePadding: EdgeInsets.zero, backColor: Colors.transparent, textColor: Colors.white, ), ), ), Positioned( top: 12, left: 0, // width: 5, child: Opacity( opacity: widget.hrktlr.resmiTatilVar ? 1 : 0.2, child: FikoButton1( text: "🚩", textSize: 10, edgePadding: EdgeInsets.zero, backColor: Colors.transparent, textColor: Colors.white, ), ), ), Positioned( top: 24, left: 0, // width: 5, child: Opacity( opacity: widget.hrktlr.resmiTatilVar ? 1 : 0.2, child: FikoButton1( text: "💖", textSize: 10, edgePadding: EdgeInsets.zero, backColor: Colors.transparent, textColor: Colors.white, ), ), ), ], ), ), ); } }