// ignore_for_file: library_private_types_in_public_api, invalid_use_of_protected_member import 'package:fikoyt_mesaici/apps/mesaici/servisler/page_ayar_satin_al_logic.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_double_ext.dart'; import 'package:fikoyt_mesaici/core/fikoyt.service.dart'; import 'package:fikoyt_mesaici/core/widgets/yazi_kutulari/yazi_kutulari.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import '../../../../../core/widgets/base_page/base_page_view.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 FikoSliverApp( 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 ), FikoYTButton( text: "Satın Al", tema: FikoYTButtonTheme( fontSize: 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()}")), FikoYTButton( text: """ FikoYT Mesaici'de bulunan bir çok özellik, Kısa bir süreliğine ücretsizdir. Hemen abone olun bu fırsatları kaçırmayın """, tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, fontSize: 12, fontWeight: FontWeight.w400, )), Obx( () { logic.satistaki_urunler.value; return Visibility( visible: logic.ozelSurum.value != true, child: 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: BoxDecoration( color: Theme.of(context).extension()?.cardBackgroundColor, borderRadius: const BorderRadius.all( Radius.circular(5), ), boxShadow: const [ 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: AnimatedFikoYTButton1( text: logic.satistaki_urunler[index].title.replaceAll("(FikoYT Mesaici)", ""), tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, fontSize: 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( () => AnimatedNumberFikoYTButton1( text: logic.satistaki_urunler.value[index].rawPrice, textBuilder: (tweenValue) => logic.satistaki_urunler.value[index].rawPrice.toParaBirimi(symbol: logic.satistaki_urunler.value[index].currencySymbol), tema: FikoYTButtonTheme( textAlign: TextAlign.center, borderColor: Colors.transparent, textColor: Colors.green, fontSize: 28, fontWeight: FontWeight.bold, ), ), ), FikoYTButton( text: logic.miUrunAlinmis(logic.satistaki_urunler.value[index].id) ? '${logic.satistaki_urunler[index].title.replaceAll("(FikoYT Mesaici)", "")} Paketine Abone Olduğunuz İçin Teşekkür Ederiz.' : logic.satistaki_urunler[index].description.replaceAll("(FikoYT Mesaici)", ""), tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, fontSize: 12, fontWeight: FontWeight.w400, )), Visibility( visible: !logic.miUrunAlinmis(logic.satistaki_urunler[index].id), child: Row( children: [ const Spacer(), FikoYTButton( text: "Satın Al", tema: FikoYTButtonTheme( fontSize: 12, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: Colors.white, borderColor: Colors.transparent, // borderColor: Colors.blue, backgroundColor: 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(), AnimatedFikoYTButton1( text: "Teşekkürler", tema: FikoYTButtonTheme( fontSize: 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, ), /** * */ Obx( () => Visibility( visible: logic.ozelSurum.value == false, 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: BoxDecoration( color: Theme.of(context).extension()?.cardBackgroundColor, borderRadius: const BorderRadius.all( Radius.circular(5), ), boxShadow: const [ 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: AnimatedFikoYTButton1( text: "FikoYT Özel Sürüm", tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, fontSize: 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, ), AnimatedFikoYTButton1( text: "∞", // textBuilder: (tweenValue) => 0.0.toParaBirimi(), tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.amber, fontSize: 28, fontWeight: FontWeight.bold, ), ), const Align( alignment: Alignment.center, child: Text("Promosyon Kodunu Giriniz"), ), Obx( () => FikoYaziKutusu( baslik: "Promosyon Kodu", simgeSol: const Text( "👩🏻‍🤝‍👨🏽", style: TextStyle( fontSize: 16, ), ), radius: 5.0, gizli: true, degeri: logic.promosyonKodu.value, degisti: (value) { logic.promosyonKodu.value = value; logic.promosyonKodu.refresh(); }, ), ), FikoYTButton( // ignore: dead_code text: false ? 'FikoYT Özel Sürüm Paketine Abone Olduğunuz İçin Teşekkür Ederiz.' : 'FikoYT \'un Sınırlı Sayıda Geliştiricilere Sunduğu Özel Sürüm', tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, fontSize: 12, fontWeight: FontWeight.w400, )), Visibility( visible: true, child: Row( children: [ const Spacer(), FikoYTButton( text: "İstek Yap", tema: FikoYTButtonTheme( fontSize: 12, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), textColor: Colors.white, textStrokeColor: Colors.transparent, // borderColor: Colors.blue, backgroundColor: Colors.blue, ), onPressed: () async { FikoYTService.servisMesaici.servisSatinAl.ozelMesaiciDurumSorgula(); // PurchaseParam test = PurchaseParam(productDetails: logic.satistaki_urunler[index]); // logic.buyProduct(test.productDetails); // await logic.iApConnection?.completePurchase(test); }, ), ], ), ), Visibility( visible: false, child: Row( children: [ const Spacer(), AnimatedFikoYTButton1( text: "Teşekkürler", tema: FikoYTButtonTheme( fontSize: 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); // }, ), ], ), ), ], ), ), ), ), ), /** */ Obx( () => Visibility( visible: logic.ozelSurum.value == true, 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: BoxDecoration( color: Theme.of(context).extension()?.cardBackgroundColor, borderRadius: const BorderRadius.all( Radius.circular(5), ), boxShadow: const [ 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: AnimatedFikoYTButton1( text: "FikoYT Özel Sürüm", tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, fontSize: 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, ), AnimatedFikoYTButton1( text: "💎", // textBuilder: (tweenValue) => 0.0.toParaBirimi(), tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Colors.amber, fontSize: 28, fontWeight: FontWeight.bold, )), FikoYTButton( // ignore: dead_code text: 'FikoYT Özel Sürüm Paketine Göstermiş Olduğunuz İlgiden Dolayı Teşekkür Ederiz.\nÖzel Sürümün Bitiş Tarihi', tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor?.withAlpha(200), fontSize: 12, fontWeight: FontWeight.w400, )), FikoYTButton( // ignore: dead_code text: '${logic.bitisTarihi.value?.formatla("dd MMMM yyyy EEEE")}\n${logic.bitisTarihi.value?.formatla("HH:mm:ss")}', tema: FikoYTButtonTheme( textAlign: TextAlign.center, textStrokeColor: Colors.black, textColor: Colors.white, fontSize: 14, fontWeight: FontWeight.w400, ), ), Row( children: [ const Spacer(), AnimatedFikoYTButton1( text: "Teşekkürler", tema: FikoYTButtonTheme( fontSize: 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); // }, ), ], ), ], ), ), ), ), ), // Padding( // padding: const EdgeInsets.symmetric(horizontal: 10), // child: FikoYTButton1( // text: """ FikoYT Mesaici 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: FikoYTButton1( // 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: FikoYTButton1( // text: """ FikoYT Mesaici 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: FikoYTButton( text: """Sözleşme Metni'nin tamamı için tıklayınız.""", tema: FikoYTButtonTheme( textAlign: TextAlign.start, textStrokeColor: Colors.transparent, textColor: Colors.redAccent, fontSize: 12, fontWeight: FontWeight.w700, ), onPressed: () {}, ), ), ], headerExpandedHeight: 315, // stretchMaxHeight: 100, fullyStretchable: false, backgroundColor: Theme.of(context).extension()?.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(); } }