// ignore_for_file: library_private_types_in_public_api import 'package:fikoyt_akcali/apps/finans/widgets/akcali-ui/mini-hesap-kart.dart'; import 'package:fikoyt_akcali/apps/finans/widgets/ozet_aylik/ozet_aylik.dart'; import 'package:fikoyt_akcali/apps/finans/widgets/uygulama_baslik/uygulama_baslik.dart'; import 'package:fikoyt_akcali/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart' as sc; import 'package:flutter_animate/flutter_animate.dart'; // import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:get/get.dart'; import 'package:vrouter/vrouter.dart'; import '../../../../../../core/widgets/base_page/base_page_view.dart'; import '../../../../../../core/widgets/fikoyt_elastic/fikoyt_elastic.dart'; import '../../../../core/fikoyt.service.dart'; import '../../../../core/widgets/draggable_home.dart'; import '../../base_page_mesaici_view.dart'; import '../../widgets/aktif_kart/aktif_kart.dart'; import '../../widgets/kullanici_bilgi_navigasyon/kullanici_bilgi_navigasyon.dart'; class PageMesaiciHomeLogic extends GetxController {} class PageMesaiciHome extends StatefulWidget { const PageMesaiciHome({super.key}); @override _PageMesaiciHomeState createState() => _PageMesaiciHomeState(); } class _PageMesaiciHomeState extends State { PageMesaiciHomeLogic logic = Get.put(PageMesaiciHomeLogic()); BasePageLogic basePageLogic = Get.put(BasePageLogic()); BasePageMesaiciLogic basePageMesaiciLogic = Get.put(BasePageMesaiciLogic()); // final FikoYTMesaiciService FikoYTService.servisMesaici = Get.put(FikoYTMesaiciService()); final FikoYTService servisFikoYT = FikoYTService(); //---> int touchedIndex = 0; @override void initState() { sc.SchedulerBinding.instance.addPostFrameCallback((_) { FikoYTService.servisMesaici.aktifAy.value = DateTime.now(); }); super.initState(); } @override Widget build(BuildContext context) { sc.SchedulerBinding.instance.addPostFrameCallback((_) { basePageLogic.subTitle.value = "🏠 Merkez"; }); ScreenSizeTypes screenType = FikoYTElastic.getScreenSizeType(context); [ // ScreenSizeTypes.small, ScreenSizeTypes.mini, ScreenSizeTypes.extraMini ].contains(screenType); return DraggableHome( leading: const UygulamaBaslikSol(), title: UygulamaBaslikOrta(), actions: const [ UygulamaBaslikSag(), ], headerWidget: PageView( children: [ /** */ /** */ Column( children: [ const SizedBox( height: kToolbarHeight, ), Container( color: Colors.transparent, //Colors.orange, height: 280, // margin: const EdgeInsets.only(top: kToolbarHeight, bottom: 10, right: 10, left: 10), child: Obx( () => KullaniciBilgiNavigasyon( cap: 76.0, simge: FikoYTService.servisMesaici.profilResmi.value == null ? FikoButton1( onPressed: () async { await FikoYTService.servisMesaici.profilResmiSec(); }, onLongPress: () async { await FikoYTService.servisMesaici.profilResmiSil(); FikoYTService.servisMesaici.profilResmi.refresh(); }, text: "🏠", radius: 64, textSize: 64, ).animate(effects: [ const FadeEffect(), const ShimmerEffect( delay: Duration(seconds: 1), ), ]) : GestureDetector( onTap: () async { await FikoYTService.servisMesaici.profilResmiSec(); }, onLongPress: () async { await FikoYTService.servisMesaici.profilResmiSil(); FikoYTService.servisMesaici.profilResmi.refresh(); }, child: Image.memory( FikoYTService.servisMesaici.profilResmi.value!, fit: BoxFit.cover, width: double.infinity, height: double.infinity, ).animate(effects: [ const FadeEffect(), const ShimmerEffect( delay: Duration(seconds: 1), ), ]), ), ), ), ), ], ), ], ), body: [ /** */ const Wrap( children: [ MiniHesapKart(), MiniHesapKart(), MiniHesapKart(), MiniHesapKart(), MiniHesapKart(), MiniHesapKart(), MiniHesapKart(), ], ), const SizedBox( height: 5, ), Align( alignment: Alignment.center, child: SizedBox( width: 150, child: FikoButton1( text: "🎫 Hesaplar / Kartlar", backColor: Colors.grey.withValues( alpha: 180, ), edgePadding: EdgeInsets.only( top: 5, bottom: 5, ), onPressed: () {}, ), ), ), /** */ const SizedBox( height: 5, ), SizedBox( height: 22, child: ShaderMask( shaderCallback: (Rect rect) { return const LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Colors.purple, Colors.transparent, Colors.transparent, Colors.purple], stops: [0.0, 0.1, 0.9, 1.0], // 10% purple, 80% transparent, 10% purple ).createShader(rect); }, blendMode: BlendMode.dstOut, child: SingleChildScrollView( // controller: scrollController, // shrinkWrap: true, physics: const BouncingScrollPhysics(), scrollDirection: Axis.horizontal, child: Row( children: [ const SizedBox( width: 20, ), // for (var i = 0; i < 5; i++) Padding( padding: const EdgeInsets.symmetric( horizontal: 1, ), child: FikoButton1( text: "📅 Bütçeler", borderColor: Colors.grey.shade400, backColor: Colors.black.withOpacity(0), edgePadding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), textColor: Colors.amberAccent, textStrokeColor: Colors.blue, onLongPress: () {}, onPressed: () {}, ), ), Padding( padding: const EdgeInsets.symmetric( horizontal: 1, ), child: FikoButton1( text: "📅 Planlamalar", borderColor: Colors.grey.shade400, backColor: Colors.black.withOpacity(0), edgePadding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), textColor: Colors.amberAccent, textStrokeColor: Colors.blue, onLongPress: () {}, onPressed: () {}, ), ), const SizedBox( width: 20, ), ], ), ), ), ), /** */ Row( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, children: [ FikoButton1( text: Icon( Icons.help_outline_rounded, color: Colors.blue.withAlpha(100), size: 24, ), radius: 32, // backColor: Colors.amber.withAlpha(80), // borderColor: Colors.amber.withAlpha(200), route: "/mesaici/yardim/konu=ana_sayfa", ), ], ), // Column( // children: [ // Padding( // padding: const EdgeInsets.only(left: 24, right: 24, top: 15, bottom: 24), // child: Stack( // clipBehavior: Clip.none, // children: [ // Padding( // padding: const EdgeInsets.only(top: 20), // child: Container( // decoration: BoxDecoration( // color: Colors.blueAccent.shade100.withOpacity(0.2), // borderRadius: const BorderRadius.only(topLeft: Radius.circular(8.0), bottomLeft: Radius.circular(8.0), bottomRight: Radius.circular(8.0), topRight: Radius.circular(8.0)), // border: Border.all(color: Colors.blueAccent), // boxShadow: [ // BoxShadow( // color: Colors.grey.withOpacity(0.2), // // offset: const Offset(0.9, 0.9), // offset: const Offset(3, 3), // spreadRadius: 5, // blurRadius: 10.0, // ), // ], // ), // child: Padding( // padding: const EdgeInsets.only(left: 46, bottom: 12, right: 16, top: 12), // child: Column( // children: [ // Text( // 'Bu Ay Devamsızlığınız Oldukça Fazla.İş Yerinizde Hayaletleşmeyin', // textAlign: TextAlign.left, // style: TextStyle( // fontWeight: FontWeight.w500, // fontSize: 12, // letterSpacing: 0.0, // color: Colors.blueAccent.shade700, // ), // ), // Align( // alignment: Alignment.centerRight, // child: TextButton( // // icon: const Text("💡"), // child: const Text( // "💡 Öneriler", // style: TextStyle( // color: Colors.blue, // fontWeight: FontWeight.bold, // fontSize: 12, // ), // ), // onPressed: () {}, // ), // ) // ], // ), // ), // ), // ), // const Positioned( // top: -10, // left: 0, // child: SizedBox( // width: 80, // height: 80, // child: Text( // "👻", // style: TextStyle(fontSize: 40), // ), // ), // ) // ], // ), // ), // ], // ), Container( margin: const EdgeInsets.only(top: 10, bottom: 10, right: 10, left: 10), child: AktifKart( kayit: FikoYTService.servisMesaici.aktifCalisma, ), ), Obx( () { FikoYTService.servisMesaici.aktifCalisma?.value; return Container( margin: const EdgeInsets.only(top: 0, bottom: 10, right: 10, left: 10), // ignore: prefer_const_constructors child: OzetAylik(), ); }, ), ], headerExpandedHeight: 340, // stretchMaxHeight: 100, fullyStretchable: false, backgroundColor: Colors.grey.shade200, centerTitle: true, alwaysShowLeadingAndAction: true, appBarColor: Colors.blue.shade500, alwaysShowTitle: true, curvedBodyRadius: 0, onStretchTrigger: () async { context.vRouter.to("/"); }, sliverAltKisim: Stack( alignment: Alignment.center, fit: StackFit.expand, children: [ Center( child: FittedBox( child: KullaniciBilgiNavigasyon(), ), ), ], ), // sliverAltKisim: FittedBox( // fit: BoxFit.scaleDown, // child: Column( // children: [ // // const Image( // // image: AssetImage('assets/core/icons/fikoyt.png'), // // filterQuality: FilterQuality.high, // // height: 72, // // // width: widget.logoWidth * cardWidth, // // ), // Center( // child: KullaniciBilgiNavigasyon(), // ), // ], // ), // ), ); } @override void dispose() { Get.delete(); super.dispose(); } List showingSections() { return List.generate(4, (i) { final isTouched = i == touchedIndex; final fontSize = isTouched ? 16.0 : 12.0; final radius = isTouched ? 60.0 : 50.0; final widgetSize = isTouched ? 45.0 : 30.0; const shadows = [Shadow(color: Colors.black, blurRadius: 2)]; switch (i) { case 0: return PieChartSectionData( color: Colors.blue, value: 40, title: '40%', radius: radius, titleStyle: TextStyle( fontSize: fontSize, fontWeight: FontWeight.bold, color: const Color(0xffffffff), shadows: shadows, ), badgeWidget: _Badge( 'assets/icons/ophthalmology-svgrepo-com.svg', size: widgetSize, borderColor: Colors.black54, ), badgePositionPercentageOffset: .98, ); case 1: return PieChartSectionData( color: Colors.yellow, value: 30, title: '30%', radius: radius, titleStyle: TextStyle( fontSize: fontSize, fontWeight: FontWeight.bold, color: const Color(0xffffffff), shadows: shadows, ), badgeWidget: _Badge( 'assets/icons/librarian-svgrepo-com.svg', size: widgetSize, borderColor: Colors.black54, ), badgePositionPercentageOffset: .98, ); case 2: return PieChartSectionData( color: Colors.purple, value: 16, title: '16%', radius: radius, titleStyle: TextStyle( fontSize: fontSize, fontWeight: FontWeight.bold, color: const Color(0xffffffff), shadows: shadows, ), badgeWidget: _Badge( 'assets/icons/fitness-svgrepo-com.svg', size: widgetSize, borderColor: Colors.black54, ), badgePositionPercentageOffset: .98, ); case 3: return PieChartSectionData( color: Colors.green, value: 15, title: '15%', radius: radius, titleStyle: TextStyle( fontSize: fontSize, fontWeight: FontWeight.bold, color: const Color(0xffffffff), shadows: shadows, ), badgeWidget: _Badge( 'assets/icons/worker-svgrepo-com.svg', size: widgetSize, borderColor: Colors.black54, ), badgePositionPercentageOffset: .98, ); default: throw Exception('Oh no'); } }); } } class _Badge extends StatelessWidget { const _Badge( this.svgAsset, { required this.size, required this.borderColor, }); final String svgAsset; final double size; final Color borderColor; @override Widget build(BuildContext context) { return AnimatedContainer( duration: PieChart.defaultDuration, width: size, height: size, decoration: BoxDecoration( color: Colors.white, shape: BoxShape.circle, border: Border.all( color: borderColor, width: 2, ), boxShadow: [ BoxShadow( color: Colors.black.withOpacity(.5), offset: const Offset(3, 3), blurRadius: 3, ), ], ), padding: EdgeInsets.all(size * .15), child: const Center( child: Text("👨🏻‍💼"), ), ); } }