import 'package:fikoyt_akcali_v1/apps/finans/core/services/finans.servis.dart'; import 'package:fikoyt_akcali_v1/apps/finans/uye/hareketler/hareket-ekle/hareket-ekle.dart'; import 'package:fikoyt_akcali_v1/apps/finans/uye/hesaplar/__atik__/hesap-turleri/hesap-turu.dart'; import 'package:fikoyt_akcali_v1/apps/finans/uye/hesaplar/hesap/pages/hesap-ekle.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart' hide SlideEffect, SwapEffect; import 'package:fikoyt_ui/ui/fikoyt_card.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; class AnaSayfaFab extends StatelessWidget { bool isOpenFab = false; FinansServis? finansServis = FikoYTCoreService.servisler.getServis(); AnaSayfaFab({super.key}); @override Widget build(BuildContext context) { return StatefulBuilder( builder: (context, setState) { return TapRegion( child: AnimatedContainer( alignment: Alignment.center, width: isOpenFab ? 150 : 60, height: isOpenFab ? 150 : 60, margin: EdgeInsets.only(bottom: isOpenFab ? 20 : 0), decoration: BoxDecoration( color: isOpenFab ? Theme.of(context).extension()?.cardBackgroundColor : Colors.white, borderRadius: BorderRadius.circular(isOpenFab ? 5 : 35), boxShadow: Theme.of(context).extension()?.boxShadow, ), clipBehavior: Clip.hardEdge, duration: Duration(milliseconds: ((finansServis?.openContainerDuration ?? Duration.zero).inMilliseconds / 2).toInt()), // margin: !widget.isOpenFab ? EdgeInsets.zero : EdgeInsets.only(right: 30, bottom: 30), // curve: Curves.easeInOut, child: AnimatedSwitcher( duration: finansServis?.openContainerDuration ?? Duration.zero, reverseDuration: Duration(milliseconds: 250), child: !isOpenFab ? FikoYTButton( text: "🥏", tema: FikoYTButtonTheme( textColor: Colors.white, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), // borderColor: Colors.blueAccent, elevation: 3, fontSize: 36, ), ) : 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) { Future.delayed(250.ms, () { setState(() { isOpenFab = false; }); }); return true; } return false; }, child: Column( children: [ Expanded( child: PageView( controller: FikoYTPageController.getInstance("AnaSayfaFabPage"), physics: BouncingScrollPhysics(), scrollDirection: Axis.horizontal, children: [ /// akcaliSayfa(context), /// finansServis?.animasyonluWidgetAc( ozelId: "Ana-Fab-Hesap-Gelir-Ekle", routeSettings: RouteSettings(name: "/uye/hareketler/ekle"), mevcutWidget: (context, action) => Container( decoration: BoxDecoration( color: isOpenFab ? Theme.of(context).extension()?.cardBackgroundColor : Colors.white, borderRadius: BorderRadius.circular(isOpenFab ? 5 : 35), ), child: FittedBox( clipBehavior: Clip.hardEdge, fit: BoxFit.scaleDown, child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ FikoYTButton( text: "➕", tema: FikoYTButtonTheme( // backgroundColor: Colors.amberAccent, radius: 0, fontSize: 48, ), ), FikoYTButton( text: "Hareket Ekle", tema: FikoYTButtonTheme( // backgroundColor: Colors.amberAccent, radius: 0, fontWeight: FontWeight.bold, ), ), FikoYTButton( text: "Gelir Eklemeniz İçin \n Akçalıya Yönlendirir", tema: FikoYTButtonTheme( // backgroundColor: Colors.amberAccent, radius: 0, fontWeight: FontWeight.w300, fontSize: 11, ), ), ], ), ), ), acilacakWidget: (context, action) => SayfaHareketEkle(animClose: action, hesap: null), ), ], ), ), SmoothPageIndicator( controller: FikoYTPageController.getInstance("AnaSayfaFabPage"), count: 2, effect: const JumpingDotEffect( dotHeight: 6, dotWidth: 6, spacing: 2, jumpScale: 1.3, verticalOffset: 5, ), ), ], ), ), ), ), onTapInside: (v) { if (isOpenFab != true) { setState(() { isOpenFab = true; }); } }, onTapOutside: (event) { if (isOpenFab != false) { Future.delayed(250.ms, () { setState(() { isOpenFab = false; }); }); } }, ); }, ); } Container akcaliSayfa(BuildContext context) { return Container( decoration: BoxDecoration( color: isOpenFab ? Theme.of(context).extension()?.cardBackgroundColor : Colors.white, borderRadius: BorderRadius.circular(isOpenFab ? 5 : 35), ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ FittedBox( fit: BoxFit.scaleDown, child: FikoYTButton( text: "💰 Akçalı Komutları", tema: FikoYTButtonTheme(fontSize: 12, edgePadding: EdgeInsets.all(3)), ), ), Divider(height: 2, thickness: 1), Expanded( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ /// finansServis?.animasyonluWidgetAc( ozelId: "AnaSayfaFab-HesapEkle-16", routeSettings: RouteSettings(name: "/uye/akcali/hesap-turleri", arguments: null), mevcutWidget: (context, action) { return FikoYTButton( text: "💳 Hesap Ekle", tema: FikoYTButtonTheme( // backgroundColor: Colors.amberAccent, radius: 0, edgePadding: EdgeInsets.symmetric(horizontal: 1, vertical: 3), fontWeight: FontWeight.normal, textShadow: List.empty(), fontSize: 12, ), onPressed: action, ); }, acilacakWidget: (context, action) { return SayfaHesapEkle(animClose: action); }, onClosed: (p0) { finansServis?.hesaplarServis.guncelle.refresh(); }, ), /// finansServis?.animasyonluWidgetAc( ozelId: "AnaSayfaFab-HesapTürüEkle", routeSettings: RouteSettings(name: "/uye/akcali/hesap-turleri", arguments: null), mevcutWidget: (context, action) { return FikoYTButton( text: "🧵 Hesap Türü Ekle", tema: FikoYTButtonTheme( // backgroundColor: Colors.amberAccent, radius: 0, edgePadding: EdgeInsets.symmetric(horizontal: 1, vertical: 3), fontWeight: FontWeight.normal, textShadow: List.empty(), fontSize: 12, ), onPressed: action, ); }, acilacakWidget: (context, action) { return SayfaHesapTuru(); }, onClosed: (p0) { finansServis?.hesaplarServis.guncelle.refresh(); }, ), ], ), ), ), ], ), ); } }