rfplus things again
This commit is contained in:
parent
d1d5f0ee11
commit
8ac99d0163
@ -62,7 +62,8 @@ class PremiumAuth {
|
||||
);
|
||||
|
||||
launchUrl(
|
||||
Uri.parse("${FilcAPI.payment}/stripe-create-checkout?product=$product"),
|
||||
Uri.parse(
|
||||
"${FilcAPI.payment}/stripe-create-checkout?product=$product&rf_uinid=${_settings.xFilcId}"),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
} catch (err, sta) {
|
||||
@ -145,6 +146,7 @@ class PremiumAuth {
|
||||
|
||||
final res = await http.post(Uri.parse(FilcAPI.plusActivation), body: {
|
||||
"session_id": _settings.plusSessionId,
|
||||
"rf_uinid": _settings.xFilcId,
|
||||
});
|
||||
|
||||
if (kDebugMode) print(res.body);
|
||||
@ -162,6 +164,9 @@ class PremiumAuth {
|
||||
if (res.body == "no_subscription") {
|
||||
throw "This user isn't a subscriber!";
|
||||
}
|
||||
if (res.body == "unknown_device") {
|
||||
throw "This device is not recognized, please contact support!";
|
||||
}
|
||||
|
||||
final premium = PremiumResult.fromJson(jsonDecode(res.body) as Map);
|
||||
|
||||
|
@ -15,7 +15,7 @@ class PremiumScopes {
|
||||
static const unlimitedSelfNotes = "refilc.plus.UNLIMITED_SELF_NOTES";
|
||||
static const customGradeRarities = "refilc.plus.CUSTOM_GRADE_RARITIES";
|
||||
// tier scope
|
||||
static const tierCap = "refilc.plus.tier.CAP";
|
||||
// static const tierCap = "refilc.plus.tier.CAP";
|
||||
|
||||
// tier 2 (Tinta) (reFilc+ Gold)
|
||||
static const noAccountLimit = "refilc.plus.NO_ACCOUNT_LIMIT";
|
||||
@ -26,7 +26,7 @@ class PremiumScopes {
|
||||
static const unlimitedGoalPlanner = "refilc.plus.UNLIMITED_GOAL_PLANNER";
|
||||
static const calendarSync = "refilc.plus.CALENDAR_SYNC";
|
||||
// tier scope
|
||||
static const tierInk = "refilc.plus.tier.INK";
|
||||
// static const tierInk = "refilc.plus.tier.INK";
|
||||
|
||||
// tier 3 (Szivacs)
|
||||
// cancelled
|
||||
@ -43,4 +43,8 @@ class PremiumScopes {
|
||||
static const renameSubjects = "refilc.plus.RENAME_SUBJECTS";
|
||||
static const timetableWidget = "refilc.plus.TIMETALBE_WIDGET";
|
||||
static const fsTimetable = "refilc.plus.FS_TIMETABLE";
|
||||
|
||||
// new new tier scopes
|
||||
static const tierBasic = "refilc.plus.tier.BASIC";
|
||||
static const tierGold = "refilc.plus.tier.GOLD";
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
import 'package:animations/animations.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_dashboard.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:refilc_plus/ui/mobile/plus/plus_things.i18n.dart';
|
||||
|
||||
class PremiumActivationView extends StatefulWidget {
|
||||
const PremiumActivationView({super.key, required this.product});
|
||||
@ -42,8 +44,28 @@ class _PremiumActivationViewState extends State<PremiumActivationView>
|
||||
activated = true;
|
||||
animation.forward();
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
Future.delayed(const Duration(seconds: 2)).then((value) {
|
||||
if (mounted) Navigator.of(context).pop();
|
||||
Future.delayed(const Duration(seconds: 5)).then((value) {
|
||||
if (mounted) {
|
||||
// pop the anim
|
||||
Navigator.of(context).pop();
|
||||
// pop the plus view
|
||||
Navigator.of(context).pop();
|
||||
// show alert to save code
|
||||
ScaffoldMessenger.of(context).clearSnackBars();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
"copy_code_asap".i18n,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
backgroundColor: AppColors.of(context).background,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -64,7 +86,8 @@ class _PremiumActivationViewState extends State<PremiumActivationView>
|
||||
width: 400,
|
||||
child: Lottie.network(
|
||||
"https://assets2.lottiefiles.com/packages/lf20_wkebwzpz.json",
|
||||
controller: animation),
|
||||
controller: animation,
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SafeArea(child: ActivationDashboard()),
|
||||
|
@ -37,6 +37,10 @@ extension Localization on String {
|
||||
"u_desc_12": "Sync your time-table with reFilc+ Gold!",
|
||||
// button
|
||||
"subscribe": "Subscribe",
|
||||
"subscriber": "Subscribed",
|
||||
// other
|
||||
"copy_code_asap":
|
||||
"Copy your reFilc+ ID, in case you loose your device!",
|
||||
},
|
||||
"hu_hu": {
|
||||
// upsell titles
|
||||
@ -71,6 +75,10 @@ extension Localization on String {
|
||||
"u_desc_12": "Szinkronizáld az órarended reFilc+ Gold-al!",
|
||||
// button
|
||||
"subscribe": "Előfizetés",
|
||||
"subscriber": "Előfizetve",
|
||||
// other
|
||||
"copy_code_asap":
|
||||
"Másold ki a reFilc+ ID-t, mielőtt elveszítenéd a telefonod!",
|
||||
},
|
||||
"de_de": {
|
||||
// upsell titles
|
||||
@ -110,6 +118,10 @@ extension Localization on String {
|
||||
"u_desc_12": "Synchronisiere deinen Stundenplan mit reFilc+ Gold!",
|
||||
// button
|
||||
"subscribe": "Abonnieren",
|
||||
"subscriber": "im Abonnement",
|
||||
// other
|
||||
"copy_code_asap":
|
||||
"Kopieren Sie Ihre reFilc+ ID, bevor Sie Ihr Handy verlieren!",
|
||||
},
|
||||
};
|
||||
|
@ -1,25 +1,43 @@
|
||||
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';
|
||||
import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart';
|
||||
|
||||
class PlusSettingsInline extends StatelessWidget {
|
||||
const PlusSettingsInline({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final String plusTier = Provider.of<PlusProvider>(context)
|
||||
.hasScope(PremiumScopes.tierGold)
|
||||
? 'gold'
|
||||
: (Provider.of<PlusProvider>(context).hasScope(PremiumScopes.tierBasic)
|
||||
? 'basic'
|
||||
: 'none');
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (plusTier == 'none') {
|
||||
Navigator.of(context, rootNavigator: true)
|
||||
.push(MaterialPageRoute(builder: (context) {
|
||||
return const PlusScreen();
|
||||
}));
|
||||
} else {
|
||||
SettingsHelper.plusOptions(context);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
image: const DecorationImage(
|
||||
image: AssetImage('assets/images/btn_plus_standard.png'),
|
||||
image: DecorationImage(
|
||||
image: plusTier == 'gold'
|
||||
? const AssetImage('assets/images/btn_plus_gold.png')
|
||||
: const AssetImage('assets/images/btn_plus_standard.png'),
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
@ -35,26 +53,30 @@ class PlusSettingsInline extends StatelessWidget {
|
||||
width: 2.0,
|
||||
),
|
||||
Image.asset(
|
||||
'assets/images/plus_tier_cap.png',
|
||||
plusTier == 'gold'
|
||||
? 'assets/images/plus_tier_ink.png'
|
||||
: 'assets/images/plus_tier_cap.png',
|
||||
width: 23.0,
|
||||
height: 23.0,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 14.0,
|
||||
),
|
||||
const Text(
|
||||
Text(
|
||||
'reFilc+',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF150D4E),
|
||||
color: plusTier == 'gold'
|
||||
? const Color(0xFF341C01)
|
||||
: const Color(0xFF150D4E),
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Text(
|
||||
'0.99 €',
|
||||
style: TextStyle(
|
||||
Text(
|
||||
plusTier == 'none' ? '0.99 €' : 'subscriber'.i18n,
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF150D4E),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
|
@ -2,7 +2,7 @@ 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 'upsell.i18n.dart';
|
||||
import 'plus_things.i18n.dart';
|
||||
|
||||
enum PremiumFeature {
|
||||
// old things
|
||||
|
Loading…
x
Reference in New Issue
Block a user