// ignore_for_file: library_private_types_in_public_api, invalid_use_of_protected_member import 'package:fikoyt_finans/apps/mesaici/servisler/page_ayar_satin_al_logic.dart'; import 'package:fikoyt_finans/core/Extensions/fiko_double_ext.dart'; import 'package:fikoyt_finans/core/widgets/fiko_ui/fiko_button/fiko_button.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:get/get.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; import 'package:vrouter/vrouter.dart'; import '../../../../../core/widgets/base_page/base_page_view.dart'; import '../../../../../core/widgets/draggable_home.dart'; import '../../../../../core/widgets/fikoyt_elastic/fikoyt_elastic.dart'; import '../../../base_page_mesaici_view.dart'; import '../../../widgets/mesaici_navigasyon/mesaici_navigasyon.dart'; import '../../../widgets/uygulama_baslik/uygulama_baslik.dart'; //import for SkuDetailsWrapper class PageMesaiciSatinAl extends StatefulWidget { const PageMesaiciSatinAl({super.key}); @override _PageMesaiciSatinAlState createState() => _PageMesaiciSatinAlState(); } class _PageMesaiciSatinAlState extends State { PageAyarSatinAlLogic logic = Get.put(PageAyarSatinAlLogic()); BasePageLogic basePageLogic = Get.put(BasePageLogic()); BasePageMesaiciLogic basePageMesaiciLogic = Get.put(BasePageMesaiciLogic()); // final FikoYTMesaiciService FikoYTService.servisMesaici = Get.put(FikoYTMesaiciService()); // final FikoYTService servisFikoYT = FikoYTService(); //---> @override Widget build(BuildContext context) { SchedulerBinding.instance.addPostFrameCallback((_) { basePageLogic.subTitle.value = "💳 Satın Al"; }); ScreenSizeTypes screenType = FikoYTElastic.getScreenSizeType(context); [ // ScreenSizeTypes.small, ScreenSizeTypes.mini, ScreenSizeTypes.extraMini ].contains(screenType); /** */ // final ProductDetailsResponse response = // if (response.notFoundIDs.isNotEmpty) { // // Handle the error. // } /** */ return DraggableHome( leading: const UygulamaBaslikSol(), title: UygulamaBaslikOrta(), actions: const [ UygulamaBaslikSag(), ], headerWidget: PageView( children: [ Container( color: Colors.transparent, //Colors.orange, height: 300 - kToolbarHeight - 10, margin: const EdgeInsets.only(top: kToolbarHeight, bottom: 10, right: 10, left: 10), child: Column( children: [ Center( child: CircleAvatar( backgroundColor: Colors.blueAccent.shade700, radius: 64, child: CircleAvatar( backgroundColor: Colors.grey.shade50, radius: 54, child: const CircleAvatar( radius: 54, child: Text( "💳", style: TextStyle( fontSize: 54, ), ), ), //CircleAvatar ), //CircleAvatar ), //CircleAvatar ), FikoButton1( text: "Satın Al", textSize: 24, textStrokeColor: Colors.blue, ), SizedBox( height: 24.0, child: ListView( shrinkWrap: true, scrollDirection: Axis.horizontal, children: [ SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: RoundedRectangleBorder( borderRadius: const BorderRadius.all(Radius.circular(5)), side: BorderSide(width: 1, color: Colors.blue.withOpacity(0.5), style: BorderStyle.solid), ), padding: const EdgeInsets.all(0), child: const Text("🏠"), // const Icon(Icons.home, // color: Colors.lightBlue, size: 14), // color: Colors.white, onPressed: () async { // Scaffold.of(context).openEndDrawer(); context.vRouter.to("/mesaici"); }, ), ), const SizedBox(width: 3), SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: RoundedRectangleBorder( borderRadius: const BorderRadius.all(Radius.circular(5)), side: BorderSide(width: 1, color: Colors.blue.withOpacity(0.5), style: BorderStyle.solid), ), padding: const EdgeInsets.all(0), // color: Colors.white, onPressed: () async { // Scaffold.of(context).openEndDrawer(); context.vRouter.to("/mesaici/bildirimler"); }, child: const Text("🛎️"), // const Icon(Icons.notifications, // color: Colors.lightBlue, size: 14), ), ), const SizedBox(width: 3), SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: RoundedRectangleBorder( borderRadius: const BorderRadius.all(Radius.circular(5)), side: BorderSide(width: 1, color: Colors.blue.withOpacity(0.5), style: BorderStyle.solid), ), padding: const EdgeInsets.all(0), child: const Text("⚙️"), // const Icon(Icons.settings, // color: Colors.lightBlue, size: 14), // color: Colors.white, onPressed: () { // if (kDebugMode) { context.vRouter.to("/mesaici/ayarlar"); // Scaffold.of(context).openEndDrawer(); if (kDebugMode) { print('clicked'); } // } }, ), ), ], ), ), Center( child: Text( "Bu Sayfada Mesaiciyi Kullanmaya Devam Edebilmek İçin Dönemsel Satın Almalar Gerçekleştirebilirsiniz.", style: TextStyle( color: Colors.grey.shade800, fontSize: 10, ), textAlign: TextAlign.center, ), ), const MesaiciNavigasyon(), ], ), ), ], ), body: [ // Obx(() => Text("Alınmış Ugulamalar -> ${logic.alinmis_urunler.value.toString()}")), // Obx(() => Text("Alınmış Uygulamalar Varrr -> ${logic.miAlinanUrunVar()}")), FikoButton1( text: """ FikoYT Finans'de bulunan bir çok özellik, Kısa bir süreliğine ücretsizdir. Hemen abone olun bu fırsatları kaçırmayın """, textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.black87, textSize: 12, fontWeight: FontWeight.w400, ), Obx( () { logic.satistaki_urunler.value; return SizedBox( // height: 150, width: double.infinity, 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: ListView.builder( physics: const BouncingScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: logic.satistaki_urunler.value.length, padding: const EdgeInsets.symmetric( horizontal: 10, ), itemBuilder: (context, index) { return Visibility( visible: !logic.miAlinanUrunVar() || logic.miUrunAlinmis(logic.satistaki_urunler.value[index].id), child: Align( alignment: Alignment.center, child: Container( // width: 250, height: 150, padding: const EdgeInsets.all(5), margin: const EdgeInsets.all(5), constraints: const BoxConstraints(maxWidth: 250), decoration: const BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(5), ), boxShadow: [ BoxShadow(color: Colors.black12, offset: Offset(0, 0), spreadRadius: 1, blurRadius: 1.0, blurStyle: BlurStyle.outer), ], ), child: Column( children: [ Row( children: [ SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: const CircleBorder( // borderRadius: BorderRadius.all(Radius.circular(5)), side: BorderSide.none, ), padding: const EdgeInsets.all(0), child: const Text("🛒"), // color: Colors.white, onPressed: () {}, ), ), Expanded( child: AnimatedFikoButton1( text: logic.satistaki_urunler[index].title.replaceAll("(FikoYT Finans)", ""), textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.black87, textSize: 12, fontWeight: FontWeight.w700, ), ), SizedBox( width: 33, child: MaterialButton( elevation: 0, minWidth: 0, shape: const CircleBorder( // borderRadius: BorderRadius.all(Radius.circular(5)), side: BorderSide.none, ), padding: const EdgeInsets.all(0), child: const Text("♻️"), // color: Colors.white, onPressed: () {}, ), ), ], ), const Divider( height: 2, ), Obx( () => AnimatedNumberFikoButton1( text: logic.satistaki_urunler.value[index].rawPrice, textBuilder: (tweenValue) => logic.satistaki_urunler.value[index].rawPrice.toParaBirimi(symbol: logic.satistaki_urunler.value[index].currencySymbol), textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.green, textSize: 28, fontWeight: FontWeight.bold, ), ), FikoButton1( text: logic.miUrunAlinmis(logic.satistaki_urunler.value[index].id) ? '${logic.satistaki_urunler[index].title.replaceAll("(FikoYT Finans)", "")} Paketine Abone Olduğunuz İçin Teşekkür Ederiz.' : logic.satistaki_urunler[index].description.replaceAll("(FikoYT Finans)", ""), textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.black87, textSize: 12, fontWeight: FontWeight.w400, ), Visibility( visible: !logic.miUrunAlinmis(logic.satistaki_urunler[index].id), child: Row( children: [ const Spacer(), FikoButton1( text: "Satın Al", textSize: 12, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: Colors.white, textStrokeColor: Colors.transparent, // borderColor: Colors.blue, backColor: Colors.green, onPressed: () async { PurchaseParam test = PurchaseParam(productDetails: logic.satistaki_urunler[index]); logic.buyProduct(test.productDetails); // await logic.iApConnection?.completePurchase(test); }, ), ], ), ), Visibility( visible: logic.miUrunAlinmis(logic.satistaki_urunler[index].id), child: Row( children: [ const Spacer(), AnimatedFikoButton1( text: "Teşekkürler", textSize: 12, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: Colors.green, textStrokeColor: Colors.transparent, // borderColor: Colors.blue, // backColor: Colors.green, // onPressed: () async { // PurchaseParam test = PurchaseParam(productDetails: logic.satistaki_urunler[index]); // logic.buyProduct(test.productDetails); // // await logic.iApConnection?.completePurchase(test); // }, ), ], ), ), ], ), ), ), ); }, ), // ), ); }, ), const SizedBox( height: 15, ), // Padding( // padding: const EdgeInsets.symmetric(horizontal: 10), // child: FikoButton1( // text: """ FikoYT Finans abonelik sistemi ile kullanılan bir üründür.Siz izin vermediğiniz sürece, verileriniz hiçbir şekilde cihazınızdan dışarıya aktarılmaz ve izin vermediğiniz - paylaştığınız verilerde hiç bir şekilde bize ulaşmaz.""", // textAlign: TextAlign.start, // textStrokeColor: Colors.transparent, // textColor: Colors.black87, // textSize: 12, // fontWeight: FontWeight.w400, // ), // ), // Padding( // padding: const EdgeInsets.symmetric(horizontal: 10), // child: FikoButton1( // text: """ Tüm verileriniz tamamen sizin kontrolünüzde ve sizin sorumluluğunuzdadır.""", // textAlign: TextAlign.start, // textStrokeColor: Colors.transparent, // textColor: Colors.black87, // textSize: 12, // fontWeight: FontWeight.w400, // ), // ), // Padding( // padding: const EdgeInsets.symmetric(horizontal: 10), // child: FikoButton1( // text: """ FikoYT Finans Fiyat Değiştirme Hakkını Saklı Tutar.""", // textAlign: TextAlign.start, // textStrokeColor: Colors.transparent, // textColor: Colors.black87, // textSize: 12, // fontWeight: FontWeight.w700, // ), // ), Padding( padding: const EdgeInsets.symmetric(horizontal: 10), child: FikoButton1( text: """Sözleşme Metni'nin tamamı için tıklayınız.""", textAlign: TextAlign.start, textStrokeColor: Colors.transparent, textColor: Colors.redAccent, textSize: 12, fontWeight: FontWeight.w700, onPressed: () {}, ), ), ], headerExpandedHeight: 315, // 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("/"); }, ); } @override void dispose() { // Get.delete(); super.dispose(); } }