import 'package:fikoyt_mesaici/apps/mesaici/base_page_mesaici_view.dart'; import 'package:fikoyt_mesaici/apps/mesaici/model/ayarlar/model_ayarlar.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_mesaici/core/fikoyt.service.dart'; import 'package:fikoyt_mesaici/core/widgets/yazi_kutulari/yazi_kutulari.dart'; import 'package:fikoyt_ui/ui/ui.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class ResmiTatilDialog extends StatelessWidget { ResmiTatilDialog({super.key, required this.resmiTatil}); BasePageMesaiciLogic basePageMesaiciLogic = Get.put(BasePageMesaiciLogic()); // final FikoYTMesaiciService FikoYTService.servisMesaici = Get.put(FikoYTMesaiciService()); final FikoYTService servisFikoYT = FikoYTService(); ResmiTatil resmiTatil; late Rx resmiTatilObs = resmiTatil.obs; @override Widget build(BuildContext context) { resmiTatilObs.listen((val) { resmiTatil = val; FikoYTService.servisMesaici.ayarlarModel!.refresh(); }); return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Tatil Tarihini Seçiniz', style: TextStyle( fontWeight: FontWeight.normal, color: Theme.of(context).extension()?.textColor, ), ), Obx( () => FikoButton( text: "${resmiTatilObs.value.tarihi != null ? resmiTatilObs.value.tarihi?.formatla('dd MMMM yyyy EEEE') : 'Tarihi Seçiniz'}", // color: Theme.of(context).extension()?.textColor, tema: FikoButtonTheme( fontSize: 13, textColor: Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: Colors.transparent, ), onPressed: () async { resmiTatilObs.value.tarihi = await FikoYTService.tarihSec(context, varsayilanTarih: resmiTatilObs.value.tarihi); resmiTatilObs.refresh(); }, ), ), Text( "Resmi Tatil'e Bir İsim Veriniz", style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).extension()?.textColor, ), ), FikoYaziKutusu( baslik: "Resmi Tatil", simgeSol: const Text( "👩🏻‍🤝‍👨🏽", style: TextStyle( fontSize: 16, ), ), radius: 5.0, degeri: resmiTatilObs.value.ismi, degisti: (value) { if (value == "") { resmiTatilObs.value.ismi = null; } else { resmiTatilObs.value.ismi = value; } resmiTatilObs.refresh(); }, ), FikoAciklamaKutusu( baslik: "Resmi Tatil Açıklama", radius: 5.0, degeri: resmiTatilObs.value.aciklama, yaziBoyutu: 12.0, degisti: (value) { resmiTatilObs.value.aciklama = value; resmiTatilObs.refresh(); }, ), /** */ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Mesai Oranı (${resmiTatilObs.value.mesaiOrani}%)', style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).extension()?.textColor, ), ), Obx( () => FikoYaziKutusu( baslik: "Mesai Oranı", simgeSol: const Text( "💸", style: TextStyle(fontSize: 16), ), sonEk: const Text("%"), radius: 5.0, klavyeTipi: TextInputType.number, // formatlayicilar: [ // CurrencyInputFormatter( // trailingSymbol: "%", // ) // // MaskedInputFormatter( // // '00000-0000-M00-B00-N# ', // // allowedCharMatcher: RegExp("^[0-9]*\$"), // // ), // ], degeri: resmiTatilObs.value.mesaiOrani.toString(), degisti: (value, {kontrolcu}) { resmiTatilObs.value.mesaiOrani = double.parse(value.replaceAll("%", "").replaceAll(",", "")); resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, // degeri: "0.00₺", ), ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Obx( () => FikoButton( text: "⏳ 50 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.mesaiOrani == 50 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.mesaiOrani == 50 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.mesaiOrani == 50 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.mesaiOrani = 50; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), const SizedBox( width: 5, ), Obx( () => FikoButton( text: "⏳ 100 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.mesaiOrani == 100 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.mesaiOrani == 100 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.mesaiOrani == 100 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.mesaiOrani = 100; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), const SizedBox( width: 5, ), Obx( () => FikoButton( text: "⏳ 150 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.mesaiOrani == 150 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.mesaiOrani == 150 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.mesaiOrani == 150 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.mesaiOrani = 150; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), ], ), ], ), /** */ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Dinlenme Günü Mesai Oranı (${resmiTatilObs.value.dinlenmeGunuMesaiOrani}%)', style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).extension()?.textColor, ), ), Obx( () => FikoYaziKutusu( baslik: "Dinlenme Günü Mesai Oranı", simgeSol: const Text( "💸", style: TextStyle(fontSize: 16), ), sonEk: const Text("%"), radius: 5.0, klavyeTipi: TextInputType.number, // formatlayicilar: [ // CurrencyInputFormatter( // trailingSymbol: "%", // ) // // MaskedInputFormatter( // // '00000-0000-M00-B00-N# ', // // allowedCharMatcher: RegExp("^[0-9]*\$"), // // ), // ], degeri: resmiTatilObs.value.dinlenmeGunuMesaiOrani.toString(), degisti: (value, {kontrolcu}) { resmiTatilObs.value.dinlenmeGunuMesaiOrani = double.parse(value.replaceAll("%", "").replaceAll(",", "")); resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, // degeri: "0.00₺", ), ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Obx( () => FikoButton( text: "⏳ 50 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 50 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 50 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 50 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.dinlenmeGunuMesaiOrani = 50; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), const SizedBox( width: 5, ), Obx( () => FikoButton( text: "⏳ 100 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 100 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 100 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 100 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.dinlenmeGunuMesaiOrani = 100; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), const SizedBox( width: 5, ), Obx( () => FikoButton( text: "⏳ 150 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 150 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 150 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.dinlenmeGunuMesaiOrani == 150 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.dinlenmeGunuMesaiOrani = 150; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), ], ), ], ), /** */ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Hafta Tatili Mesai Oranı (${resmiTatilObs.value.haftaTatiliMesaiOrani}%)', style: TextStyle( fontWeight: FontWeight.bold, color: Theme.of(context).extension()?.textColor, ), ), Obx( () => FikoYaziKutusu( baslik: "Hafta Tatili Mesai Oranı", simgeSol: const Text( "💸", style: TextStyle(fontSize: 16), ), sonEk: const Text("%"), radius: 5.0, klavyeTipi: TextInputType.number, // formatlayicilar: [ // CurrencyInputFormatter( // trailingSymbol: "%", // ) // // MaskedInputFormatter( // // '00000-0000-M00-B00-N# ', // // allowedCharMatcher: RegExp("^[0-9]*\$"), // // ), // ], degeri: resmiTatilObs.value.haftaTatiliMesaiOrani.toString(), degisti: (value, {kontrolcu}) { resmiTatilObs.value.haftaTatiliMesaiOrani = double.parse(value.replaceAll("%", "").replaceAll(",", "")); resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, // degeri: "0.00₺", ), ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Obx( () => FikoButton( text: "⏳ 50 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.haftaTatiliMesaiOrani == 50 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.haftaTatiliMesaiOrani == 50 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.haftaTatiliMesaiOrani == 50 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.haftaTatiliMesaiOrani = 50; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), const SizedBox( width: 5, ), Obx( () => FikoButton( text: "⏳ 100 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.haftaTatiliMesaiOrani == 100 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.haftaTatiliMesaiOrani == 100 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.haftaTatiliMesaiOrani == 100 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.haftaTatiliMesaiOrani = 100; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), const SizedBox( width: 5, ), Obx( () => FikoButton( text: "⏳ 150 %", tema: FikoButtonTheme( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: resmiTatilObs.value.haftaTatiliMesaiOrani == 150 ? Theme.of(context).extension()?.gecerlitextColor : Theme.of(context).extension()?.textColor, textStrokeColor: Colors.transparent, arkaRenk: resmiTatilObs.value.haftaTatiliMesaiOrani == 150 ? Colors.blue : Colors.transparent, sinirRengi: resmiTatilObs.value.haftaTatiliMesaiOrani == 150 ? Colors.yellow : Colors.blue, ), onPressed: () { resmiTatilObs.value.haftaTatiliMesaiOrani = 150; resmiTatilObs.refresh(); FikoYTService.servisMesaici.ayarlarModel!.refresh(); }, ), ), ], ), ], ), /** */ Obx( () => Row( children: [ Text( "🚨 Telafi Sayılabilir", style: TextStyle( color: Theme.of(context).extension()?.textColor, ), ), const Spacer(), SizedBox( height: 25, child: FittedBox( fit: BoxFit.fill, child: Switch( value: resmiTatilObs.value.telafiSayilabilir, onChanged: (value) { resmiTatilObs.value.telafiSayilabilir = value; resmiTatilObs.refresh(); }, ), ), ), ], ), ), Obx( () => Row( children: [ Text( "🛎️Her Sene Tekrarlar", style: TextStyle( color: Theme.of(context).extension()?.textColor, ), ), const Spacer(), SizedBox( height: 25, child: FittedBox( fit: BoxFit.fill, child: Switch( value: resmiTatilObs.value.herSeneTekrarlar, onChanged: (value) { resmiTatilObs.value.herSeneTekrarlar = value; resmiTatilObs.refresh(); }, ), ), ), ], ), ), ], ); } }