import 'package:fikoyt_merkez/apps/mesaici/base_page_mesaici_view.dart'; import 'package:fikoyt_merkez/apps/mesaici/model/model_ayarlar.dart'; import 'package:fikoyt_merkez/apps/mesaici/pages/ayarlar/resmi_tatiller/resmi_tatil_dialog.dart'; import 'package:fikoyt_merkez/apps/mesaici/servisler/fikoyt.mesaici.service.dart'; import 'package:fikoyt_merkez/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_merkez/core/fikoyt.service.dart'; import 'package:fikoyt_merkez/core/interface/fiko_dialog_ayarlari.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:flutter_multi_formatter/flutter_multi_formatter.dart'; import 'package:get/get.dart'; class ResmiTatilItem extends StatelessWidget { ResmiTatilItem({Key? key, required this.resmiTatil}) : super(key: key); BasePageMesaiciLogic basePageMesaiciLogic = Get.put(BasePageMesaiciLogic()); final FikoYTMesaiciService 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; servisMesaici.ayarlarModel!.refresh(); }); return Obx( () => Padding( padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4), child: ChoiceChip( avatar: Image.asset( 'assets/mesaici/ayarlar/resmi-tatil.png', // width: 300, width: 40, height: 40, fit: BoxFit.contain, ), surfaceTintColor: Colors.transparent, selectedColor: Colors.transparent, color: WidgetStatePropertyAll(Colors.transparent), padding: const EdgeInsets.all(3), label: Column( children: [ Align( alignment: Alignment.centerLeft, child: Text( resmiTatilObs.value.ismi ?? "Tatil İsmi Verilmemiş", style: const TextStyle( fontSize: 14, ), textAlign: TextAlign.start, ), ), Column( children: [ Row( children: [ Expanded( child: FikoButton1( text: "M. Oranı", textSize: 10, textColor: Colors.white, backColor: Colors.blue, textStrokeColor: Colors.transparent, ), ), Expanded( child: FikoButton1( text: "D.G. Oranı", textSize: 10, textColor: Colors.white, backColor: Colors.blue, textStrokeColor: Colors.transparent, ), ), Expanded( child: FikoButton1( text: "H.T. Oranı", textSize: 10, textColor: Colors.white, backColor: Colors.blue, textStrokeColor: Colors.transparent, ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: FikoButton1( text: "0.00 TL", textSize: 10, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.red, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.grey.shade200, onPressed: () {}, ), ), Expanded( child: FikoButton1( text: "0.00 TL", textSize: 10, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.red, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.grey.shade200, onPressed: () {}, ), ), Expanded( child: FikoButton1( text: "0.00 TL", textSize: 10, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.red, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.grey.shade200, onPressed: () {}, ), ), ], ), ], ) ], ), checkmarkColor: Colors.transparent, backgroundColor: Colors.transparent, showCheckmark: false, selected: false, onSelected: (bool selected) { FikoYTService.dialogGoster( context, SizedBox( width: 250, child: ResmiTatilDialog(resmiTatil: resmiTatilObs.value), ), FikoDialogAyarlari(baslik: "Mola Düzenle", altButonlar: [ FikoButton1( textColor: Colors.red, textStrokeColor: Colors.transparent, text: "Sil", onPressed: () { List _list = servisMesaici.ayarlarModel!.value.resmiTatiller.toList(); _list.remove(resmiTatilObs.value); servisMesaici.ayarlarModel!.value.resmiTatiller = _list; resmiTatilObs.refresh(); servisMesaici.ayarlarModel!.refresh(); Navigator.pop( context, ); }, ), const Spacer(), FikoButton1( textColor: Colors.green, textStrokeColor: Colors.transparent, text: "Kapat", onPressed: (() { // print(molaObs.value.toJson()); resmiTatilObs.refresh(); servisMesaici.ayarlarModel!.refresh(); Navigator.pop( context, ); }), ), ]), ); }), ), ); } }