import 'package:fikoyt_akcali_v1/apps/finans/core/models/finans.model.dart'; import 'package:fikoyt_akcali_v1/apps/finans/core/services/finans.servis.dart'; import 'package:fikoyt_akcali_v1/apps/finans/kisi/pages/ana-sayfa/ana-sayfa.dart'; import 'package:fikoyt_akcali_v1/apps/finans/uye/kategoriler/kategoriler.dart'; import 'package:fikoyt_akcali_v1/core/widgets/uygulama_baslik/uygulama_baslik.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'; import 'package:flutter/scheduler.dart'; import 'package:isar/isar.dart'; class SayfaKisiGiris extends StatefulWidget { const SayfaKisiGiris({super.key}); @override State createState() => _SayfaKisiGirisState(); } class _SayfaKisiGirisState extends State { RxString ad = RxString("Fikri TOPALOĞLU"); RxString parola = RxString("1299"); FinansServis? finansServis = FikoYTCoreService.servisler.getServis(); void Function()? girisAction; girisYap(BuildContext context) { toastification.dismissAll(delayForAnimation: true); Isar? isar = finansServis?.isar; finansServis?.aktifKullanici.value = isar?.kullanicis.where().filter().ismiEqualTo(ad.value).and().parolaEqualTo(parola.value).findFirstSync(); if (finansServis?.aktifKullanici.value != null) { // FikoYTCoreService.navigatorKey.currentContext?.vRouter.to("/"); /// Giriş Başarılı toastification.show( context: FikoYTCoreService.navigatorKey.currentContext, type: ToastificationType.success, style: ToastificationStyle.fillColored, // title: Text("FikoYT Sistem"), description: Text("Sn. ${ad.value} Girişiniz Yapıldı."), alignment: Alignment.topRight, autoCloseDuration: const Duration(seconds: 4), borderRadius: BorderRadius.circular(4.0), // boxShadow: lowModeShadow, showProgressBar: false, dragToClose: true, applyBlurEffect: true, ); return finansServis?.aktifKullanici.value; } else { /// Kayıt Bulunamadı toastification.show( context: FikoYTCoreService.navigatorKey.currentContext, type: ToastificationType.error, style: ToastificationStyle.fillColored, // title: Text("FikoYT Sistem"), description: Text("Kayıt Bulunamadı."), alignment: Alignment.topRight, autoCloseDuration: const Duration(seconds: 4), borderRadius: BorderRadius.circular(4.0), // boxShadow: lowModeShadow, showProgressBar: true, dragToClose: true, applyBlurEffect: true, ); return null; } } @override void initState() { SchedulerBinding.instance.addPostFrameCallback((_) async { // finansServis?.altBaslik.value = "Giriş Yap"; finansServis?.aktifKullanici.value != null ? finansServis?.solMenuAl(context) : null; Isar? isar = finansServis?.isar; if (((await isar?.kullanicis.count()) ?? 0) <= 0) { context.vRouter.to("/ilk-kurulum"); } }); super.initState(); } @override Widget build(BuildContext context) { finansServis = FikoYTCoreService.servisler.getServis(); return FikoYTSliverApp( leading: UygulamaBaslikSol(), title: UygulamaBaslikOrta(altBaslik: "Giriş Yap"), actions: [UygulamaBaslikSag()], drawer: finansServis?.solMenu.value, backgroundColor: Theme.of(context).extension()?.backgroundColor, appBarColor: Theme.of(context).extension()?.appBarColor?.withAlpha(230), headerExpandedHeight: 225, // stretchMaxHeight: 100, fullyStretchable: true, centerTitle: true, alwaysShowLeadingAndAction: true, alwaysShowTitle: true, curvedBodyRadius: 0, onStretchTrigger: () async { // context.vRouter.to("/"); }, golgeGoster: false, sliverAltKisimGoster: true, sliverAltKisim: SizedBox.shrink(), /// headerWidget: Column( children: [ const SizedBox(height: kToolbarHeight), FikoytOvalResim(resimUrl: "🔐", tema: FikoYTOvalResimTheme(borderColor: Colors.blue, radius: 40)), FikoYTButton( text: "Sisteme Giriş", tema: FikoYTButtonTheme(textColor: Colors.black, fontWeight: FontWeight.w700, fontSize: 18), ), FikoYTButton( text: "Bu Cihazda Oluşturduğunuz Bilgileri Girerek Sisteme Giriş Yapabilirsiniz.", tema: FikoYTButtonTheme( textColor: Colors.black38, fontWeight: FontWeight.normal, fontSize: 12, textAlign: TextAlign.center, ), ), ], ), /// body: [ SizedBox(height: 15), Center( child: Container( constraints: BoxConstraints(maxWidth: 300), child: FikoYTCard( theme: FikoYTCardTheme( elevation: 0, borderRadius: BorderRadius.circular(10), margin: EdgeInsets.all(10), padding: EdgeInsets.all(10), backgroundColor: Theme.of(context).extension()?.cardBackgroundColor, borderColor: Colors.grey.shade400, border: Border.all(color: Colors.grey.shade400), ), children: [ Column( spacing: 5, mainAxisSize: MainAxisSize.max, children: [ Center( child: const Image( image: AssetImage('packages/fikoyt_ui/assets/core/icons/fikoyt.png'), filterQuality: FilterQuality.high, height: 76, // width: widget.logoWidth * cardWidth, ), ), FikoYaziKutusu( autofocus: true, baslik: "Kullanıcı Adı", simgeSol: const Text("👩🏻‍🤝‍👨🏽", style: TextStyle(fontSize: 14)), yaziBoyutu: 12.0, radius: 5.0, degeri: ad.value, degisti: (value) { ad.value = value; }, oneriOtomatikDoldurma: [AutofillHints.name, AutofillHints.middleName, AutofillHints.familyName], ), FikoYaziKutusu( baslik: "Parola", simgeSol: const Text("🔐", style: TextStyle(fontSize: 14)), gizli: true, obscuringCharacter: "♥", yaziBoyutu: 12.0, radius: 5.0, degeri: parola.value, degisti: (value) { parola.value = value; }, oneriOtomatikDoldurma: [AutofillHints.email], ), /// SizedBox(height: 5), Row( children: [ Spacer(), Stack( children: [ FikoYTButton( text: "🚪 Giriş Yap", tema: FikoYTButtonTheme( textColor: Colors.white, backgroundColor: Colors.blue, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), borderColor: Colors.blueAccent, elevation: 3, fontSize: 12, ), ), finansServis?.animasyonluWidgetAc( ozelId: "Ana-Giriş-Buton", routeSettings: RouteSettings(name: "/"), mevcutWidget: (context, action) { girisAction = action; return FikoYTButton( text: "🚪 Giriş Yap", tema: FikoYTButtonTheme( textColor: Colors.white, backgroundColor: Colors.blue, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), borderColor: Colors.blueAccent, elevation: 3, fontSize: 12, ), onPressed: () { if (girisYap(context) != null) { girisAction?.call(); finansServis?.aktifKullanici.refresh(); finansServis?.solMenuAl(context); // context.vRouter.to("/"); } }, ); }, acilacakWidget: (context, action) { return PopScope( onPopInvokedWithResult: (context, result) { toastification.show( context: FikoYTCoreService.navigatorKey.currentContext, type: ToastificationType.error, style: ToastificationStyle.fillColored, // title: Text("FikoYT Sistem"), description: Text("Sn. ${finansServis?.aktifKullanici.value?.ismi} Çıkışınız Yapıldı."), alignment: Alignment.topRight, autoCloseDuration: const Duration(seconds: 4), borderRadius: BorderRadius.circular(4.0), // boxShadow: lowModeShadow, showProgressBar: false, dragToClose: true, applyBlurEffect: true, ); finansServis?.rotalar.clear(); toastification.dismissAll(delayForAnimation: true); finansServis?.solMenu.value = null; finansServis?.aktifKullanici.value = null; finansServis?.solMenu.refresh(); finansServis?.aktifKullanici.refresh(); }, child: SayfaKategoriler(), // SayfaKisiAna(), ); }, ), ], ), ], ), ], ), ], ), ), ), ], ); } }