import 'package:fikoyt_merkez/apps/mesaici/base_page_mesaici_view.dart'; import 'package:fikoyt_merkez/apps/mesaici/servisler/fikoyt.mesaici.service.dart'; import 'package:fikoyt_merkez/apps/mesaici/servisler/mesaici.ayarlar.dart'; import 'package:fikoyt_merkez/core/Extensions/fiko_duration_ext.dart'; import 'package:fikoyt_merkez/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_merkez/core/fikoyt.service.dart'; import 'package:fikoyt_merkez/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:fikoyt_merkez/core/widgets/yazi_kutulari/yazi_kutulari.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class VardiyeDialog extends StatelessWidget { VardiyeDialog({Key? key, Mola? mola}) : mola = mola ?? Mola(), super(key: key); BasePageMesaiciLogic basePageMesaiciLogic = Get.put(BasePageMesaiciLogic()); final FikoYTMesaiciService servisMesaici = Get.put(FikoYTMesaiciService()); final FikoYTService servisFikoYT = FikoYTService(); Mola mola = Mola(); @override Widget build(BuildContext context) { return Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text( "Mola'ya Bir İsim Veriniz", ), Obx( () => FikoYaziKutusu( baslik: "Mola İsmi", simgeSol: const Text( "👩🏻‍🤝‍👨🏽", style: TextStyle( fontSize: 16, ), ), radius: 5.0, degeri: mola.ismi.value, degisti: (value) { mola.ismi.value = value; }, ), ), FikoAciklamaKutusu( baslik: "Mola Açıklama", radius: 5.0, degeri: mola.aciklama.value, yaziBoyutu: 12.0, degisti: (value) { mola.aciklama.value = value; }, ), Row( children: [ Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.grey.shade400, borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(10), topLeft: Radius.circular(10), ), ), child: const Text( "Giriş Saati", style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold), ), ), ), Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.grey.shade400, borderRadius: const BorderRadius.only( bottomRight: Radius.circular(10), topRight: Radius.circular(10), ), ), child: const Text( "Çıkış Saati", style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold), ), ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Obx( () => FikoButton1( text: mola.girisSaati.value.formatla("HH:mm:ss"), textSize: 14, textColor: Colors.green, textStrokeColor: Colors.transparent, onPressed: () async { DateTime? rslt = await FikoYTService.saatSec(context, varsayilanTarih: DateTime(0, 0, 0, 0, 0, 0, 0, 0) .ayarlaGununSaati( mola.girisSaati.value.gununSaati())); if (rslt == null) return; mola.girisSaati.value = rslt; // showTimePicker( // context: context, // initialTime: // TimeOfDay.fromDateTime(mola.girisSaati.value), // ).then((value) { // if (value != null) { // mola.girisSaati.value = // DateTime(0, 0, 0, value.hour, value.minute); // } // }); }, ), ), ), Expanded( child: Obx( () => FikoButton1( text: mola.cikisSaati.value.formatla("HH:mm:ss"), textSize: 14, textColor: Colors.red, textStrokeColor: Colors.transparent, onPressed: () async { DateTime? rslt = await FikoYTService.saatSec(context, varsayilanTarih: DateTime(0, 0, 0, 0, 0, 0, 0, 0) .ayarlaGununSaati( mola.cikisSaati.value.gununSaati())); if (rslt == null) return; mola.cikisSaati.value = rslt; // showTimePicker( // context: context, // initialTime: // TimeOfDay.fromDateTime(mola.cikisSaati.value), // ).then((value) { // if (value != null) { // mola.cikisSaati.value = // DateTime(0, 0, 0, value.hour, value.minute); // } // }); }, ), ), ), ], ), Row( children: [ Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.grey.shade400, borderRadius: const BorderRadius.all( Radius.circular(10), ), ), child: const Text( "Mola Süresi", style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold), ), ), ), ], ), Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Obx( () => FikoButton1( text: mola.farkHesapla().insanize ?? 'Yok', textSize: 18, textColor: Colors.green, textStrokeColor: Colors.transparent, ), ), ], ), Obx( () => Row( children: [ const Text("🚨 Bu Mola Çalışma Saatinden Düşer"), const Spacer(), SizedBox( height: 25, child: FittedBox( fit: BoxFit.fill, child: Switch( value: mola.saattenDuser.value, onChanged: (value) { mola.saattenDuser.value = value; }, ), ), ), ], ), ), Obx( () => Row( children: [ const Text("🛎️ Bu Mola İçin Bildirim Göster"), const Spacer(), SizedBox( height: 25, child: FittedBox( fit: BoxFit.fill, child: Switch( value: mola.bildirimGoster.value, onChanged: (value) { mola.bildirimGoster.value = value; }, ), ), ), ], ), ), Obx( () => Row( children: [ const Text("🤖 Bu Molayı Otomatik Gir"), const Spacer(), SizedBox( height: 25, child: FittedBox( fit: BoxFit.fill, child: Switch( value: mola.otomatikGir.value, onChanged: (value) { mola.otomatikGir.value = value; }, ), ), ), ], ), ), ], ), ); } }