diff --git a/refilc_mobile_ui/lib/plus/plus_screen.dart b/refilc_mobile_ui/lib/plus/plus_screen.dart index 45c28e9..44bfd12 100644 --- a/refilc_mobile_ui/lib/plus/plus_screen.dart +++ b/refilc_mobile_ui/lib/plus/plus_screen.dart @@ -1,3 +1,5 @@ +// ignore_for_file: use_build_context_synchronously + import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc_mobile_ui/plus/plus_screen.i18n.dart'; import 'package:refilc_mobile_ui/plus/components/plan_card.dart'; @@ -308,6 +310,58 @@ class PlusScreenState extends State { title: Text('show_lifetime'.i18n), ), ), + // reactivate plus + 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: ListTile( + contentPadding: + const EdgeInsets.only(left: 15.0, right: 10.0), + onTap: () async { + 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), + ), + ), // faq section const SizedBox( height: 30.0, diff --git a/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart b/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart index 20ab9d0..f10ea85 100644 --- a/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart +++ b/refilc_mobile_ui/lib/plus/plus_screen.i18n.dart @@ -52,6 +52,7 @@ extension SettingsLocalization on String { "show_lifetime": "Show Lifetime Plans", "more_soon": "More coming soon...", "faq_dc": "To redeem your 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!", @@ -103,6 +104,7 @@ extension SettingsLocalization on String { "more_soon": "Hamarosan mégtöbb finomság...", "faq_dc": "Az 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!", @@ -155,6 +157,7 @@ extension SettingsLocalization on String { "more_soon": "Mehr folgt bald...", "faq_dc": "Az előnyök beváltásához írj nekünk Discord-on privát üzenetet!", + "reactivate": "Bestehendes Abonnement reaktivieren", }, }; diff --git a/refilc_plus b/refilc_plus index 8ac99d0..c2754b8 160000 --- a/refilc_plus +++ b/refilc_plus @@ -1 +1 @@ -Subproject commit 8ac99d0163878fcf173f62ddaa47dd5ac700418c +Subproject commit c2754b83ae2167857626653291185d4df59f0eba