import 'package:fikoyt_finans/apps/mesaici/model/ayarlar/model_ayarlar.dart'; import 'package:fikoyt_finans/apps/mesaici/model/model_hareketler.dart'; import 'package:fikoyt_finans/core/Extensions/fiko_double_ext.dart'; import 'package:fikoyt_finans/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class BrutMaasTablosu extends StatefulWidget { BrutMaasTablosu({super.key, required this.kayit}); final Rx? kayit; @override State createState() => _BrutMaasTablosuState(); } class _BrutMaasTablosuState extends State { // Rx normalMesaiUcreti$ = Rx(0.0); // Rx fazlaMesaiUcreti$ = Rx(0.0); // Rx toplamBrutEkUcretler$ = Rx(0.0); // Rx toplamBrutUcretler$ = Rx(0.0); // late Timer timer$; @override void initState() { // normalMesaiUcreti$.value = widget.kayit?.value?.calismaKarti?.brutNormal ?? 0.0; // fazlaMesaiUcreti$.value = widget.kayit?.value?.calismaKarti?.brutFazlaMesai ?? 0.0; // toplamBrutEkUcretler$.value = widget.kayit?.value?.calismaKarti?.ekOdemeler?.toplam() ?? 0.0; // toplamBrutUcretler$.value = widget.kayit?.value?.calismaKarti?.brutToplam ?? 0.0; super.initState(); } @override void dispose() { // timer$.cancel(); super.dispose(); } @override Widget build(BuildContext context) { return Column( children: [ Row( children: [ Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.blue.shade400, ), child: const Text( "B. Maaş", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), ), ), Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.blue.shade400, ), child: const Text( "B. Fazla Mesai", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), ), ), Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.blue.shade400, ), child: const Text( "B. Ek Ücret", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Obx( () => AnimatedNumberFikoButton1( // key: ValueKey("${toplamBrutEkUcretler$.value?.toPrecision(2) ?? 0.0} TL"), text: widget.kayit?.value?.calismaKarti?.brutNormal, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.red, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.grey.shade200, onPressed: () {}, ), ), ), Expanded( child: Obx( () => AnimatedNumberFikoButton1( // key: ValueKey("${toplamBrutEkUcretler$.value?.toPrecision(2) ?? 0.0} TL"), text: widget.kayit?.value?.calismaKarti?.brutFazlaMesai, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.red, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.grey.shade200, onPressed: () {}, ), ), ), Expanded( child: Obx( () => AnimatedNumberFikoButton1( // key: ValueKey("${toplamBrutEkUcretler$.value?.toPrecision(2) ?? 0.0} TL"), text: widget.kayit?.value?.calismaKarti?.ekOdemeler?.toplam(), textBuilder: (tweenValue) => tweenValue.toParaBirimi(), textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.red, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.grey.shade200, onPressed: () {}, ), ), ), ], ), /** */ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Obx( () => AnimatedNumberFikoButton1( text: widget.kayit?.value?.calismaKarti?.brutToplam, textBuilder: (tweenValue) => "Brüt Toplam -> ${tweenValue.toParaBirimi()}", textSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.blueAccent, textStrokeColor: Colors.transparent, radius: 0, backColor: Colors.yellow.shade100, onPressed: () {}, ), ), ), ], ), // Row( // children: [ // Expanded( // child: Container( // alignment: Alignment.center, // decoration: BoxDecoration( // color: Colors.blue.shade400, // ), // child: const Text( // "Net Maaş", // style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), // ), // ), // ), // Expanded( // child: Container( // alignment: Alignment.center, // decoration: BoxDecoration( // color: Colors.blue.shade400, // ), // child: const Text( // "Net Fazla Mesai", // style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), // ), // ), // ), // Expanded( // child: Container( // alignment: Alignment.center, // decoration: BoxDecoration( // color: Colors.blue.shade400, // ), // child: const Text( // "Net Ek Ücret", // style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), // ), // ), // ), // ], // ), // Row( // mainAxisAlignment: MainAxisAlignment.spaceEvenly, // children: [ // Obx( // () => TweenAnimationBuilder( // tween: Tween( // begin: oncekiMesaiUcreti$.value, // Başlangıç değeri // end: normalMesaiUcreti$.value), // Bitiş değeri // duration: const Duration(milliseconds: 900), // Animasyon süresi // builder: (context, value, child) { // return Expanded( // child: FikoButton1( // key: ValueKey("${normalMesaiUcreti$.value.toPrecision(2)} TL"), // text: "${value.toPrecision(2).toStringAsFixed(2)} TL", // textSize: 12, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), // textColor: Colors.red, // textStrokeColor: Colors.transparent, // radius: 0, // backColor: Colors.grey.shade200, // onPressed: () {}, // ), // ); // }, // ), // ), // Obx( // () => TweenAnimationBuilder( // tween: Tween( // begin: oncekiFazlaMesaiUcreti$.value, // Başlangıç değeri // end: fazlaMesaiUcreti$.value), // Bitiş değeri // duration: const Duration(milliseconds: 900), // Animasyon süresi // builder: (context, value, child) { // return Expanded( // child: FikoButton1( // key: ValueKey("${fazlaMesaiUcreti$.value.toPrecision(2)} TL"), // text: "${value.toPrecision(2).toStringAsFixed(2)} TL", // textSize: 12, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), // textColor: Colors.red, // textStrokeColor: Colors.transparent, // radius: 0, // backColor: Colors.grey.shade200, // onPressed: () {}, // ), // ); // }, // ), // ), // Obx( // () => TweenAnimationBuilder( // tween: Tween( // begin: oncekiBrutEkUcetler$.value, // Başlangıç değeri // end: toplamBrutEkUcretler$.value), // Bitiş değeri // duration: const Duration(milliseconds: 900), // Animasyon süresi // builder: (context, value, child) { // return Expanded( // child: FikoButton1( // key: ValueKey("${toplamBrutEkUcretler$.value.toPrecision(2)} TL"), // text: "${value.toPrecision(2).toStringAsFixed(2)} TL", // textSize: 12, // edgePadding: const EdgeInsets.symmetric(vertical: 2.0), // textColor: Colors.red, // textStrokeColor: Colors.transparent, // radius: 0, // backColor: Colors.grey.shade200, // onPressed: () {}, // ), // ); // }, // ), // ), // ], // ), ], ); } }