import 'package:fikoyt_akcali_v1/apps/finans/core/models/finans.model.dart'; import 'package:fikoyt_akcali_v1/apps/finans/core/widgets/akcali-ui/mini-hesap-kart.dart'; import 'package:fikoyt_akcali_v1/apps/finans/uye/hesaplar/_hesaplar-logic.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:fikoyt_ui/ui/fikoyt_card.dart'; import 'package:fikoyt_ui/ui/yazi_kutulari/yazi_kutulari.dart'; import 'package:flutter/material.dart'; class HesapSecDialog extends StatelessWidget { HesapSecDialog({super.key}); HesaplarService hesaplarServis = Get.put(HesaplarService()); @override Widget build(BuildContext context) { return FikoYTCard( key: ValueKey("HesapListesiDialog"), theme: (Theme.of(context).extension() ?? FikoYTCardTheme()).copyWith( boxConstraints: BoxConstraints(maxWidth: 300), backgroundColor: Theme.of(context).extension()?.backgroundColor, ), children: [ Center(child: Text('💸', style: TextStyle(fontSize: 54))), Center( child: FikoYTButton( text: 'Hesap Seç', tema: Theme.of(context).extension()?.copyWith( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.infoTextColor, // textShadow: Theme.of(context).extension()?.textShadow, ), ), ), Divider(height: 4), Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, spacing: 5, children: [ FikoYaziKutusu( baslik: "Arama Yap", simgeSol: const Text("✏️", style: TextStyle(fontSize: 14)), yaziBoyutu: 12.0, radius: 5.0, degeri: "", degisti: (value) {}, ), Divider(height: 4), /// AnimatedSwitcher( duration: const Duration(milliseconds: 500), layoutBuilder: (Widget? currentChild, List previousChildren) { return Stack( alignment: Alignment.topCenter, children: [...previousChildren, if (currentChild != null) currentChild], ); }, transitionBuilder: (Widget child, Animation animation) { return FadeTransition( opacity: animation, child: SizeTransition(sizeFactor: animation, axisAlignment: 1.0, child: Center(child: child)), ); }, // visible: logic.aktifHareket.value != null ? logic.aktifHareket.value!.altKartlar.isEmpty : false, child: hesaplarServis.listeAlSync(0, 1000).isEmpty ? Container( // width: double.infinity, padding: const EdgeInsets.only(bottom: 20, top: 20, left: 5, right: 5), margin: EdgeInsets.all(10), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.transparent, border: Border.all(color: Colors.grey.shade400), // boxShadow: [ // BoxShadow(color: Colors.teal.withOpacity(0.15), spreadRadius: -15.0, blurRadius: 12.0), // const BoxShadow(color: Colors.transparent, spreadRadius: -5.0, blurRadius: 12.0), // ], ), child: Column( children: [ const Row( mainAxisAlignment: MainAxisAlignment.center, children: [Text("💸", style: TextStyle(fontSize: 36))], ), FikoYTButton( text: "Hesap Bulunamadı", tema: Theme.of(context).extension()?.copyWith( textColor: Theme.of(context).extension()?.errorTextColor, textStrokeColor: Colors.white, fontSize: 16, ), ), /** */ ], ), ) : FutureBuilder( future: hesaplarServis.listeAl(0, 1000), builder: (context, snapshot) { return Wrap( spacing: 2, runSpacing: 2, children: (snapshot.data ?? []) .asMap() .entries .map((entry) { int index = entry.key; var hesap = entry.value; return HesaplarDialogItem(hsp: snapshot.data![index]); }) .toList() .cast(), ); }, ), ), /// Row( children: [ FikoYTButton( text: "❌ Kapat", tema: FikoYTButtonTheme( // textColor: Colors.white, backgroundColor: Colors.transparent, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), borderColor: Colors.red, elevation: 3, fontSize: 12, ), onPressed: () async { context.vRouter.pop(); }, ), Spacer(), ], ), ], ), ), ], ); } } class HesaplarDialogItem extends StatelessWidget { const HesaplarDialogItem({super.key, required this.hsp}); final Hesap hsp; @override Widget build(BuildContext context) { return MiniHesapKart( baslik: hsp.ismi, simge: hsp.simgesi, solUstWidget: Text(hsp.hesapTipi.emoji), altBaslik: "0 ${hsp.paraBirimi.value?.kod ?? ''}", sagUstBaslik: hsp.paraBirimi.value?.sembol, onPressed: () { Navigator.of(context).pop(hsp); }, ); // Container( // padding: EdgeInsets.all(3), // child: ListTileTheme( // contentPadding: EdgeInsets.zero, // dense: true, // horizontalTitleGap: 0, // minVerticalPadding: 0, // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)), // child: ListTile( // leading: FikoYTButton(text: "${hsp.simgesi}"), // title: FikoYTButton(text: "${hsp.ismi} ${hsp.paraBirimi.value?.sembol}"), // trailing: FikoYTButton(text: "${hsp.bakiye?.toParaBirimi()}"), // tileColor: Theme.of(context).extension()?.cardBackgroundColor, // isThreeLine: false, // onTap: () { // Navigator.of(context).pop(hsp); // }, // subtitle: FikoYTButton( // text: hsp.aciklama ?? 'Açıklama Yok', // tema: FikoYTButtonTheme(fontWeight: FontWeight.w200, fontSize: 12), // ), // ), // ), // ); } }