From 45f3ecf70f37ef872dd07c9738d203e929a36c28 Mon Sep 17 00:00:00 2001 From: "balazsmanus@chameleon" Date: Fri, 28 Feb 2025 16:26:25 +0100 Subject: [PATCH] nuke out plus shit --- refilc/lib/ui/filter/widgets/ads.dart | 3 +- .../plus/components/active_sponsor_card.dart | 170 ---- .../lib/plus/components/avatar_stack.dart | 26 - .../lib/plus/components/github_button.dart | 175 ---- .../lib/plus/components/github_card.dart | 54 -- .../components/github_connect_button.dart | 107 --- .../lib/plus/components/goal_card.dart | 81 -- .../lib/plus/components/plan_card.dart | 348 -------- .../lib/plus/components/reward_card.dart | 79 -- .../lib/plus/components/supporter_chip.dart | 35 - .../plus/components/supporter_group_card.dart | 79 -- .../lib/plus/components/supporter_tile.dart | 23 - .../plus/components/supporters_button.dart | 82 -- refilc_mobile_ui/lib/plus/plus_screen.dart | 845 ------------------ .../lib/plus/plus_screen.i18n.dart | 206 ----- refilc_mobile_ui/lib/plus/premium_button.dart | 126 --- .../lib/plus/styles/gradients.dart | 13 - .../lib/plus/supporters_screen.dart | 144 --- .../settings/submenu/code_scanner.dart | 172 ---- .../lib/ui/mobile/plus/settings_inline.dart | 4 +- refilc_plus/lib/ui/mobile/plus/upsell.dart | 3 +- 21 files changed, 4 insertions(+), 2771 deletions(-) delete mode 100644 refilc_mobile_ui/lib/plus/components/active_sponsor_card.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/avatar_stack.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/github_button.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/github_card.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/github_connect_button.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/goal_card.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/plan_card.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/reward_card.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/supporter_chip.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/supporter_group_card.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/supporter_tile.dart delete mode 100644 refilc_mobile_ui/lib/plus/components/supporters_button.dart delete mode 100644 refilc_mobile_ui/lib/plus/plus_screen.dart delete mode 100644 refilc_mobile_ui/lib/plus/plus_screen.i18n.dart delete mode 100644 refilc_mobile_ui/lib/plus/premium_button.dart delete mode 100644 refilc_mobile_ui/lib/plus/styles/gradients.dart delete mode 100644 refilc_mobile_ui/lib/plus/supporters_screen.dart delete mode 100644 refilc_mobile_ui/lib/screens/settings/submenu/code_scanner.dart diff --git a/refilc/lib/ui/filter/widgets/ads.dart b/refilc/lib/ui/filter/widgets/ads.dart index c4a16601..ce9406d1 100644 --- a/refilc/lib/ui/filter/widgets/ads.dart +++ b/refilc/lib/ui/filter/widgets/ads.dart @@ -4,7 +4,6 @@ import 'package:refilc/models/ad.dart'; import 'package:refilc/ui/date_widget.dart'; import 'package:refilc_mobile_ui/common/widgets/ad/ad_tile.dart'; import 'package:refilc_mobile_ui/common/widgets/ad/ad_viewable.dart' as mobile; -import 'package:refilc_mobile_ui/plus/plus_screen.dart'; import 'package:refilc_plus/providers/plus_provider.dart'; import 'package:uuid/uuid.dart'; @@ -30,7 +29,7 @@ List getWidgets(List providerAds, BuildContext context) { ), onTap: () => Navigator.of(context, rootNavigator: true) .push(MaterialPageRoute(builder: (context) { - return const PlusScreen(); + return Container(); })), padding: const EdgeInsets.symmetric(horizontal: 5.0), showExternalIcon: false, diff --git a/refilc_mobile_ui/lib/plus/components/active_sponsor_card.dart b/refilc_mobile_ui/lib/plus/components/active_sponsor_card.dart deleted file mode 100644 index 466bd0ea..00000000 --- a/refilc_mobile_ui/lib/plus/components/active_sponsor_card.dart +++ /dev/null @@ -1,170 +0,0 @@ -import 'package:refilc/icons/filc_icons.dart'; -import 'package:refilc_mobile_ui/plus/plus_screen.dart'; -import 'package:refilc_plus/models/premium_scopes.dart'; -import 'package:refilc_plus/providers/plus_provider.dart'; -import 'package:refilc_plus/ui/mobile/plus/upsell.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:provider/provider.dart'; - -class ActiveSponsorCard extends StatelessWidget { - const ActiveSponsorCard({super.key}); - - static PremiumFeatureLevel? estimateLevel(List scopes) { - if (scopes.contains(PremiumScopes.all) || - scopes.contains(PremiumScopes.tierSponge)) { - return PremiumFeatureLevel.sponge; - } - if (scopes.contains(PremiumScopes.tierGold)) { - return PremiumFeatureLevel.ink; - } - if (scopes.contains(PremiumScopes.tierBasic)) { - return PremiumFeatureLevel.cap; - } - return PremiumFeatureLevel.old; - } - - IconData? _levelIcon(PremiumFeatureLevel level) { - switch (level) { - case PremiumFeatureLevel.cap: - return FilcIcons.kupak; - case PremiumFeatureLevel.ink: - return FilcIcons.tinta; - case PremiumFeatureLevel.sponge: - return FilcIcons.kupak; - case PremiumFeatureLevel.old: - return FilcIcons.kupak; - case PremiumFeatureLevel.basic: - return FilcIcons.kupak; - - case PremiumFeatureLevel.gold: - return FilcIcons.kupak; - } - } - - @override - Widget build(BuildContext context) { - final premium = Provider.of(context, listen: false); - final level = estimateLevel(premium.scopes); - - if (level == null) { - return const SizedBox(); - } - - Color? glow = Colors.white; - - switch (level) { - case PremiumFeatureLevel.cap: - glow = Colors.lightGreen; - break; - case PremiumFeatureLevel.ink: - glow = Colors.purple; - break; - case PremiumFeatureLevel.sponge: - glow = Colors.red; - break; - case PremiumFeatureLevel.old: - glow = Colors.red; - break; - case PremiumFeatureLevel.basic: - glow = Colors.red; - break; - case PremiumFeatureLevel.gold: - glow = Colors.red; - break; - } - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - boxShadow: [ - BoxShadow( - color: glow.withValues(alpha: .4), - blurRadius: 42.0, - ), - ], - ), - child: Card( - margin: EdgeInsets.zero, - elevation: 0, - color: const Color(0xff2B2B2B), - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)), - child: InkWell( - borderRadius: BorderRadius.circular(14.0), - splashColor: glow.withValues(alpha: .2), - onTap: () { - Navigator.of(context, rootNavigator: true) - .push(MaterialPageRoute(builder: (context) { - return const PlusScreen(); - })); - }, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 12.0), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Stack( - children: [ - CircleAvatar( - backgroundColor: - Theme.of(context).colorScheme.secondary, - backgroundImage: NetworkImage( - "https://github.com/${premium.login}.png?size=128"), - ), - Positioned.fill( - child: Align( - alignment: Alignment.bottomRight, - child: Transform.translate( - offset: const Offset(3.0, 4.0), - child: Container( - padding: const EdgeInsets.all(4.0), - decoration: const BoxDecoration( - color: Color(0xff2B2B2B), - shape: BoxShape.circle, - ), - child: const SizedBox( - height: 14.0, - width: 14.0, - ), - ), - ), - ), - ), - Positioned.fill( - child: Align( - alignment: Alignment.bottomRight, - child: SvgPicture.asset( - "assets/images/github.svg", - height: 14.0, - ), - ), - ), - ], - ), - ), - Expanded( - child: Text( - premium.login, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontWeight: FontWeight.w600, - fontSize: 20, - color: Colors.white), - ), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Icon( - _levelIcon(level), - color: Colors.white, - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/avatar_stack.dart b/refilc_mobile_ui/lib/plus/components/avatar_stack.dart deleted file mode 100644 index df330844..00000000 --- a/refilc_mobile_ui/lib/plus/components/avatar_stack.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/material.dart'; - -class AvatarStack extends StatelessWidget { - const AvatarStack({super.key, required this.children}); - - final List children; - - @override - Widget build(BuildContext context) { - return Stack( - children: [ - if (children.isNotEmpty) children[0], - if (children.length > 1) - Transform.translate( - offset: const Offset(-20.0, 0.0), - child: children[1], - ), - if (children.length > 2) - Transform.translate( - offset: const Offset(-40.0, 0.0), - child: children[2], - ), - ], - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/github_button.dart b/refilc_mobile_ui/lib/plus/components/github_button.dart deleted file mode 100644 index 283b5e2c..00000000 --- a/refilc_mobile_ui/lib/plus/components/github_button.dart +++ /dev/null @@ -1,175 +0,0 @@ -// import 'package:refilc/api/client.dart'; -// import 'package:refilc/theme/colors/colors.dart'; -import 'package:refilc_plus/providers/plus_provider.dart'; -// import 'package:refilc_plus/ui/mobile/plus/activation_view/activation_view.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_feather_icons/flutter_feather_icons.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:provider/provider.dart'; - -class GithubLoginButton extends StatelessWidget { - const GithubLoginButton({super.key}); - - @override - Widget build(BuildContext context) { - final premium = Provider.of(context); - - return Card( - margin: EdgeInsets.zero, - elevation: 0, - color: const Color(0xFFC1CBDF), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), - child: InkWell( - borderRadius: BorderRadius.circular(14.0), - onTap: () async { - // if (premium.hasPremium) { - // premium.auth.refreshAuth(removePremium: true); - // ScaffoldMessenger.of(context).showSnackBar(SnackBar( - // content: Text( - // "reFilc+ támogatás deaktiválva!", - // style: TextStyle( - // color: AppColors.of(context).text, - // fontWeight: FontWeight.bold, - // fontSize: 18.0), - // ), - // backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // )); - // return; - // } - - // Navigator.of(context).push(MaterialPageRoute(builder: (context) { - // return const PremiumActivationView(); - // })); - // bool initFinished = await initPaymentSheet(context); - // if (initFinished) { - // stripe.PaymentSheetPaymentOption? result = - // await stripe.Stripe.instance.presentPaymentSheet(); - - // print(result == null); - - // print(result?.label ?? 'nem label'); - // } - - // launchUrl( - // Uri.parse( - // 'https://api.refilc.hu/v3/payment/stripe-create-checkout?product=asdasd'), - // mode: LaunchMode.inAppBrowserView, - // ); - }, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Stack( - children: [ - SvgPicture.asset( - "assets/images/btn_github.svg", - height: 28.0, - ), - Positioned.fill( - child: Align( - alignment: Alignment.bottomRight, - child: Transform.translate( - offset: const Offset(3.5, 4.6), - child: Container( - padding: const EdgeInsets.all(4.0), - decoration: const BoxDecoration( - color: Color(0xFFC1CBDF), - // color: Colors.red, - shape: BoxShape.circle, - ), - child: const SizedBox( - height: 10.0, - width: 10.0, - ), - ), - ), - ), - ), - Positioned.fill( - child: Align( - alignment: Alignment.bottomRight, - child: Transform.translate( - offset: const Offset(2.0, 2.0), - child: Icon( - premium.hasPremium - ? FeatherIcons.minusCircle - : FeatherIcons.plusCircle, - color: const Color(0xFF243F76), - size: 14.0, - ), - ), - ), - ), - ], - ), - const SizedBox( - width: 18.0, - ), - Text( - premium.hasPremium - ? "Github szétkapcsolása" - : "Fiók összekötése Github-al", - style: const TextStyle( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Color(0xFF243F76), - ), - ), - const SizedBox( - width: 4.0, - ), - ], - ), - ), - ), - ); - } - - // Future initPaymentSheet(BuildContext context) async { - // try { - // // 1. create payment intent on the server - // final data = await _createPaymentSheet(); - - // if (data == null) { - // throw "API error, can't create payment sheet!"; - // } - - // // 2. initialize the payment sheet - // await stripe.Stripe.instance.initPaymentSheet( - // paymentSheetParameters: stripe.SetupPaymentSheetParameters( - // // Set to true for custom flow - // customFlow: false, - // // Main params - // merchantDisplayName: 'reFilc', - // paymentIntentClientSecret: data['paymentIntent'], - // // Customer keys - // customerEphemeralKeySecret: data['ephemeralKey'], - // customerId: data['customer'], - // // Extra options - // // applePay: const stripe.PaymentSheetApplePay( - // // merchantCountryCode: 'HU', - // // ), - // googlePay: const stripe.PaymentSheetGooglePay( - // merchantCountryCode: 'HU', - // testEnv: true, - // ), - // style: ThemeMode.system, - // ), - // ); - // return true; - // } catch (e) { - // // ignore: use_build_context_synchronously - // ScaffoldMessenger.of(context).showSnackBar( - // SnackBar(content: Text('Error: $e')), - // ); - // rethrow; - // } - // } - - // Future _createPaymentSheet() async { - // Map? data = await FilcAPI.createPaymentSheet("refilcplus"); - // return data; - // } -} diff --git a/refilc_mobile_ui/lib/plus/components/github_card.dart b/refilc_mobile_ui/lib/plus/components/github_card.dart deleted file mode 100644 index 4455f9a8..00000000 --- a/refilc_mobile_ui/lib/plus/components/github_card.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; - -class GithubCard extends StatelessWidget { - const GithubCard({super.key, this.onPressed}); - - final void Function()? onPressed; - - @override - Widget build(BuildContext context) { - return Card( - margin: EdgeInsets.zero, - elevation: 0, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)), - color: const Color(0xff2B2B2B), - child: Material( - type: MaterialType.transparency, - child: InkWell( - borderRadius: BorderRadius.circular(14.0), - onTap: onPressed, - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0) - .add(const EdgeInsets.only(top: 4.0)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - const Expanded( - child: Text( - "Támogass minket Githubon, hogy megszerezd a jutalmakat!", - style: TextStyle(color: Colors.white), - ), - ), - SvgPicture.asset("assets/images/github.svg"), - ], - ), - const SizedBox(height: 4.0), - Chip( - backgroundColor: Colors.black.withValues(alpha: .5), - label: const Text( - "Már támogatsz? Jelentkezz be!", - style: TextStyle(color: Colors.white), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/github_connect_button.dart b/refilc_mobile_ui/lib/plus/components/github_connect_button.dart deleted file mode 100644 index afd58add..00000000 --- a/refilc_mobile_ui/lib/plus/components/github_connect_button.dart +++ /dev/null @@ -1,107 +0,0 @@ -import 'package:refilc/theme/colors/colors.dart'; -import 'package:refilc_plus/providers/plus_provider.dart'; -// import 'package:refilc_plus/ui/mobile/plus/activation_view/activation_view.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_feather_icons/flutter_feather_icons.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:provider/provider.dart'; - -class GithubConnectButton extends StatelessWidget { - const GithubConnectButton({super.key}); - - @override - Widget build(BuildContext context) { - final premium = Provider.of(context); - - return Card( - margin: EdgeInsets.zero, - elevation: 0, - color: const Color(0xff2B2B2B), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)), - child: InkWell( - borderRadius: BorderRadius.circular(14.0), - onTap: () { - if (premium.hasPremium) { - premium.auth.refreshAuth(removePremium: true); - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text( - "Prémium deaktiválva.", - style: TextStyle( - color: AppColors.of(context).text, - fontWeight: FontWeight.bold, - fontSize: 18.0), - ), - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - )); - return; - } - - // Navigator.of(context).push(MaterialPageRoute(builder: (context) { - // // return const PremiumActivationView(); - // })); - }, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 12.0), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Stack( - children: [ - SvgPicture.asset( - "assets/images/github.svg", - height: 32.0, - ), - Positioned.fill( - child: Align( - alignment: Alignment.bottomRight, - child: Transform.translate( - offset: const Offset(3.0, 4.0), - child: Container( - padding: const EdgeInsets.all(4.0), - decoration: const BoxDecoration( - color: Color(0xff2B2B2B), - shape: BoxShape.circle, - ), - child: const SizedBox( - height: 14.0, - width: 14.0, - ), - ), - ), - ), - ), - Positioned.fill( - child: Align( - alignment: Alignment.bottomRight, - child: Transform.translate( - offset: const Offset(2.0, 2.0), - child: Icon( - premium.hasPremium - ? FeatherIcons.minusCircle - : FeatherIcons.plusCircle, - color: Colors.white, - size: 16.0, - ), - ), - ), - ), - ], - ), - ), - Text( - premium.hasPremium - ? "GitHub szétkapcsolása" - : "GitHub csatlakoztatása", - style: const TextStyle( - fontWeight: FontWeight.w600, - fontSize: 20, - color: Colors.white), - ), - ], - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/goal_card.dart b/refilc_mobile_ui/lib/plus/components/goal_card.dart deleted file mode 100644 index 4d11378d..00000000 --- a/refilc_mobile_ui/lib/plus/components/goal_card.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'dart:ui'; - -import 'package:flutter/material.dart'; - -class PremiumGoalCard extends StatelessWidget { - const PremiumGoalCard({super.key, this.progress = 100, this.target = 1}); - - final double progress; - final double target; - - @override - Widget build(BuildContext context) { - return Card( - margin: EdgeInsets.zero, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Cél: ${target.round()} támogató", - style: - const TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0), - ), - const SizedBox(height: 8.0), - Stack( - alignment: Alignment.center, - children: [ - Container( - height: 12, - decoration: BoxDecoration( - color: Colors.black.withValues(alpha: .2), - borderRadius: BorderRadius.circular(45.0), - ), - ), - LayoutBuilder( - builder: (context, size) { - return Align( - alignment: Alignment.centerLeft, - child: Row( - children: [ - Container( - height: 12, - width: size.maxWidth * (progress / 100), - decoration: BoxDecoration( - gradient: const LinearGradient(colors: [ - Color(0xFFFF2A9D), - Color(0xFFFF37F7) - ]), - borderRadius: BorderRadius.circular(45.0), - ), - ), - Transform.translate( - offset: const Offset(-15.0, 0), - child: Stack( - children: [ - ImageFiltered( - imageFilter: - ImageFilter.blur(sigmaX: 5, sigmaY: 5), - child: Image.asset("assets/images/heart.png", - color: - Colors.black.withValues(alpha: .3)), - ), - Image.asset("assets/images/heart.png"), - ], - ), - ), - ], - ), - ); - }, - ), - ], - ), - ], - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/plan_card.dart b/refilc_mobile_ui/lib/plus/components/plan_card.dart deleted file mode 100644 index c8ef04d8..00000000 --- a/refilc_mobile_ui/lib/plus/components/plan_card.dart +++ /dev/null @@ -1,348 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:refilc/models/settings.dart'; -import 'package:refilc_mobile_ui/common/action_button.dart'; -import 'package:refilc_plus/providers/plus_provider.dart'; -import 'package:refilc_plus/ui/mobile/plus/activation_view/activation_view.dart'; -import 'package:refilc_mobile_ui/plus/plus_screen.i18n.dart'; -import 'package:url_launcher/url_launcher.dart'; -import 'package:uuid/uuid.dart'; - -class PlusPlanCard extends StatelessWidget { - const PlusPlanCard({ - super.key, - required this.iconPath, - required this.title, - required this.description, - required this.color, - required this.gradient, - this.price = 0, - required this.id, - this.active = false, - this.borderRadius, - this.features = const [], - required this.docsAccepted, - }); - - final String iconPath; - final String title; - final String description; - final Color color; - final LinearGradient gradient; - final double price; - final String id; - final bool active; - final BorderRadiusGeometry? borderRadius; - final List> features; - final bool docsAccepted; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () { - // if (!docsAccepted) { - // ScaffoldMessenger.of(context).showSnackBar(const SnackBar( - // content: Text( - // "El kell fogadnod az ÁSZF-et és az Adatkezelési Tájékoztatót!", - // style: - // TextStyle(color: Colors.black, fontWeight: FontWeight.bold), - // ), - // backgroundColor: Colors.white, - // )); - - // return; - // } - - if (Provider.of(context, listen: false).xFilcId == - "none") { - Provider.of(context, listen: false) - .update(xFilcId: const Uuid().v4(), store: true); - } - - // if (Provider.of(context, listen: false).xFilcId == - // "none") { - // ScaffoldMessenger.of(context).showSnackBar(const SnackBar( - // content: Text( - // "Be kell kapcsolnod a Névtelen Analitikát a beállítások főoldalán, mielőtt reFilc+ előfizetést vásárolnál!", - // style: - // TextStyle(color: Colors.black, fontWeight: FontWeight.bold), - // ), - // backgroundColor: Colors.white, - // )); - - // return; - // } - - if (Provider.of(context, listen: false).hasPremium) { - if (!active) { - launchUrl( - Uri.parse( - 'https://billing.stripe.com/p/login/4gwbIRclL89D5PicMM'), - mode: LaunchMode.inAppBrowserView, - ); - } - - return; - } - - showDialog( - context: context, - builder: (context) => AlertDialog( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.0)), - title: Text('docs'.i18n), - content: Text('docs_acceptance'.i18n), - actions: [ - ActionButton( - label: "next".i18n, - onTap: () { - // pop dialog - Navigator.of(context).pop(); - // show payment option selector - showDialog( - context: context, - builder: (context) => AlertDialog( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.0)), - title: Text('payment_method'.i18n), - content: Text('select_payment_method'.i18n), - actions: [ - ActionButton( - label: "stripe".i18n, - onTap: () { - // pop dialog - Navigator.of(context).pop(); - // start payment process - Navigator.of(context) - .push(MaterialPageRoute(builder: (context) { - return PremiumActivationView( - product: id, - paymentProvider: "stripe", - ); - })); - }, - ), - ActionButton( - label: "paypal".i18n, - onTap: () { - // pop dialog - Navigator.of(context).pop(); - // start payment process - Navigator.of(context) - .push(MaterialPageRoute(builder: (context) { - return PremiumActivationView( - product: id, - paymentProvider: "paypal", - ); - })); - }, - ), - ], - ), - ); - }, - ), - ], - ), - ); - }, - child: Container( - decoration: BoxDecoration( - gradient: gradient, - borderRadius: borderRadius!.add(BorderRadius.circular(1.5)), - ), - padding: const EdgeInsets.all(1.5), - child: Card( - margin: EdgeInsets.zero, - shape: RoundedRectangleBorder( - borderRadius: borderRadius!, - ), - shadowColor: Colors.transparent, - surfaceTintColor: Colors.white, - color: Colors.white.withValues(alpha: 0.9), - child: Padding( - padding: const EdgeInsets.only( - top: 18.0, bottom: 16.0, left: 22.0, right: 18.0), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Image.asset( - iconPath, - width: iconPath.endsWith('ink.png') ? 29.0 : 25.0, - height: 25.0, - ), - const SizedBox( - width: 12.0, - ), - Text( - title, - style: const TextStyle( - fontSize: 22.0, - color: Color(0xFF0B0B0B), - fontWeight: FontWeight.w600, - height: 1.2, - ), - ), - ], - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - gradient: active - ? const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color.fromARGB(255, 196, 213, 253), - Color.fromARGB(255, 227, 235, 250), - Color.fromARGB(255, 214, 226, 250), - ], - ) - : const LinearGradient( - colors: [ - Color(0xFFEFF4FE), - Color(0xFFEFF4FE), - ], - ), - ), - padding: const EdgeInsets.all(2.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - color: const Color(0xFFEFF4FE), - ), - padding: const EdgeInsets.symmetric( - horizontal: 10.0, vertical: 2.0), - child: Text( - active - ? 'active'.i18n - : '${price.toStringAsFixed(2).replaceAll('.', ',')} €', - style: const TextStyle( - fontSize: 16.6, - color: Color(0xFF243F76), - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ], - ), - const SizedBox( - height: 12.0, - ), - Text( - description, - style: TextStyle( - color: const Color(0xFF011234).withValues(alpha: 0.6), - fontSize: 13.69, - fontWeight: FontWeight.w500, - ), - ), - const SizedBox( - height: 14.20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: features - .map((e) => Column( - children: [ - const SizedBox( - height: 10.0, - ), - Row( - children: [ - SizedBox( - width: 22.22, - child: Text( - e[0], - style: const TextStyle(fontSize: 18.0), - ), - ), - const SizedBox( - width: 14.0, - ), - Expanded( - child: e[1].endsWith('tier_benefits') - ? Text.rich( - style: const TextStyle( - height: 1.2, - fontWeight: FontWeight.w500, - color: Color(0xFF011234), - fontSize: 13.69, - ), - TextSpan( - children: [ - TextSpan( - text: 'every'.i18n, - ), - e[1].startsWith('cap') - ? const TextSpan( - text: 'reFilc+', - style: TextStyle( - color: - Color(0xFF7C3EFF), - fontWeight: - FontWeight.w600, - ), - ) - : TextSpan( - children: [ - const TextSpan( - text: 'reFilc+', - style: TextStyle( - color: Color( - 0xFF7C3EFF), - fontWeight: - FontWeight - .w600, - ), - ), - TextSpan( - text: 'and'.i18n, - ), - const TextSpan( - text: - 'reFilc+ Gold', - style: TextStyle( - color: Color( - 0xFF0061BB), - fontWeight: - FontWeight - .w600, - ), - ), - ], - ), - TextSpan(text: 'benefit'.i18n), - ], - ), - ) - : Text( - e[1], - maxLines: 2, - style: const TextStyle( - height: 1.2, - color: Color(0xFF011234), - fontWeight: FontWeight.w500, - fontSize: 13.69, - ), - ), - ), - ], - ), - ], - )) - .toList(), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/reward_card.dart b/refilc_mobile_ui/lib/plus/components/reward_card.dart deleted file mode 100644 index e9337d65..00000000 --- a/refilc_mobile_ui/lib/plus/components/reward_card.dart +++ /dev/null @@ -1,79 +0,0 @@ -import 'package:flutter/material.dart'; - -class PremiumRewardCard extends StatelessWidget { - const PremiumRewardCard( - {super.key, - this.imageKey, - this.icon, - this.title, - this.description, - this.soon = false}); - - final String? imageKey; - final Widget? icon; - final Widget? title; - final Widget? description; - final bool soon; - - @override - Widget build(BuildContext context) { - return Card( - margin: EdgeInsets.zero, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (soon) - const Padding( - padding: EdgeInsets.only(left: 8.0), - child: Chip( - labelPadding: EdgeInsets.zero, - padding: EdgeInsets.symmetric(horizontal: 12.0), - backgroundColor: Color(0x777645D3), - label: Text("Hamarosan", - style: TextStyle(fontWeight: FontWeight.w500)), - ), - ), - if (imageKey != null) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 14.0) - .add(EdgeInsets.only(bottom: 12.0, top: soon ? 0 : 14.0)), - child: Image.asset("assets/images/${imageKey!}.png"), - ) - else - const SizedBox(height: 12), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), - child: Row( - children: [ - if (icon != null) ...[icon!, const SizedBox(width: 12.0)], - if (title != null) - Expanded( - child: DefaultTextStyle( - style: Theme.of(context) - .textTheme - .bodyMedium! - .copyWith(fontWeight: FontWeight.w700, fontSize: 20), - child: title!, - ), - ), - ], - ), - ), - if (description != null) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0) - .add(const EdgeInsets.only(top: 4.0, bottom: 12.0)), - child: DefaultTextStyle( - style: Theme.of(context) - .textTheme - .bodyMedium! - .copyWith(fontSize: 16), - child: description!, - ), - ), - ], - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/supporter_chip.dart b/refilc_mobile_ui/lib/plus/components/supporter_chip.dart deleted file mode 100644 index e3dcf037..00000000 --- a/refilc_mobile_ui/lib/plus/components/supporter_chip.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:refilc/models/supporter.dart'; -import 'package:flutter/material.dart'; - -class SupporterChip extends StatelessWidget { - const SupporterChip({super.key, required this.supporter}); - - final Supporter supporter; - - @override - Widget build(BuildContext context) { - return Chip( - side: BorderSide.none, - shape: const StadiumBorder(side: BorderSide.none), - padding: const EdgeInsets.all(8.0), - avatar: supporter.avatar != "" - ? CircleAvatar( - backgroundColor: Theme.of(context).colorScheme.secondary, - backgroundImage: NetworkImage(supporter.avatar), - ) - : null, - labelPadding: const EdgeInsets.only(left: 12.0, right: 8.0), - label: Text.rich( - TextSpan(children: [ - TextSpan(text: supporter.name), - if (supporter.type == DonationType.once) - TextSpan( - text: " \$${supporter.price}", - style: const TextStyle(fontWeight: FontWeight.w400), - ), - ]), - style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/supporter_group_card.dart b/refilc_mobile_ui/lib/plus/components/supporter_group_card.dart deleted file mode 100644 index f0086af7..00000000 --- a/refilc_mobile_ui/lib/plus/components/supporter_group_card.dart +++ /dev/null @@ -1,79 +0,0 @@ -import 'package:refilc/models/supporter.dart'; -import 'package:refilc_mobile_ui/plus/components/supporter_chip.dart'; -import 'package:refilc_mobile_ui/plus/components/supporter_tile.dart'; -import 'package:flutter/material.dart'; - -class SupporterGroupCard extends StatelessWidget { - const SupporterGroupCard({ - super.key, - this.title, - this.icon, - this.expanded = false, - this.supporters = const [], - this.glow, - }); - - final Widget? icon; - final Widget? title; - final bool expanded; - final List supporters; - final Color? glow; - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - boxShadow: [ - if (glow != null) - BoxShadow( - color: glow!.withValues(alpha: .2), - blurRadius: 60.0, - ), - ], - ), - child: Card( - margin: EdgeInsets.zero, - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), - child: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - if (icon != null) ...[icon!, const SizedBox(width: 12.0)], - if (title != null) - Expanded( - child: DefaultTextStyle( - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(fontWeight: FontWeight.w700), - child: title!, - ), - ), - ], - ), - const SizedBox(height: 12.0), - if (expanded) - Column( - children: supporters - .map((e) => SupporterTile(supporter: e)) - .toList(), - ) - else - Wrap( - spacing: 8.0, - children: supporters - .map((e) => SupporterChip(supporter: e)) - .toList(), - ), - ], - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/supporter_tile.dart b/refilc_mobile_ui/lib/plus/components/supporter_tile.dart deleted file mode 100644 index ccbcf3d0..00000000 --- a/refilc_mobile_ui/lib/plus/components/supporter_tile.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:refilc/models/supporter.dart'; -import 'package:flutter/material.dart'; - -class SupporterTile extends StatelessWidget { - const SupporterTile({super.key, required this.supporter}); - - final Supporter supporter; - - @override - Widget build(BuildContext context) { - return ListTile( - contentPadding: EdgeInsets.zero, - leading: CircleAvatar( - backgroundImage: NetworkImage(supporter.avatar), - ), - title: Text( - supporter.name, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - subtitle: Text(supporter.comment), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/components/supporters_button.dart b/refilc_mobile_ui/lib/plus/components/supporters_button.dart deleted file mode 100644 index db2d18dd..00000000 --- a/refilc_mobile_ui/lib/plus/components/supporters_button.dart +++ /dev/null @@ -1,82 +0,0 @@ -import 'dart:math'; - -import 'package:refilc/models/supporter.dart'; -import 'package:refilc_mobile_ui/plus/components/avatar_stack.dart'; -import 'package:refilc_mobile_ui/plus/supporters_screen.dart'; -import 'package:flutter/material.dart'; - -class SupportersButton extends StatelessWidget { - const SupportersButton({super.key, required this.supporters}); - - final Future supporters; - - @override - Widget build(BuildContext context) { - return Card( - shape: const StadiumBorder(), - margin: EdgeInsets.zero, - child: InkWell( - customBorder: const StadiumBorder(), - onTap: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => SupportersScreen(supporters: supporters)), - ); - }, - child: Container( - padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 14.0), - child: Row( - children: [ - const Expanded( - child: Text( - "Köszönjük, támogatók!", - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17.0), - ), - ), - FutureBuilder( - future: supporters, - builder: (context, snapshot) { - if (!snapshot.hasData) { - return const SizedBox(); - } - final sponsors = snapshot.data!.github - .where((e) => e.type == DonationType.monthly) - .toList(); - sponsors.shuffle(Random( - (DateTime.now().millisecondsSinceEpoch / - 1000 / - 60 / - 60 / - 24) - .floor())); - return AvatarStack( - children: [ - // ignore: prefer_is_empty - if (sponsors.length > 0 && sponsors[0].avatar != "") - CircleAvatar( - backgroundColor: - Theme.of(context).colorScheme.secondary, - backgroundImage: NetworkImage(sponsors[0].avatar), - ), - if (sponsors.length > 1 && sponsors[1].avatar != "") - CircleAvatar( - backgroundColor: - Theme.of(context).colorScheme.secondary, - backgroundImage: NetworkImage(sponsors[1].avatar), - ), - if (sponsors.length > 2 && sponsors[2].avatar != "") - CircleAvatar( - backgroundColor: - Theme.of(context).colorScheme.secondary, - backgroundImage: NetworkImage(sponsors[2].avatar), - ), - ], - ); - }), - ], - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/plus_screen.dart b/refilc_mobile_ui/lib/plus/plus_screen.dart deleted file mode 100644 index 6201d4fe..00000000 --- a/refilc_mobile_ui/lib/plus/plus_screen.dart +++ /dev/null @@ -1,845 +0,0 @@ -// ignore_for_file: use_build_context_synchronously - -import 'package:flutter/services.dart'; -import 'package:refilc_mobile_ui/plus/plus_screen.i18n.dart'; -import 'package:refilc_mobile_ui/plus/components/plan_card.dart'; -import 'package:flutter_feather_icons/flutter_feather_icons.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:refilc_plus/providers/plus_provider.dart'; -import 'package:refilc_plus/ui/mobile/plus/upsell.dart'; - -import 'components/active_sponsor_card.dart'; -// import 'components/github_button.dart'; - -class PlusScreen extends StatefulWidget { - const PlusScreen({super.key}); - - @override - State createState() => PlusScreenState(); -} - -class PlusScreenState extends State { - Uri parseTierUri({required String tierId}) { - return Uri.parse( - 'https://github.com/sponsors/refilc/sponsorships?tier_id=$tierId&preview=true'); - } - - bool showLifetime = false; - bool docsAccepted = false; - - @override - Widget build(BuildContext context) { - LinearGradient plusGradient = const LinearGradient( - colors: [ - Color(0xFF7087FF), - Color(0xFF9069FF), - Color(0xFFE4D7FF), - Color(0xFFDBC5FF), - Color(0xFFE57DFF), - Color(0xFFDBB7FF), - Color(0xFF6850FF), - Color(0xFF2144FF), - ], - stops: [0.0, 0.16, 0.32, 0.49, 0.69, 0.8, 0.92, 1.0], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ); - LinearGradient goldGradient = const LinearGradient( - colors: [ - Color(0xFFFFBD70), - Color(0xFFFFDE69), - Color(0xFFFFECD7), - Color(0xFFFFE4C5), - Color(0xFFFFDB7D), - Color(0xFFFFDEB7), - Color(0xFFFFAE50), - Color(0xFFFF9921), - ], - stops: [0.0, 0.16, 0.32, 0.49, 0.69, 0.8, 0.92, 1.0], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ); - - return Scaffold( - backgroundColor: const Color(0xffF4F9FF), - body: Container( - padding: EdgeInsets.zero, - width: double.infinity, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/images/premium_top_banner.png'), - fit: BoxFit.fitWidth, - alignment: Alignment.topCenter, - ), - ), - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - const Color(0xffF4F9FF).withValues(alpha: 0.30), - const Color(0xffF4F9FF).withValues(alpha: 0.40), - const Color(0xffF4F9FF).withValues(alpha: 0.50), - const Color(0xffF4F9FF).withValues(alpha: 0.60), - const Color(0xffF4F9FF).withValues(alpha: 0.70), - ], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - stops: const [0.0, 0.1, 0.15, 0.2, 0.25], - ), - ), - child: ListView( - children: [ - Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - const Color(0xffF4F9FF).withValues(alpha: 0.0), - const Color(0xffF4F9FF).withValues(alpha: 0.7), - const Color(0xffF4F9FF).withValues(alpha: 0.8), - const Color(0xffF4F9FF).withValues(alpha: 0.9), - const Color(0xffF4F9FF), - ], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - stops: const [0.0, 0.1, 0.15, 0.18, 0.22], - ), - ), - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 20.0, vertical: 15.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // heading (title, x button) - Padding( - padding: const EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - 'reFilc+', - style: TextStyle( - fontSize: 33, - color: Color(0xFF0a1c41), - fontWeight: FontWeight.bold, - ), - ), - IconButton( - onPressed: () => Navigator.of(context).pop(), - icon: const Icon( - FeatherIcons.x, - color: Colors.black, - ), - ) - ], - ), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), - child: Text.rich( - TextSpan( - text: 'even_more_cheaper'.i18n, - style: const TextStyle( - height: 1.2, - fontSize: 22, - color: Color(0xFF0A1C41), - fontWeight: FontWeight.w600, - ), - children: [ - WidgetSpan( - child: Transform.translate( - offset: const Offset(1.0, -5.5), - child: Text( - '1', - style: TextStyle( - fontSize: 14.4, - color: const Color(0xFF0A1C41) - .withValues(alpha: 0.5), - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ], - ), - ), - ), - // cards and description - const SizedBox( - height: 60, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), - child: Text.rich( - TextSpan( - children: [ - TextSpan(text: 'support_1'.i18n), - WidgetSpan( - child: Transform.translate( - offset: const Offset(1.0, -3.6), - child: Text( - '2', - style: TextStyle( - color: const Color(0xFF011234) - .withValues(alpha: 0.5), - fontSize: 10.0, - fontWeight: FontWeight.w500, - ), - ), - ), - ), - TextSpan( - text: 'support_2'.i18n, - ), - ], - style: TextStyle( - color: const Color(0xFF011234) - .withValues(alpha: 0.6), - fontWeight: FontWeight.w500, - ), - ), - ), - ), - const SizedBox( - height: 18, - ), - PlusPlanCard( - active: ActiveSponsorCard.estimateLevel( - context.watch().scopes) == - PremiumFeatureLevel.cap, - iconPath: 'assets/images/plus_tier_cap.png', - title: 'reFilc+', - description: 'tier_rfp'.i18n, - color: const Color(0xFF7C3EFF), - gradient: plusGradient, - id: showLifetime ? 'refilcpluslifetime' : 'refilcplus', - price: showLifetime ? 29.99 : 0.99, - borderRadius: const BorderRadius.vertical( - top: Radius.circular(16.0), - bottom: Radius.circular(16.0)), - features: [ - ['✨', 'rfp_1'.i18n], - ['1️⃣', 'rfp_5'.i18n], - // ['👥', 'rfp_2'.i18n], - ['👋', 'rfp_3'.i18n], - ['📓', 'rfp_4'.i18n], - // ['🎓', 'rfp_6'.i18n], - ['📩', 'rfp_17'.i18n], - ['🪟', 'rfp_18'.i18n], - ['👕', 'rfp_14'.i18n], - ['👑', 'rfp_15'.i18n], - ['🔜', 'more_soon'.i18n], - ], - docsAccepted: docsAccepted, - ), - const SizedBox( - height: 12.0, - ), - PlusPlanCard( - active: ActiveSponsorCard.estimateLevel( - context.watch().scopes) == - PremiumFeatureLevel.ink, - iconPath: 'assets/images/plus_tier_ink.png', - title: 'reFilc+ Gold', - description: 'tier_rfpgold'.i18n, - color: const Color(0xFFFFBD3E), - gradient: goldGradient, - id: showLifetime - ? 'refilcplusgoldlifetime' - : 'refilcplusgold', - price: showLifetime ? 49.99 : 2.99, - borderRadius: const BorderRadius.vertical( - top: Radius.circular(16.0), - bottom: Radius.circular(16.0)), - features: [ - ['🕑', 'rfp_7'.i18n], - ['🔤', 'rfp_8'.i18n], - // ['👥', 'rfp_9'.i18n], - // ['🎓', 'Összesített átlagszámoló'], - ['📱', 'rfp_10'.i18n], - ['🟦', 'rfp_11'.i18n], - ['📒', 'rfp_12'.i18n], - ['📅', 'rfp_13'.i18n], - ['👀', 'rfp_16'.i18n], - const ['🖋️', 'cap_tier_benefits'], - ['🔜', 'more_soon'.i18n], - ], - docsAccepted: docsAccepted, - ), - // const SizedBox( - // height: 8.0, - // ), - // PlusPlanCard( - // active: ActiveSponsorCard.estimateLevel( - // context.watch().scopes) == - // PremiumFeatureLevel.sponge, - // iconPath: 'assets/images/plus_tier_sponge.png', - // title: 'Szivacs', - // description: - // 'Férj hozzá még több funkcióhoz, használj még több profilt és tedd egyszerűbbé mindennapjaid.', - // color: const Color(0xFFFFC700), - // id: 'refilcplusgold', - // price: 4.99, - // borderRadius: const BorderRadius.vertical( - // top: Radius.circular(8.0), - // bottom: Radius.circular(16.0)), - // features: const [ - // ['👥', 'Korlátlan fiók használata egyszerre'], - // ['🖋️', 'ink_cap_tier_benefits'], - // ], - // ), - // const SizedBox( - // height: 18.0, - // ), - // const GithubLoginButton(), - // lifetime plan toggle - const SizedBox( - height: 18.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - border: Border.all( - color: Colors.black.withValues(alpha: 0.2), - ), - ), - child: SwitchListTile( - contentPadding: - const EdgeInsets.only(left: 15.0, right: 10.0), - value: showLifetime, - onChanged: (value) { - setState(() { - showLifetime = !showLifetime; - }); - }, - title: Text( - 'show_lifetime'.i18n, - style: const TextStyle( - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ), - ), - ), - // reactivate plus - const SizedBox( - height: 18.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - border: Border.all( - color: Colors.black.withValues(alpha: 0.2), - ), - ), - child: ListTile( - contentPadding: - const EdgeInsets.only(left: 15.0, right: 10.0), - onTap: () async { - // try clipboard re-activation - final data = await Clipboard.getData("text/plain"); - if (data != null && - data.text != null && - data.text != "") { - // activate using clipboard data - final result = await context - .read() - .auth - .finishAuth(data.text!); - - if (!result && mounted) { - ScaffoldMessenger.of(context) - .showSnackBar(const SnackBar( - content: Text( - "Sikertelen aktiválás. Kérlek próbáld újra később!", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - ), - backgroundColor: Colors.red, - )); - } else { - ScaffoldMessenger.of(context) - .showSnackBar(const SnackBar( - content: Text( - "Sikeres aktiválás!", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - ), - backgroundColor: Colors.green, - )); - - Future.delayed(const Duration(seconds: 2), - () => Navigator.of(context).pop()); - } - } - - // try re-activation using refresh - final result = await context - .read() - .auth - .refreshAuth(reactivate: true); - - if (mounted) { - if (result) { - ScaffoldMessenger.of(context) - .showSnackBar(const SnackBar( - content: Text( - "Sikeres aktiválás!", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - ), - backgroundColor: Colors.green, - )); - - Future.delayed(const Duration(seconds: 2), - () => Navigator.of(context).pop()); - } else { - ScaffoldMessenger.of(context) - .showSnackBar(const SnackBar( - content: Text( - "Sikertelen aktiválás. Kérlek próbáld újra később!", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - ), - backgroundColor: Colors.red, - )); - } - } - }, - title: Text( - 'reactivate'.i18n, - style: const TextStyle( - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ), - ), - ), - // aszf warning - // const SizedBox( - // height: 18.0, - // ), - // Container( - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(16.0), - // border: Border.all( - // color: Colors.black.withValues(alpha: 0.2), - // ), - // ), - // child: CheckboxListTile( - // side: - // const BorderSide(color: Colors.black, width: 2.0), - // contentPadding: - // const EdgeInsets.only(left: 15.0, right: 10.0), - // value: docsAccepted, - // onChanged: (value) { - // setState(() { - // docsAccepted = !docsAccepted; - // }); - // }, - // // title: Text( - // // 'show_lifetime'.i18n, - // // style: const TextStyle( - // // color: Colors.black, - // // fontWeight: FontWeight.w500, - // // ), - // // ), - // subtitle: const Text( - // 'Elfogadod a reFilc előfizetésekkel kapcsolatos Általános Szerződési Feltételeit (elérhető az alábbi link-en: filc.one/pay-terms), valamint Adatkezelési Tájékoztatónkat (elérhető az alábbi link-en: filc.one/pay-privacy)?', - // textAlign: TextAlign.start, - // style: TextStyle(color: Colors.black), - // ), - // ), - // ), - // CheckboxListTile(value: false, onChanged: onChanged) - // Padding( - // padding: const EdgeInsets.symmetric(horizontal: 12.0), - // child: Text( - // 'A szolgáltatási csomag kiválasztásával (megérintés) elfogadod a reFilc előfizetésekkel kapcsolatos Általános Szerződési Feltételeit (elérhető az alábbi link-en: filc.one/pay-terms), valamint Adatkezelési Tájékoztatónkat (elérhető az alábbi link-en: filc.one/pay-privacy).', - // textAlign: TextAlign.justify, - // style: - // TextStyle(color: Colors.black.withValues(alpha: 0.9)), - // ), - // ), - // faq section - const SizedBox( - height: 30.0, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), - child: Text( - 'faq'.i18n, - style: TextStyle( - color: - const Color(0xFF011234).withValues(alpha: 0.6), - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - height: 18, - ), - Card( - margin: EdgeInsets.zero, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16.0), - bottom: Radius.circular(8.0), - ), - ), - shadowColor: Colors.transparent, - surfaceTintColor: const Color(0xffFFFFFF), - color: Colors.white, - child: Padding( - padding: const EdgeInsets.only( - top: 18.0, - bottom: 16.0, - left: 22.0, - right: 18.0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'money'.i18n, - style: const TextStyle( - fontSize: 16.6, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - const SizedBox( - height: 14.0, - ), - Text.rich( - TextSpan( - style: TextStyle( - color: const Color(0xFF011234) - .withValues(alpha: 0.6), - fontWeight: FontWeight.w500, - ), - children: [ - TextSpan( - text: 'm_1'.i18n, - ), - WidgetSpan( - child: Transform.translate( - offset: const Offset(1.0, -3.6), - child: Text( - '3', - style: TextStyle( - color: const Color(0xFF011234) - .withValues(alpha: 0.5), - fontSize: 10.0, - fontWeight: FontWeight.w500, - ), - ), - ), - ), - TextSpan( - text: 'm_2'.i18n, - ), - ], - ), - ), - ], - ), - ), - ), - const SizedBox( - height: 8.0, - ), - Card( - margin: EdgeInsets.zero, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(8.0), - bottom: Radius.circular(16.0), - ), - ), - shadowColor: Colors.transparent, - surfaceTintColor: const Color(0xffFFFFFF), - color: Colors.white, - child: Padding( - padding: const EdgeInsets.only( - top: 18.0, - bottom: 16.0, - left: 22.0, - right: 18.0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'open'.i18n, - style: const TextStyle( - fontSize: 16.6, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - const SizedBox( - height: 14.0, - ), - Text( - 'o_1'.i18n, - style: TextStyle( - color: const Color(0xFF011234) - .withValues(alpha: 0.6), - fontWeight: FontWeight.w500, - ), - ), - ], - ), - ), - ), - const SizedBox( - height: 30.0, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), - child: Text( - 'desc'.i18n, - style: TextStyle( - color: - const Color(0xFF011234).withValues(alpha: 0.6), - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - height: 18, - ), - Card( - margin: EdgeInsets.zero, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(8.0), - bottom: Radius.circular(16.0), - ), - ), - shadowColor: Colors.transparent, - surfaceTintColor: const Color(0xffFFFFFF), - color: Colors.white, - child: Padding( - padding: const EdgeInsets.only( - top: 18.0, - bottom: 16.0, - left: 22.0, - right: 18.0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - decoration: BoxDecoration( - color: const Color(0xff011234), - borderRadius: BorderRadius.circular(20.0), - ), - padding: const EdgeInsets.symmetric( - horizontal: 10.0, - vertical: 2.5, - ), - child: const Text( - '1', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - width: 14.0, - ), - Expanded( - child: Text( - 'cheaper'.i18n, - maxLines: 5, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.4, - height: 1.3, - color: Colors.black, - ), - ), - ), - ], - ), - const SizedBox( - height: 14.0, - ), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: const Color(0xff011234), - borderRadius: BorderRadius.circular(20.0), - ), - padding: const EdgeInsets.symmetric( - horizontal: 8.8, - vertical: 2.5, - ), - child: const Text( - '2', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - width: 14.0, - ), - Expanded( - child: Text( - 'qwit'.i18n, - maxLines: 5, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.4, - height: 1.3, - color: Colors.black, - ), - ), - ), - ], - ), - const SizedBox( - height: 14.0, - ), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: const Color(0xff011234), - borderRadius: BorderRadius.circular(20.0), - ), - padding: const EdgeInsets.symmetric( - horizontal: 8.6, - vertical: 2.5, - ), - child: const Text( - '3', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - width: 14.0, - ), - Expanded( - child: Text( - 'apple'.i18n, - maxLines: 5, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.4, - height: 1.3, - color: Colors.black, - ), - ), - ), - ], - ), - const SizedBox( - height: 14.0, - ), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: const Color(0xff011234), - borderRadius: BorderRadius.circular(20.0), - ), - padding: const EdgeInsets.symmetric( - horizontal: 7.9, - vertical: 2.5, - ), - child: const Text( - '4', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - width: 14.0, - ), - Expanded( - child: Text( - 'eur'.i18n, - maxLines: 5, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.4, - height: 1.3, - color: Colors.black, - ), - ), - ), - ], - ), - const SizedBox( - height: 14.0, - ), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: const Color(0xff011234), - borderRadius: BorderRadius.circular(20.0), - ), - padding: const EdgeInsets.symmetric( - horizontal: 7.9, - vertical: 2.5, - ), - child: const Text( - '5', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ), - const SizedBox( - width: 14.0, - ), - Expanded( - child: Text( - 'faq_dc'.i18n, - maxLines: 5, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 14.4, - height: 1.3, - color: Colors.black, - ), - ), - ), - ], - ), - ], - ), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart b/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart deleted file mode 100644 index ac0db019..00000000 --- a/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart +++ /dev/null @@ -1,206 +0,0 @@ -import 'package:i18n_extension/i18n_extension.dart'; - -extension SettingsLocalization on String { - static final _t = Translations.byLocale("hu_hu") + - { - "en_en": { - "even_more_cheaper": "More reFilc, cheaper\nthan anything else!", - "support_1": "Support QwIT", - "support_2": " and get useful features in return!", - "tier_rfp": "More customisation, more accounts, easier notes.", - "tier_rfpgold": - "Get access to more features and make your day better and simpler.", - "faq": "FAQ", - "money": "What will you spend my money on?", - "m_1": - "We will spend the money from our supporters on the \$100 fee of the Apple", - "m_2": - " Developer Program, our servers, and the reFilc domains. The remaining money will be spent on other development stuff, and pizza parties.", - "open": "Will reFilc stay open-source?", - "o_1": - "Yes, reFilc is, and always will be, open-source. Subscribers can ask for the source code of reFilc+ on our Discord server.", - "desc": "Explanations", - "cheaper": - "The lowest tier of service is cheaper than most known subscriptions, but there may be exceptions.", - "qwit": - "\"QwIT\" is an abbreviation of \"QwIT Development\", the development team behind reFilc and other projects.", - "apple": "\"Apple\" is a trademark of Apple Inc.", - "eur": - "Prices are displayed in euros, which means it's dependant on the exchange rate. 1 EUR ≈ 390 HUF", - "active": "Active", - // benefits - "rfp_1": "Early access to updates", - "rfp_2": "Use two accounts simaltaneously", - "rfp_3": "Custom welcome message", - "rfp_4": "Unlimited custom notes and tasks on the Notebook page", - "rfp_5": "Custom grade rarities", - "rfp_6": "Overall average calculator", - "rfp_7": "Timetable notes", - "rfp_8": "Custom font types", - "rfp_9": "Unlimited accounts", - "rfp_10": "Custom app icon (from v5.1)", - "rfp_11": "Change Live Activity color", - "rfp_12": "Better goal planner", - "rfp_13": "Import your timetable into your calendar app", - "rfp_14": "Discount in reFilc Shop (soon)", - "rfp_15": "Subscriber role in our Discord community", - "rfp_16": "Private leaks and informations about upcoming features", - "rfp_17": "Grade exporting", - "rfp_18": "Viewing exported grades", - // docs and payment method popup - "docs": "Documents", - "docs_acceptance": - "By pressing the \"Next\" button, you accept reFilc's Terms and Conditions for subscriptions (available at the following link: filc.one/pay-terms) and our Privacy Policy (available at the following link: filc.one/pay-privacy).", - "next": "Next", - "payment_method": "Payment Method", - "select_payment_method": - "Please select a preferred payment method! Credit card payments are handled by Stripe, which also supports Apple Pay, Google Pay and Revolut Pay.", - "stripe": "Credit Card", - "paypal": "PayPal", - // other - "and": " and ", - "every": "Every ", - "benefit": " benefit", - "show_lifetime": "Show Lifetime Plans", - "more_soon": "More coming soon...", - "faq_dc": - "To redeem your Discord-related benefits, contact us on Discord in DMs!", - "reactivate": "Reactivate Existing Subscription", - }, - "hu_hu": { - "even_more_cheaper": "Még több reFilc, olcsóbban,\nmint bármi más!", - "support_1": "Támogasd a QwIT", - "support_2": " csapatát, és szerezz cserébe pár kényelmes jutalmat!", - "tier_rfp": - "Több személyre szabás, több fiók, egyszerű feladatfeljegyzés.", - "tier_rfpgold": - "Férj hozzá még több funkcióhoz és tedd egyszerűbbé mindennapjaid.", - "faq": "Gyakori kérdések", - "money": "Mire költitek a pénzt?", - "m_1": "A támogatásokból kapott pénz elsősorban az Apple", - "m_2": - " Developer Program évi \$100-os díját, valamint az API mögött álló szerverek és a reFilc domain címek árát fedezi, a maradékot egyéb fejlesztésekre, fejlesztői fagyizásra fordítjuk.", - "open": "Még mindig nyílt a forráskód?", - "o_1": - "Igen, a reFilc teljesen nyílt forráskódú, és ez így is fog maradni. A reFilc+ funkcióinak forráskódjához bármely támogatónk hozzáférhet, ha ezt Discord-on kérelmezi.", - "desc": "Magyarázatok", - "cheaper": - "A szolgáltatás legalacsonyabb szintje olcsóbb a legtöbb ismert előfizetésnél, viszont előfordulhatnak kivételek.", - "qwit": - "A \"QwIT\" a \"QwIT Development\" rövid neve, ez a fejlesztői csapat neve, mely a reFilc és egyéb projektek mögött áll.", - "apple": "Az \"Apple\" az Apple Inc. védjegye.", - "eur": - "Az árak euróban vannak feltüntetve, így az árfolyam befolyásolja, hogy mennyit kell fizetned a szolgáltatásért. 1 EUR ≈ 390 Ft", - "active": "Aktív", - // benefits - "rfp_1": "Előzetes hozzáférés új verziókhoz", - "rfp_2": "2 fiók használata egyszerre", - "rfp_3": "Egyedi üdvözlő üzenet", - "rfp_4": "Korlátlan saját jegyzet és feladat a füzet oldalon", - "rfp_5": "Egyedi jegy ritkaságok", - "rfp_6": "Összesített átlagszámoló", - "rfp_7": "Órarend jegyzetek", - "rfp_8": "Egyedi betütípusok", - "rfp_9": "Korlátlan fiók használata egyszerre", - "rfp_10": "Alkalmazás ikonjának megváltoztatása (v5.1-től)", - "rfp_11": "Live Activity szín", - "rfp_12": "Fejlettebb cél kitűzés", - "rfp_13": "Naptár szinkronizálás", - "rfp_14": "Kedvezmény a reFilc Shop-ban (hamarosan)", - "rfp_15": "Előfizetői rang a Discord szerverünkön", - "rfp_16": "Privát betekintések és információk közelgő újításokról", - "rfp_17": "Jegy exportálás", - "rfp_18": "Exportált jegyek megtekintése", - // docs and payment method popup - "docs": "Dokumentumok", - "docs_acceptance": - "A \"Tovább\" gombra kattintva elfogadod a reFilc előfizetésekkel kapcsolatos Általános Szerződési Feltételeit (elérhető az alábbi link-en: filc.one/pay-terms), valamint Adatkezelési Tájékoztatónkat (elérhető az alábbi link-en: filc.one/pay-privacy).", - "next": "Tovább", - "payment_method": "Fizetési mód", - "select_payment_method": - "Kérlek válassz egy fizetési módot! A bankkártyás fizetést a Stripe biztosítja, mely támogat Apple Pay-t, Google Pay-t és Revolut Pay-t is.", - "stripe": "Bankkártya", - "paypal": "PayPal", - // other - "and": " és ", - "every": "Minden ", - "benefit": " előny", - "show_lifetime": "Örökre szóló csomagok", - "more_soon": "Hamarosan mégtöbb finomság...", - "faq_dc": - "A Discord-al kapcsolatos előnyök beváltásához írj nekünk Discord-on privát üzenetet!", - "reactivate": "Meglévő előfizetés újraaktiválása", - }, - "de_de": { - "even_more_cheaper": "Mehr reFilc, günstiger\nals alles andere!", - "support_1": "Unterstütze QwIT", - "support_2": " und du kriegst mehr nützliche Features!", - "tier_rfp": - "Mehr Personalisierung, mehr Profile, einfachere Notizen.", - "tier_rfpgold": - "Hol dir mehr Features und mach damit dein Alltag einfacher.", - "faq": "Häufig gestellte Fragen (FAQ)", - "money": "Was tun wir mit deinem Geld?", - "m_1": - "Wir verwenden das gesammelte Geld von unseren Sponsoren ausschließlich auf die \$100 Gebühr von dem Apple", - "m_2": - " Developer Program, unsere Server und die reFilc Domänen. Das restliche Geld wird auf andere Entwicklungsbezogene Dinge und auch Pizza Parties bezweckt.", - "open": "Wird reFilc Open-Source bleiben?", - "o_1": - "Ja, reFilc ist und bleibt weiterhin ein Open-Source Projekt. Abonnenten des reFilc+ Abos können auch natürlich den Quellcode dieser Version in unserem Discord Server finden.", - "desc": "Erklärung/Aufklärung", - "cheaper": - "Das günstigste Abonnement ist das beliebteste, es gibt natürlich aber auch ausnahmen.", - "qwit": - "\"QwIT\" ist ein Teil of \"QwIT Development\", die Entwickler hinter des Programms reFilc.", - "apple": "\"Apple\" ist eine geschützte Marke von Apple Inc.", - "eur": - "Der Preis wird in Euro angegeben im Bezug zum aktuellen Wechselkurs. 1 EUR ≈ 390 HUF", - "active": "Aktiv", - // benefits - "rfp_1": "Frühzeitiger Zugriff auf Updates", - "rfp_2": "Verwendung von zwei Konten gleichzeitig", - "rfp_3": "Individuelle Begrüßungsnachricht", - "rfp_4": - "Unbegrenzte eigene Notizen und Aufgaben auf der Notizbuchseite", - "rfp_5": "Individuelle Notenraritäten", - "rfp_6": "Gesamtdurchschnittsberechner", - "rfp_7": "Stundenplan-Notizen", - "rfp_8": "Individuelle Schriftarten", - "rfp_9": "Unbegrenzte Konten", - "rfp_10": "Anpassung des App-Symbols (ab v5.1)", - "rfp_11": "Änderung der Live-Aktivitätsfarbe", - "rfp_12": "Verbesserter Zielplaner", - "rfp_13": "Importieren Sie Ihren Stundenplan in Ihre Kalender-App", - "rfp_14": "Rabatt im reFilc Shop (bald)", - "rfp_15": "Abonnentenrolle in unserer Discord-Community", - "rfp_16": "Private Leaks und Informationen über kommende Funktionen", - "rfp_17": "Notenexport", - "rfp_18": "Anzeigen exportierter Noten", - // docs and payment method popup - "docs": "Dokumente", - "docs_acceptance": - "Durch Drücken der Schaltfläche \"Weiter\" akzeptieren Sie die Allgemeinen Geschäftsbedingungen von reFilc für Abonnements (verfügbar unter folgendem Link: filc.one/pay-terms) und unsere Datenschutzrichtlinie (verfügbar unter folgendem Link: filc.one/pay-privacy).", - "next": "Weiter", - "payment_method": "Zahlungsmethode", - "select_payment_method": - "Bitte wählen Sie eine bevorzugte Zahlungsmethode aus! Kreditkartenzahlungen werden von Stripe abgewickelt, der auch Apple Pay, Google Pay und Revolut Pay unterstützt.", - "stripe": "Kreditkarte", - "paypal": "PayPal", - // other - "and": " und ", - "every": "Jeder ", - "benefit": " Vorteil", - "show_lifetime": "Für immer Pakete", - "more_soon": "Mehr folgt bald...", - "faq_dc": - "Um Ihre Vorteile einzulösen, schreiben Sie uns eine private Nachricht auf Discord!", - "reactivate": "Bestehendes Abonnement reaktivieren", - }, - }; - - String get i18n => localize(this, _t); - String fill(List params) => localizeFill(this, params); - String plural(int value) => localizePlural(value, this, _t); - String version(Object modifier) => localizeVersion(modifier, this, _t); -} diff --git a/refilc_mobile_ui/lib/plus/premium_button.dart b/refilc_mobile_ui/lib/plus/premium_button.dart deleted file mode 100644 index 39abeed3..00000000 --- a/refilc_mobile_ui/lib/plus/premium_button.dart +++ /dev/null @@ -1,126 +0,0 @@ -import 'dart:ui'; - -import 'package:refilc/icons/filc_icons.dart'; -import 'package:refilc_mobile_ui/plus/plus_screen.dart'; -import 'package:flutter/material.dart'; -import 'package:animations/animations.dart'; - -class PremiumButton extends StatefulWidget { - const PremiumButton({super.key}); - - @override - State createState() => _PremiumButtonState(); -} - -class _PremiumButtonState extends State - with TickerProviderStateMixin { - late final AnimationController _animation; - bool _heldDown = false; - - @override - void initState() { - super.initState(); - _animation = - AnimationController(vsync: this, duration: const Duration(seconds: 3)); - _animation.repeat(); - } - - @override - void dispose() { - _animation.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return OpenContainer( - openColor: Theme.of(context).scaffoldBackgroundColor, - closedColor: Theme.of(context).scaffoldBackgroundColor, - clipBehavior: Clip.none, - transitionType: ContainerTransitionType.fadeThrough, - openElevation: 0, - closedElevation: 0, - closedShape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)), - openBuilder: (context, _) => const PlusScreen(), - closedBuilder: (context, action) => GestureDetector( - onTapDown: (_) => setState(() => _heldDown = true), - onTapUp: (_) => setState(() => _heldDown = false), - onTapCancel: () => setState(() => _heldDown = false), - onTap: action, - child: Stack( - alignment: Alignment.center, - children: [ - // RGB background animation - AnimatedBuilder( - animation: _animation, - builder: (context, child) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 18.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(14.0), - child: ImageFiltered( - imageFilter: - ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), - child: Container( - height: 70, - decoration: BoxDecoration( - gradient: SweepGradient( - colors: const [ - Colors.blue, - Colors.orange, - Colors.purple, - Colors.blue, - ], - transform: GradientRotation( - _animation.value * 6.283185)), - ), - ), - ), - ), - ); - }), - - // Button background & text - BackdropFilter( - filter: ImageFilter.blur(sigmaX: 6.0, sigmaY: 6.0), - child: AnimatedScale( - duration: const Duration(milliseconds: 250), - curve: Curves.easeOutBack, - scale: _heldDown ? 1.03 : 1, - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 24.0), - width: double.infinity, - height: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14.0), - gradient: const LinearGradient(colors: [ - Color(0xff124F3D), - Color(0xff1EA18F), - ]), - ), - child: const Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(FilcIcons.premium, color: Colors.white), - SizedBox(width: 12.0), - Text( - "reFilc+", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 20.0, - ), - textAlign: TextAlign.center, - ), - ], - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/refilc_mobile_ui/lib/plus/styles/gradients.dart b/refilc_mobile_ui/lib/plus/styles/gradients.dart deleted file mode 100644 index 17fa6de1..00000000 --- a/refilc_mobile_ui/lib/plus/styles/gradients.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:flutter/widgets.dart'; - -class GradientStyles { - static const tinta = LinearGradient( - colors: [Color(0xffB816E0), Color(0xff17D1BB)], - ); - static final tintaPaint = Paint()..shader = tinta.createShader(const Rect.fromLTWH(0, 0, 200, 70)); - - static const kupak = LinearGradient( - colors: [Color(0xffF0BD0C), Color(0xff0CD070)], - ); - static final kupakPaint = Paint()..shader = kupak.createShader(const Rect.fromLTWH(0, 0, 200, 70)); -} diff --git a/refilc_mobile_ui/lib/plus/supporters_screen.dart b/refilc_mobile_ui/lib/plus/supporters_screen.dart deleted file mode 100644 index d02613d4..00000000 --- a/refilc_mobile_ui/lib/plus/supporters_screen.dart +++ /dev/null @@ -1,144 +0,0 @@ -import 'package:refilc/icons/filc_icons.dart'; -import 'package:refilc/models/supporter.dart'; -import 'package:refilc/theme/colors/colors.dart'; -import 'package:refilc_mobile_ui/plus/components/supporter_group_card.dart'; -import 'package:refilc_mobile_ui/plus/styles/gradients.dart'; -import 'package:flutter/material.dart'; - -class SupportersScreen extends StatelessWidget { - const SupportersScreen({super.key, required this.supporters}); - - final Future supporters; - - @override - Widget build(BuildContext context) { - return FutureBuilder( - future: supporters, - builder: (context, snapshot) { - final highlightedSupporters = snapshot.data?.github - .where((e) => - e.type == DonationType.monthly && - e.price >= 5 && - e.comment != "") - .toList() ?? - []; - final tintaSupporters = snapshot.data?.github - .where((e) => - e.type == DonationType.monthly && - e.price >= 5 && - e.comment == "") - .toList() ?? - []; - final kupakSupporters = snapshot.data?.github - .where((e) => e.type == DonationType.monthly && e.price == 2) - .toList() ?? - []; - final onetimeSupporters = snapshot.data?.github - .where((e) => e.type == DonationType.once && e.price >= 5) - .toList() ?? - []; - final patreonSupporters = snapshot.data?.patreon ?? []; - - return Scaffold( - body: CustomScrollView( - slivers: [ - SliverAppBar.large( - surfaceTintColor: Theme.of(context).scaffoldBackgroundColor, - title: const Text( - "Támogatók", - style: TextStyle(fontWeight: FontWeight.w700), - ), - ), - if (snapshot.hasData) - SliverPadding( - padding: const EdgeInsets.symmetric(horizontal: 16.0) - .add(const EdgeInsets.only(bottom: 24.0)), - sliver: SliverToBoxAdapter( - child: Text( - snapshot.data!.description, - style: TextStyle( - fontWeight: FontWeight.w500, - fontSize: 20.0, - color: AppColors.of(context) - .text - .withValues(alpha: .7)), - ), - ), - ), - if (!snapshot.hasData) - const SliverPadding( - padding: EdgeInsets.all(12.0), - sliver: SliverToBoxAdapter( - child: Center(child: CircularProgressIndicator()), - ), - ), - if (highlightedSupporters.isNotEmpty) - SliverPadding( - padding: const EdgeInsets.all(12.0), - sliver: SliverToBoxAdapter( - child: SupporterGroupCard( - title: const Text("Kiemelt támogatók"), - expanded: true, - supporters: highlightedSupporters, - ), - ), - ), - if (tintaSupporters.isNotEmpty) - SliverPadding( - padding: const EdgeInsets.all(12.0), - sliver: SliverToBoxAdapter( - child: SupporterGroupCard( - icon: const Icon(FilcIcons.tinta), - title: Text( - "Tinta", - style: TextStyle( - foreground: GradientStyles.tintaPaint, - ), - ), - glow: Colors.purple, - supporters: tintaSupporters, - ), - ), - ), - if (kupakSupporters.isNotEmpty) - SliverPadding( - padding: const EdgeInsets.all(12.0), - sliver: SliverToBoxAdapter( - child: SupporterGroupCard( - icon: const Icon(FilcIcons.kupak), - title: Text( - "Kupak", - style: - TextStyle(foreground: GradientStyles.kupakPaint), - ), - glow: Colors.lightGreen, - supporters: kupakSupporters, - ), - ), - ), - if (onetimeSupporters.isNotEmpty) - SliverPadding( - padding: const EdgeInsets.all(12.0), - sliver: SliverToBoxAdapter( - child: SupporterGroupCard( - title: const Text("Egyszeri támogatók"), - supporters: onetimeSupporters, - ), - ), - ), - if (patreonSupporters.isNotEmpty) - SliverPadding( - padding: const EdgeInsets.all(12.0), - sliver: SliverToBoxAdapter( - child: SupporterGroupCard( - title: const Text("Régebbi támogatóink"), - supporters: patreonSupporters, - ), - ), - ), - ], - ), - ); - }); - } -} diff --git a/refilc_mobile_ui/lib/screens/settings/submenu/code_scanner.dart b/refilc_mobile_ui/lib/screens/settings/submenu/code_scanner.dart deleted file mode 100644 index 7a36a54f..00000000 --- a/refilc_mobile_ui/lib/screens/settings/submenu/code_scanner.dart +++ /dev/null @@ -1,172 +0,0 @@ -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:flutter_feather_icons/flutter_feather_icons.dart'; -import 'package:qr_code_scanner_plus/qr_code_scanner_plus.dart'; -import 'package:refilc/theme/colors/colors.dart'; -import 'package:refilc_mobile_ui/common/custom_snack_bar.dart'; -import 'package:refilc_mobile_ui/screens/settings/settings_screen.i18n.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class CodeScannerScreen extends StatefulWidget { - const CodeScannerScreen({super.key}); - - @override - State createState() => _CodeScannerScreenState(); -} - -class _CodeScannerScreenState extends State { - Barcode? result; - QRViewController? controller; - final GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); - - @override - void reassemble() { - super.reassemble(); - if (Platform.isAndroid) { - controller!.pauseCamera(); - } - controller!.resumeCamera(); - } - - // @override - // void initState() { - // super.initState(); - - // controller!.resumeCamera(); - // } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - backgroundColor: Colors.transparent, - title: Text('qr_scanner'.i18n), - leading: const BackButton(), - actions: [ - IconButton( - icon: FutureBuilder( - future: controller?.getFlashStatus(), - builder: (context, snapshot) { - return Icon( - snapshot.data == true - ? FeatherIcons.zapOff - : FeatherIcons.zap, - ); - }, - ), - onPressed: () async { - await controller?.toggleFlash(); - setState(() {}); - }, - ), - ], - ), - body: _buildQrView(context), - ); - } - - Widget _buildQrView(BuildContext context) { - var scanArea = (MediaQuery.of(context).size.width < 400 || - MediaQuery.of(context).size.height < 400) - ? 250.0 - : 280.0; - - return QRView( - key: qrKey, - onQRViewCreated: _onQRViewCreated, - overlay: QrScannerOverlayShape( - borderColor: Theme.of(context).primaryColor, - borderRadius: 10, - borderLength: 30, - borderWidth: 10, - cutOutSize: scanArea, - ), - onPermissionSet: (ctrl, p) => _onPermissionSet(context, ctrl, p), - ); - } - - void _onQRViewCreated(QRViewController controller) { - setState(() { - this.controller = controller; - }); - controller.scannedDataStream.listen((scanData) { - // controller.pauseCamera(); - if (result?.code == scanData.code) return; - - setState(() { - result = scanData; - }); - - if (scanData.code != null) { - if (scanData.code!.startsWith('qw://')) { - // String data = scanData.code!.replaceFirst('qw://', ''); - // check the qr id from api - // TODO: this qr shit - } else if (scanData.code!.startsWith('https://') || - scanData.code!.startsWith('http://')) { - Uri uri = - Uri.parse(scanData.code!.replaceFirst('http://', 'https://')); - - // print(uri); - - if (uri.host.contains('refilc.hu') || - uri.host.contains('refilcapp.hu') || - uri.host.contains('filc.one')) { - ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar( - content: Text("success".i18n, - style: const TextStyle(color: Colors.white)), - backgroundColor: const Color(0xFF00A900), - context: context, - )); - - // launch refilc url - Future.delayed(const Duration(seconds: 1), () { - Navigator.of(context).pop(); - launchUrl(uri, mode: LaunchMode.inAppBrowserView); - }); - } else { - // show invalid code error - // Navigator.of(context).pop(); - ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar( - content: Text("invalid_qr_code".i18n, - style: const TextStyle(color: Colors.white)), - backgroundColor: AppColors.of(context).red, - context: context, - )); - - controller.resumeCamera(); - } - } else { - // show invalid code error - // Navigator.of(context).pop(); - ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar( - content: Text("invalid_qr_code".i18n, - style: const TextStyle(color: Colors.white)), - backgroundColor: AppColors.of(context).red, - context: context, - )); - - controller.resumeCamera(); - } - } - }); - } - - void _onPermissionSet(BuildContext context, QRViewController ctrl, bool p) { - if (!p) { - ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar( - content: Text("camera_perm_error".i18n, - style: const TextStyle(color: Colors.white)), - backgroundColor: AppColors.of(context).red, - context: context, - )); - } - } - - @override - void dispose() { - controller?.dispose(); - super.dispose(); - } -} diff --git a/refilc_plus/lib/ui/mobile/plus/settings_inline.dart b/refilc_plus/lib/ui/mobile/plus/settings_inline.dart index 26539130..21123157 100644 --- a/refilc_plus/lib/ui/mobile/plus/settings_inline.dart +++ b/refilc_plus/lib/ui/mobile/plus/settings_inline.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:refilc_mobile_ui/plus/plus_screen.dart'; import 'package:refilc_plus/models/premium_scopes.dart'; import 'package:refilc_plus/providers/plus_provider.dart'; import 'plus_things.i18n.dart'; @@ -25,7 +24,8 @@ class PlusSettingsInline extends StatelessWidget { if (plusTier == 'none') { Navigator.of(context, rootNavigator: true) .push(MaterialPageRoute(builder: (context) { - return const PlusScreen(); + // return empty container + return Container(); })); } else { SettingsHelper.plusOptions(context); diff --git a/refilc_plus/lib/ui/mobile/plus/upsell.dart b/refilc_plus/lib/ui/mobile/plus/upsell.dart index b65cc011..af605d02 100644 --- a/refilc_plus/lib/ui/mobile/plus/upsell.dart +++ b/refilc_plus/lib/ui/mobile/plus/upsell.dart @@ -1,6 +1,5 @@ import 'package:flutter_svg/svg.dart'; import 'package:refilc_mobile_ui/common/bottom_sheet_menu/rounded_bottom_sheet.dart'; -import 'package:refilc_mobile_ui/plus/plus_screen.dart'; import 'package:flutter/material.dart'; import 'plus_things.i18n.dart'; @@ -445,7 +444,7 @@ class PlusLockedFeaturePopup extends StatelessWidget { onTap: () { Navigator.of(context, rootNavigator: true) .push(MaterialPageRoute(builder: (context) { - return const PlusScreen(); + return Container(); })); }, child: Container(