import 'package:fiko_flutter_web/core/widgets/header_widget/header_widget.dart'; import 'package:fiko_flutter_web/core/widgets/uygulama_baslik/uygulama_baslik.dart'; import 'package:fiko_flutter_web/kisi/pages/ana-sayfa/ana-sayfa-fab.dart'; import 'package:fikoyt_ui_web/fikoyt_ui_web.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class SayfaKisiAna extends StatefulWidget { const SayfaKisiAna({super.key}); @override State createState() => _SayfaKisiAnaState(); } class _SayfaKisiAnaState extends State { final Map _lastPressTimes = {}; bool isSecondRun({Duration threshold = const Duration(milliseconds: 500)}) { final now = DateTime.now(); final lastPressTime = _lastPressTimes["a"]; if (lastPressTime != null && now.difference(lastPressTime) < threshold) { _lastPressTimes.remove("a"); // İkinci kez basıldığını belirledik, sıfırla return true; // 🚀 İkinci kez basıldı } _lastPressTimes["a"] = now; return false; // İlk basım } @override Widget build(BuildContext context) { // SchedulerBinding.instance.addPostFrameCallback((_) { // finansServis?.altBaslik.value = "Ana Sayfa"; // }); return TusYayilmasiEngelleWidget( shouldBlockKey: (event) { if (event.logicalKey == LogicalKeyboardKey.goBack || event.logicalKey == LogicalKeyboardKey.goHome || event.logicalKey == LogicalKeyboardKey.allCandidates || event.logicalKey == LogicalKeyboardKey.cancel || event.logicalKey == LogicalKeyboardKey.browserBack || event.physicalKey == PhysicalKeyboardKey.escape || event.physicalKey == PhysicalKeyboardKey.exit || event.physicalKey == PhysicalKeyboardKey.browserBack || event.physicalKey == PhysicalKeyboardKey.close || event.physicalKey == PhysicalKeyboardKey.undo) { if (isSecondRun()) { return false; } return true; } return false; }, child: FikoYTSliverApp( leading: UygulamaBaslikSol(), title: UygulamaBaslikOrta(altBaslik: "Ana Sayfa"), actions: [UygulamaBaslikSag()], drawer: SizedBox.shrink(), backgroundColor: Theme.of(context).extension()?.backgroundColor, appBarColor: Theme.of(context).extension()?.appBarColor?.withAlpha(230), headerExpandedHeight: 230, // stretchMaxHeight: 100, fullyStretchable: true, centerTitle: true, alwaysShowLeadingAndAction: true, golgeGoster: false, alwaysShowTitle: true, curvedBodyRadius: 0, // bottomNavigationBarHeight: 50, // bottomNavigationBar: Padding( // padding: const EdgeInsets.only(left: 50.0, right: 50.0), // child: ClipPath( // clipper: ShapeBorderClipper( // shape: RoundedRectangleBorder( // borderRadius: BorderRadius.only(topRight: Radius.circular(35), topLeft: Radius.circular(35)), // ), // ), // child: AnaSayfaFab(), // ), // ), // onStretchTrigger: () async { // context.vRouter.to("/"); // }, /// bottomNavigationBar: Padding(padding: const EdgeInsets.only(bottom: 8.0), child: AnaSayfaFab()), // floatingActionButton: Obx(() { // finansServis?.aktifKullanici.value; // return AnaSayfaFab(); // }), /// headerWidget: // Obx( // () => HeaderWidget( ovalResimUrl: "🏠", baslik: "Başlık Yazısı", baslikTheme: Theme.of(context).extension()?.copyWith( textColor: Theme.of(context).extension()?.secondaryTextColor, fontWeight: FontWeight.bold, fontSize: 16, ), altBaslik: "Sisteminizde Kayıtlı Verilerinizin Yönetim Ve Gözetim Merkezi.", altBaslikTheme: Theme.of(context).extension()?.copyWith( textColor: Theme.of(context).extension()?.tertiaryTextColor, fontWeight: FontWeight.normal, fontSize: 12, ), // ovalResimTiklandi: finansServis?.profilResmiDegistir, // ovalResimCiftTiklandi: finansServis?.profilResmiSil, ), // ), /// bodyMaxWidth: 450, body: [ /** */ // HesapListesiWidget(), // SizedBox(height: 1400), // Text("sffffffffffffff"), ], sliverAltKisimGoster: false, sliverAltKisim: SizedBox.shrink(), ), ); } }