From 1ec226511c03f568c10cecaa900c75e65f4f1b76 Mon Sep 17 00:00:00 2001 From: Kima Date: Sun, 3 Mar 2024 20:14:41 +0100 Subject: [PATCH] refilcplus things --- refilc/lib/main.dart | 5 - refilc/pubspec.yaml | 1 - .../lib/premium/components/github_button.dart | 91 +++++++++---------- .../components/github_connect_button.dart | 2 +- .../lib/premium/components/plan_card.dart | 14 +-- refilc_mobile_ui/lib/premium/plus_screen.dart | 54 +++++------ .../lib/premium/plus_screen.i18n.dart | 60 ++++++++++++ refilc_mobile_ui/pubspec.yaml | 1 - refilc_plus | 2 +- 9 files changed, 138 insertions(+), 92 deletions(-) diff --git a/refilc/lib/main.dart b/refilc/lib/main.dart index f33a476..91b569f 100644 --- a/refilc/lib/main.dart +++ b/refilc/lib/main.dart @@ -13,7 +13,6 @@ import 'package:flutter/services.dart'; import 'package:refilc_mobile_ui/screens/error_screen.dart'; import 'package:refilc_mobile_ui/screens/error_report_screen.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:flutter_stripe/flutter_stripe.dart' as stripe; // import 'package:firebase_core/firebase_core.dart'; // import 'firebase_options.dart'; @@ -33,10 +32,6 @@ void main() async { BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask); - // initialize stripe key - stripe.Stripe.publishableKey = - 'pk_test_51Oo7iUBS0FxsTGxKjGZSQqzDKWHY5ZFYM9XeI0qSdIh2w8jWy6GhHlYpT7GLTzgpl1xhE5YP4BXpA4gMZqPmgMId00cGFYFzbh'; - // Run App runApp(App( database: startup.database, diff --git a/refilc/pubspec.yaml b/refilc/pubspec.yaml index 918146e..96e3087 100644 --- a/refilc/pubspec.yaml +++ b/refilc/pubspec.yaml @@ -77,7 +77,6 @@ dependencies: extension_google_sign_in_as_googleapis_auth: ^2.0.12 maps_launcher: ^2.2.0 google_fonts: ^6.1.0 - flutter_stripe: ^10.0.0 dev_dependencies: flutter_lints: ^3.0.1 diff --git a/refilc_mobile_ui/lib/premium/components/github_button.dart b/refilc_mobile_ui/lib/premium/components/github_button.dart index 64b27d7..35872c3 100644 --- a/refilc_mobile_ui/lib/premium/components/github_button.dart +++ b/refilc_mobile_ui/lib/premium/components/github_button.dart @@ -1,8 +1,7 @@ -import 'package:flutter_stripe/flutter_stripe.dart' as stripe; -import 'package:refilc/api/client.dart'; -import 'package:refilc/theme/colors/colors.dart'; +// import 'package:refilc/api/client.dart'; +// import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc_plus/providers/premium_provider.dart'; -import 'package:refilc_plus/ui/mobile/premium/activation_view/activation_view.dart'; +// import 'package:refilc_plus/ui/mobile/premium/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'; @@ -128,49 +127,49 @@ class GithubLoginButton extends StatelessWidget { ); } - Future initPaymentSheet(BuildContext context) async { - try { - // 1. create payment intent on the server - final data = await _createPaymentSheet(); + // 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!"; - } + // 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; - } - } + // // 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; - } + // Future _createPaymentSheet() async { + // Map? data = await FilcAPI.createPaymentSheet("refilcplus"); + // return data; + // } } diff --git a/refilc_mobile_ui/lib/premium/components/github_connect_button.dart b/refilc_mobile_ui/lib/premium/components/github_connect_button.dart index e8f010e..440551a 100644 --- a/refilc_mobile_ui/lib/premium/components/github_connect_button.dart +++ b/refilc_mobile_ui/lib/premium/components/github_connect_button.dart @@ -1,6 +1,6 @@ import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc_plus/providers/premium_provider.dart'; -import 'package:refilc_plus/ui/mobile/premium/activation_view/activation_view.dart'; +// import 'package:refilc_plus/ui/mobile/premium/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'; diff --git a/refilc_mobile_ui/lib/premium/components/plan_card.dart b/refilc_mobile_ui/lib/premium/components/plan_card.dart index fd8e059..80b5c8d 100644 --- a/refilc_mobile_ui/lib/premium/components/plan_card.dart +++ b/refilc_mobile_ui/lib/premium/components/plan_card.dart @@ -173,8 +173,8 @@ class PlusPlanCard extends StatelessWidget { ), TextSpan( children: [ - const TextSpan( - text: 'Minden ', + TextSpan( + text: 'every'.i18n, ), e[1].startsWith('cap') ? const TextSpan( @@ -186,9 +186,9 @@ class PlusPlanCard extends StatelessWidget { FontWeight.w600, ), ) - : const TextSpan( + : TextSpan( children: [ - TextSpan( + const TextSpan( text: 'reFilc+', style: TextStyle( color: Color( @@ -198,9 +198,9 @@ class PlusPlanCard extends StatelessWidget { ), ), TextSpan( - text: ' és ', + text: 'and'.i18n, ), - TextSpan( + const TextSpan( text: 'reFilc+ Gold', style: TextStyle( color: Color( @@ -211,7 +211,7 @@ class PlusPlanCard extends StatelessWidget { ), ], ), - const TextSpan(text: ' előny'), + TextSpan(text: 'benefit'.i18n), ], ), ) diff --git a/refilc_mobile_ui/lib/premium/plus_screen.dart b/refilc_mobile_ui/lib/premium/plus_screen.dart index 4971b65..977d523 100644 --- a/refilc_mobile_ui/lib/premium/plus_screen.dart +++ b/refilc_mobile_ui/lib/premium/plus_screen.dart @@ -35,11 +35,11 @@ class PlusScreen extends StatelessWidget { decoration: BoxDecoration( gradient: LinearGradient( colors: [ - const Color(0xffF4F9FF).withOpacity(0.1), - const Color(0xffF4F9FF).withOpacity(0.15), - const Color(0xffF4F9FF).withOpacity(0.25), - const Color(0xffF4F9FF).withOpacity(0.4), - const Color(0xffF4F9FF).withOpacity(0.5), + const Color(0xffF4F9FF).withOpacity(0.30), + const Color(0xffF4F9FF).withOpacity(0.40), + const Color(0xffF4F9FF).withOpacity(0.50), + const Color(0xffF4F9FF).withOpacity(0.60), + const Color(0xffF4F9FF).withOpacity(0.70), ], begin: Alignment.topCenter, end: Alignment.bottomCenter, @@ -53,8 +53,8 @@ class PlusScreen extends StatelessWidget { gradient: LinearGradient( colors: [ const Color(0xffF4F9FF).withOpacity(0.0), - const Color(0xffF4F9FF).withOpacity(0.4), - const Color(0xffF4F9FF).withOpacity(0.6), + const Color(0xffF4F9FF).withOpacity(0.7), + const Color(0xffF4F9FF).withOpacity(0.8), const Color(0xffF4F9FF).withOpacity(0.9), const Color(0xffF4F9FF), ], @@ -174,19 +174,13 @@ class PlusScreen extends StatelessWidget { borderRadius: const BorderRadius.vertical( top: Radius.circular(16.0), bottom: Radius.circular(8.0)), - features: const [ - ['✨', 'Előzetes hozzáférés új verziókhoz'], - ['👥', '2 fiók használata egyszerre'], - ['👋', 'Egyedi üdvözlő üzenet'], - [ - '📓', - 'Korlátlan saját jegyzet és feladat a füzet oldalon' - ], - ['1️⃣', 'Egyedi jegy ritkaságok'], - [ - '➕', - 'Összesített átlagszámoló', - ], + features: [ + ['✨', 'rfp_1'.i18n], + ['👥', 'rfp_2'.i18n], + ['👋', 'rfp_3'.i18n], + ['📓', 'rfp_4'.i18n], + ['1️⃣', 'rfp_5'.i18n], + ['🎓', 'rfp_6'.i18n], ], ), const SizedBox( @@ -205,16 +199,16 @@ class PlusScreen extends StatelessWidget { borderRadius: const BorderRadius.vertical( top: Radius.circular(8.0), bottom: Radius.circular(16.0)), - features: const [ - ['🕑', 'Órarend jegyzetek'], - ['🔤', 'Egyedi betütípusok'], - ['👥', 'Korlátlan fiók használata egyszerre'], - ['🎓', 'Összesített átlagszámoló'], - ['🟦', 'Live Activity szín'], - ['📱', 'Alkalmazás ikonjának megváltoztatása'], - ['📒', 'Fejlettebb cél kitűzés'], - ['📅', 'Naptár szinkronizálás'], - ['🖋️', 'cap_tier_benefits'], + 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], + const ['🖋️', 'cap_tier_benefits'], ], ), // const SizedBox( diff --git a/refilc_mobile_ui/lib/premium/plus_screen.i18n.dart b/refilc_mobile_ui/lib/premium/plus_screen.i18n.dart index c0b053a..45c5e8d 100644 --- a/refilc_mobile_ui/lib/premium/plus_screen.i18n.dart +++ b/refilc_mobile_ui/lib/premium/plus_screen.i18n.dart @@ -28,6 +28,26 @@ extension SettingsLocalization on String { "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", + "rfp_11": "Change Live Activity color", + "rfp_12": "Better goal planner", + "rfp_13": "Import your timetable into your calendar app", + "rfp_14": "", + "rfp_15": "", + // other + "and": " and ", + "every": "Every ", + "benefit": " benefit", }, "hu_hu": { "even_more_cheaper": "Még több reFilc, olcsóbban,\nmint bármi más!", @@ -54,6 +74,26 @@ extension SettingsLocalization on String { "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", + "rfp_11": "Live Activity szín", + "rfp_12": "Fejlettebb cél kitűzés", + "rfp_13": "Naptár szinkronizálás", + "rfp_14": "", + "rfp_15": "", + // other + "and": " és ", + "every": "Minden ", + "benefit": " előny", }, "de_de": { "even_more_cheaper": "Mehr reFilc, günstiger\nals alles andere!", @@ -81,6 +121,26 @@ extension SettingsLocalization on String { "eur": "Der Preis wird in Euro angegeben im Bezug zum aktuellen Wechselkurs. 1 EUR ≈ 390 HUF", "active": "Aktiv", + // 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", + "rfp_11": "Live Activity szín", + "rfp_12": "Fejlettebb cél kitűzés", + "rfp_13": "Naptár szinkronizálás", + "rfp_14": "", + "rfp_15": "", + // other + "and": " és ", + "every": "Minden ", + "benefit": " előny", }, }; diff --git a/refilc_mobile_ui/pubspec.yaml b/refilc_mobile_ui/pubspec.yaml index b630c65..dfc0a70 100644 --- a/refilc_mobile_ui/pubspec.yaml +++ b/refilc_mobile_ui/pubspec.yaml @@ -64,7 +64,6 @@ dependencies: uuid: ^4.3.3 maps_launcher: ^2.2.0 google_fonts: ^6.1.0 - flutter_stripe: ^10.0.0 flutter_any_logo: ^1.1.1 custom_sliding_segmented_control: ^1.8.1 diff --git a/refilc_plus b/refilc_plus index a356f5d..d3c1941 160000 --- a/refilc_plus +++ b/refilc_plus @@ -1 +1 @@ -Subproject commit a356f5db6403b3ba696009777b7ce65983c926e9 +Subproject commit d3c1941c59fcd5c11aa2befefb2cb714c61b6309