added lifetime toggle to plus subscription screen

This commit is contained in:
Kima 2024-04-06 19:22:36 +02:00
parent a024ac674d
commit d685a64f78
2 changed files with 50 additions and 8 deletions

View File

@ -1,3 +1,4 @@
import 'package:refilc/theme/colors/colors.dart';
import 'package:refilc_mobile_ui/premium/plus_screen.i18n.dart';
import 'package:refilc_mobile_ui/premium/components/plan_card.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
@ -9,14 +10,21 @@ import 'package:refilc_plus/ui/mobile/premium/upsell.dart';
import 'components/active_sponsor_card.dart';
// import 'components/github_button.dart';
class PlusScreen extends StatelessWidget {
class PlusScreen extends StatefulWidget {
const PlusScreen({super.key});
@override
State<PlusScreen> createState() => PlusScreenState();
}
class PlusScreenState extends State<PlusScreen> {
Uri parseTierUri({required String tierId}) {
return Uri.parse(
'https://github.com/sponsors/refilc/sponsorships?tier_id=$tierId&preview=true');
}
bool showLifetime = false;
@override
Widget build(BuildContext context) {
LinearGradient plusGradient = const LinearGradient(
@ -201,8 +209,8 @@ class PlusScreen extends StatelessWidget {
description: 'tier_rfp'.i18n,
color: const Color(0xFF7C3EFF),
gradient: plusGradient,
id: 'refilcplus',
price: 0.99,
id: showLifetime ? 'refilcpluslifetime' : 'refilcplus',
price: showLifetime ? 39.99 : 0.99,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(16.0),
bottom: Radius.circular(16.0)),
@ -213,6 +221,7 @@ class PlusScreen extends StatelessWidget {
['👋', 'rfp_3'.i18n],
['📓', 'rfp_4'.i18n],
['🎓', 'rfp_6'.i18n],
['🔜', 'more_soon'.i18n],
],
),
const SizedBox(
@ -227,8 +236,10 @@ class PlusScreen extends StatelessWidget {
description: 'tier_rfpgold'.i18n,
color: const Color(0xFFFFBD3E),
gradient: goldGradient,
id: 'refilcplusgold',
price: 2.99,
id: showLifetime
? 'refilcplusgoldlifetime'
: 'refilcplusgold',
price: showLifetime ? 59.99 : 2.99,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(16.0),
bottom: Radius.circular(16.0)),
@ -242,6 +253,7 @@ class PlusScreen extends StatelessWidget {
['📒', 'rfp_12'.i18n],
['📅', 'rfp_13'.i18n],
const ['🖋️', 'cap_tier_benefits'],
['🔜', 'more_soon'.i18n],
],
),
// const SizedBox(
@ -270,6 +282,30 @@ class PlusScreen extends StatelessWidget {
// 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: AppColors.of(context).text.withOpacity(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),
),
),
// faq section
const SizedBox(
height: 30.0,
),

View File

@ -9,7 +9,7 @@ extension SettingsLocalization on String {
"support_2": " and get useful features in return!",
"tier_rfp": "More customisation, more accounts, easier notes.",
"tier_rfpgold":
"Get access to more features, add multiple profiles, and make your day better and simpler.",
"Get access to more features and make your day better and simpler.",
"faq": "FAQ",
"money": "What will you spend my money on?",
"m_1":
@ -48,6 +48,8 @@ extension SettingsLocalization on String {
"and": " and ",
"every": "Every ",
"benefit": " benefit",
"show_lifetime": "Show Lifetime Plans",
"more_soon": "More coming soon...",
},
"hu_hu": {
"even_more_cheaper": "Még több reFilc, olcsóbban,\nmint bármi más!",
@ -56,7 +58,7 @@ extension SettingsLocalization on String {
"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, használj még több profilt és tedd egyszerűbbé mindennapjaid.",
"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",
@ -94,6 +96,8 @@ extension SettingsLocalization on String {
"and": " és ",
"every": "Minden ",
"benefit": " előny",
"show_lifetime": "Örökre szóló csomagok",
"more_soon": "Hamarosan mégtöbb finomság...",
},
"de_de": {
"even_more_cheaper": "Mehr reFilc, günstiger\nals alles andere!",
@ -102,7 +106,7 @@ extension SettingsLocalization on String {
"tier_rfp":
"Mehr Personalisierung, mehr Profile, einfachere Notizen.",
"tier_rfpgold":
"Hol dir mehr Features, füge mehrere Profile hinzu und mach damit dein Alltag einfacher.",
"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":
@ -141,6 +145,8 @@ extension SettingsLocalization on String {
"and": " és ",
"every": "Minden ",
"benefit": " előny",
"show_lifetime": "Für immer Pakete",
"more_soon": "Mehr folgt bald...",
},
};