forked from firka/student-legacy
added lifetime toggle to plus subscription screen
This commit is contained in:
parent
a024ac674d
commit
d685a64f78
@ -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/plus_screen.i18n.dart';
|
||||||
import 'package:refilc_mobile_ui/premium/components/plan_card.dart';
|
import 'package:refilc_mobile_ui/premium/components/plan_card.dart';
|
||||||
import 'package:flutter_feather_icons/flutter_feather_icons.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/active_sponsor_card.dart';
|
||||||
// import 'components/github_button.dart';
|
// import 'components/github_button.dart';
|
||||||
|
|
||||||
class PlusScreen extends StatelessWidget {
|
class PlusScreen extends StatefulWidget {
|
||||||
const PlusScreen({super.key});
|
const PlusScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PlusScreen> createState() => PlusScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class PlusScreenState extends State<PlusScreen> {
|
||||||
Uri parseTierUri({required String tierId}) {
|
Uri parseTierUri({required String tierId}) {
|
||||||
return Uri.parse(
|
return Uri.parse(
|
||||||
'https://github.com/sponsors/refilc/sponsorships?tier_id=$tierId&preview=true');
|
'https://github.com/sponsors/refilc/sponsorships?tier_id=$tierId&preview=true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool showLifetime = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
LinearGradient plusGradient = const LinearGradient(
|
LinearGradient plusGradient = const LinearGradient(
|
||||||
@ -201,8 +209,8 @@ class PlusScreen extends StatelessWidget {
|
|||||||
description: 'tier_rfp'.i18n,
|
description: 'tier_rfp'.i18n,
|
||||||
color: const Color(0xFF7C3EFF),
|
color: const Color(0xFF7C3EFF),
|
||||||
gradient: plusGradient,
|
gradient: plusGradient,
|
||||||
id: 'refilcplus',
|
id: showLifetime ? 'refilcpluslifetime' : 'refilcplus',
|
||||||
price: 0.99,
|
price: showLifetime ? 39.99 : 0.99,
|
||||||
borderRadius: const BorderRadius.vertical(
|
borderRadius: const BorderRadius.vertical(
|
||||||
top: Radius.circular(16.0),
|
top: Radius.circular(16.0),
|
||||||
bottom: Radius.circular(16.0)),
|
bottom: Radius.circular(16.0)),
|
||||||
@ -213,6 +221,7 @@ class PlusScreen extends StatelessWidget {
|
|||||||
['👋', 'rfp_3'.i18n],
|
['👋', 'rfp_3'.i18n],
|
||||||
['📓', 'rfp_4'.i18n],
|
['📓', 'rfp_4'.i18n],
|
||||||
['🎓', 'rfp_6'.i18n],
|
['🎓', 'rfp_6'.i18n],
|
||||||
|
['🔜', 'more_soon'.i18n],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
@ -227,8 +236,10 @@ class PlusScreen extends StatelessWidget {
|
|||||||
description: 'tier_rfpgold'.i18n,
|
description: 'tier_rfpgold'.i18n,
|
||||||
color: const Color(0xFFFFBD3E),
|
color: const Color(0xFFFFBD3E),
|
||||||
gradient: goldGradient,
|
gradient: goldGradient,
|
||||||
id: 'refilcplusgold',
|
id: showLifetime
|
||||||
price: 2.99,
|
? 'refilcplusgoldlifetime'
|
||||||
|
: 'refilcplusgold',
|
||||||
|
price: showLifetime ? 59.99 : 2.99,
|
||||||
borderRadius: const BorderRadius.vertical(
|
borderRadius: const BorderRadius.vertical(
|
||||||
top: Radius.circular(16.0),
|
top: Radius.circular(16.0),
|
||||||
bottom: Radius.circular(16.0)),
|
bottom: Radius.circular(16.0)),
|
||||||
@ -242,6 +253,7 @@ class PlusScreen extends StatelessWidget {
|
|||||||
['📒', 'rfp_12'.i18n],
|
['📒', 'rfp_12'.i18n],
|
||||||
['📅', 'rfp_13'.i18n],
|
['📅', 'rfp_13'.i18n],
|
||||||
const ['🖋️', 'cap_tier_benefits'],
|
const ['🖋️', 'cap_tier_benefits'],
|
||||||
|
['🔜', 'more_soon'.i18n],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// const SizedBox(
|
// const SizedBox(
|
||||||
@ -270,6 +282,30 @@ class PlusScreen extends StatelessWidget {
|
|||||||
// height: 18.0,
|
// height: 18.0,
|
||||||
// ),
|
// ),
|
||||||
// const GithubLoginButton(),
|
// 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(
|
const SizedBox(
|
||||||
height: 30.0,
|
height: 30.0,
|
||||||
),
|
),
|
||||||
|
@ -9,7 +9,7 @@ extension SettingsLocalization on String {
|
|||||||
"support_2": " and get useful features in return!",
|
"support_2": " and get useful features in return!",
|
||||||
"tier_rfp": "More customisation, more accounts, easier notes.",
|
"tier_rfp": "More customisation, more accounts, easier notes.",
|
||||||
"tier_rfpgold":
|
"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",
|
"faq": "FAQ",
|
||||||
"money": "What will you spend my money on?",
|
"money": "What will you spend my money on?",
|
||||||
"m_1":
|
"m_1":
|
||||||
@ -48,6 +48,8 @@ extension SettingsLocalization on String {
|
|||||||
"and": " and ",
|
"and": " and ",
|
||||||
"every": "Every ",
|
"every": "Every ",
|
||||||
"benefit": " benefit",
|
"benefit": " benefit",
|
||||||
|
"show_lifetime": "Show Lifetime Plans",
|
||||||
|
"more_soon": "More coming soon...",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
"even_more_cheaper": "Még több reFilc, olcsóbban,\nmint bármi más!",
|
"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":
|
"tier_rfp":
|
||||||
"Több személyre szabás, több fiók, egyszerű feladatfeljegyzés.",
|
"Több személyre szabás, több fiók, egyszerű feladatfeljegyzés.",
|
||||||
"tier_rfpgold":
|
"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",
|
"faq": "Gyakori kérdések",
|
||||||
"money": "Mire költitek a pénzt?",
|
"money": "Mire költitek a pénzt?",
|
||||||
"m_1": "A támogatásokból kapott pénz elsősorban az Apple",
|
"m_1": "A támogatásokból kapott pénz elsősorban az Apple",
|
||||||
@ -94,6 +96,8 @@ extension SettingsLocalization on String {
|
|||||||
"and": " és ",
|
"and": " és ",
|
||||||
"every": "Minden ",
|
"every": "Minden ",
|
||||||
"benefit": " előny",
|
"benefit": " előny",
|
||||||
|
"show_lifetime": "Örökre szóló csomagok",
|
||||||
|
"more_soon": "Hamarosan mégtöbb finomság...",
|
||||||
},
|
},
|
||||||
"de_de": {
|
"de_de": {
|
||||||
"even_more_cheaper": "Mehr reFilc, günstiger\nals alles andere!",
|
"even_more_cheaper": "Mehr reFilc, günstiger\nals alles andere!",
|
||||||
@ -102,7 +106,7 @@ extension SettingsLocalization on String {
|
|||||||
"tier_rfp":
|
"tier_rfp":
|
||||||
"Mehr Personalisierung, mehr Profile, einfachere Notizen.",
|
"Mehr Personalisierung, mehr Profile, einfachere Notizen.",
|
||||||
"tier_rfpgold":
|
"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)",
|
"faq": "Häufig gestellte Fragen (FAQ)",
|
||||||
"money": "Was tun wir mit deinem Geld?",
|
"money": "Was tun wir mit deinem Geld?",
|
||||||
"m_1":
|
"m_1":
|
||||||
@ -141,6 +145,8 @@ extension SettingsLocalization on String {
|
|||||||
"and": " és ",
|
"and": " és ",
|
||||||
"every": "Minden ",
|
"every": "Minden ",
|
||||||
"benefit": " előny",
|
"benefit": " előny",
|
||||||
|
"show_lifetime": "Für immer Pakete",
|
||||||
|
"more_soon": "Mehr folgt bald...",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user