import 'package:fikoyt_mesaici/apps/mesaici/model/ayarlar/model_ayarlar.dart'; import 'package:fikoyt_mesaici/apps/mesaici/model/model_hareketler.dart'; import 'package:fikoyt_mesaici/core/fikoyt.service.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:flutter/material.dart'; class VardiyalarDialog extends StatelessWidget { VardiyalarDialog({super.key, required this.kayit}); final Rx? kayit; // FikoYTMesaiciService FikoYTService.servisMesaici = Get.put(FikoYTMesaiciService()); FikoYTService servisFikoYT = FikoYTService(); @override Widget build(BuildContext context) { return Obx( () => Column( children: [ const Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( child: Divider( indent: 20.0, endIndent: 10.0, thickness: 1, ), ), Text( 'Vardiyalar', style: TextStyle( fontWeight: FontWeight.bold, ), ), Expanded( child: Divider( indent: 10.0, endIndent: 20.0, thickness: 1, ), ), ], ), Column( spacing: 5.0, children: [ for (var i = 0; i < (FikoYTService.servisMesaici.ayarlarModel?.value.calismaSuresiAyarlari.vardiyalar ?? []).length; i++) Obx( () { Rx? vrdy = FikoYTService.servisMesaici.ayarlarModel?.value.calismaSuresiAyarlari.vardiyalar[i].obs; return FikoYTButton( text: '🌀 ${vrdy?.value.ismi ?? 'İsim Verilmemiş'}', // Row( // crossAxisAlignment: CrossAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center, // children: [ // Text( // '🌀 ${vrdy?.value.ismi ?? 'İsim Verilmemiş'}', // ), // const Spacer(), // // FikoYTButton( // // textColor: Colors.white, // // textStrokeColor: Colors.black, // // text: "${vrdy?.value.farkHesapla().insanize ?? 'Yok'}", // // ), // ], // ), tema: Theme.of(context).extension()?.copyWith( textAlign: TextAlign.start, backgroundColor: Colors.black.withOpacity(0.0), edgePadding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), textColor: Theme.of(context).extension()?.textColor, ), onPressed: () { kayit?.value?.calismaKarti?.aktifVardiya = vrdy?.value; kayit?.refresh(); context.vRouter.pop(); }, ).animate( effects: [const FadeEffect(), ShimmerEffect(delay: 1000.ms)], ); }, ), ], ), // SizedBox( // height: 55, // child: ShaderMask( // shaderCallback: (Rect rect) { // return const LinearGradient( // begin: Alignment.centerLeft, // end: Alignment.centerRight, // colors: [Colors.purple, Colors.transparent, Colors.transparent, Colors.purple], // stops: [0.0, 0.1, 0.9, 1.0], // 10% purple, 80% transparent, 10% purple // ).createShader(rect); // }, // blendMode: BlendMode.dstOut, // child: ListView( // shrinkWrap: true, // physics: const BouncingScrollPhysics(), // // scrollDirection: Axis.horizontal, // // your ListView // children: [ // for (var k = 0; k < (kayit?.value?.molalar ?? []).length; k++) // Obx(() { // // Mola mola = // // gunObs.value.molalar[k]; // Rx? molaObs = kayit?.value?.molalar![k].obs; // molaObs?.listen((val) { // kayit?.value?.molalar![k] = val; // kayit?.refresh(); // FikoYTService.servisMesaici.ayarlarModel!.refresh(); // }); // return Padding( // padding: const EdgeInsets.symmetric( // horizontal: 4, // ), // child: ChoiceChip( // avatar: Image.asset( // 'assets/mesaici/ayarlar/cay.png', // // width: 300, // width: 40, // height: 40, // fit: BoxFit.contain, // ), // padding: const EdgeInsets.all(3), // label: Column( // children: [ // Align( // alignment: Alignment.centerLeft, // child: Obx( // () => Text( // (molaObs?.value.ismi == "" && molaObs?.value.ismi == null) ? "İsim Verilmemiş" : molaObs?.value.ismi ?? "İsim Verilmemiş", // style: const TextStyle( // fontSize: 12, // ), // textAlign: TextAlign.start, // ), // ), // ), // Row( // crossAxisAlignment: CrossAxisAlignment.center, // children: [ // FikoYTButton(text: molaObs?.value.girisSaati?.formatla("HH:mm:ss") ?? "Yok", textSize: 10, textColor: Colors.green, textStrokeColor: Colors.transparent), // FikoYTButton( // text: molaObs?.value.cikisSaati?.formatla("HH:mm:ss") ?? "Yok", // textSize: 10, // textColor: Colors.red, // textStrokeColor: Colors.transparent, // ), // ], // ), // Row( // crossAxisAlignment: CrossAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center, // children: [ // FikoYTButton( // text: molaObs?.value.farkHesapla().insanize ?? 'Yok', // textSize: 14, // textColor: Colors.green, // textStrokeColor: Colors.transparent, // ), // ], // ), // ], // ), // checkmarkColor: Colors.transparent, // backgroundColor: Colors.transparent, // showCheckmark: false, // selected: false, // onSelected: (bool selected) { // FikoYTService.dialogGoster( // context, // SizedBox( // width: 250, // child: MolaDialog( // mola: molaObs!.value, // ), // ), // FikoDialogAyarlari(baslik: "Mola Düzenle", altButonlar: [ // FikoYTButton( // textColor: Colors.red, // textStrokeColor: Colors.transparent, // text: "Sil", // onPressed: () { // List? list0 = kayit?.value?.molalar?.toList() ?? []; // list0.remove(molaObs.value); // kayit?.value?.molalar = list0; // kayit?.refresh(); // FikoYTService.servisMesaici.ayarlarModel!.refresh(); // Navigator.pop( // context, // ); // }, // ), // const Spacer(), // FikoYTButton( // textColor: Colors.green, // textStrokeColor: Colors.transparent, // text: "Kapat", // onPressed: (() { // // print(molaObs.value.toJson()); // molaObs.refresh(); // kayit?.refresh(); // FikoYTService.servisMesaici.ayarlarModel!.refresh(); // Navigator.pop( // context, // ); // }), // ), // ]), // ); // }), // ).animate(effects: [const FadeEffect(), ShimmerEffect(delay: 1000.ms)]); // }), // ], // ), // ), // ), ], ), ).animate(effects: [ // FadeEffect(duration: 1000.ms, curve: Curves.easeIn), // ScaleEffect(begin: const Offset(0.2, 0.2),duration: 500.ms, curve: Curves.easeIn), FadeEffect(duration: 1000.ms), SaturateEffect(delay: 1000.ms, duration: 500.ms, curve: Curves.easeIn), BlurEffect( duration: 600.ms, begin: const Offset(3, 3), end: const Offset(0, 0), ), ShimmerEffect( delay: 1000.ms, duration: 1000.ms, curve: Curves.easeIn, ), ]); } }