update packages
This commit is contained in:
parent
22ebf816dd
commit
478edbefc0
@ -45,7 +45,7 @@ class PremiumAuth {
|
||||
// }
|
||||
// }
|
||||
|
||||
initAuth({required String product}) {
|
||||
initAuth({required String product, required String paymentProvider}) {
|
||||
try {
|
||||
_sub ??= uriLinkStream.listen(
|
||||
(Uri? uri) {
|
||||
@ -61,9 +61,17 @@ class PremiumAuth {
|
||||
},
|
||||
);
|
||||
|
||||
String url = "https://refilcapp.hu";
|
||||
if (paymentProvider == "stripe") {
|
||||
url =
|
||||
"${FilcAPI.payment}/stripe-create-checkout?product=$product&rf_uinid=${_settings.xFilcId}";
|
||||
} else if (paymentProvider == "paypal") {
|
||||
url =
|
||||
"https://refilcapp.hu/payment/paypal/mobile-checkout?product=$product&device_id=${_settings.xFilcId}";
|
||||
}
|
||||
|
||||
launchUrl(
|
||||
Uri.parse(
|
||||
"${FilcAPI.payment}/stripe-create-checkout?product=$product&rf_uinid=${_settings.xFilcId}"),
|
||||
Uri.parse(url),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
} catch (err, sta) {
|
||||
@ -106,7 +114,7 @@ class PremiumAuth {
|
||||
log("[ERROR] reFilc+ auth failed: $err\n$sta");
|
||||
}
|
||||
|
||||
await _settings.update(plusSessionId: "", premiumScopes: ["refilc.plus.*"]);
|
||||
await _settings.update(plusSessionId: "", premiumScopes: []);
|
||||
// if (Platform.isAndroid) updateWidget();
|
||||
return false;
|
||||
}
|
||||
@ -126,7 +134,7 @@ class PremiumAuth {
|
||||
{bool removePremium = false, bool reactivate = false}) async {
|
||||
if (!removePremium) {
|
||||
if (_settings.plusSessionId == "" && !reactivate) {
|
||||
await _settings.update(premiumScopes: ["refilc.plus.*"], premiumLogin: "");
|
||||
await _settings.update(premiumScopes: [], premiumLogin: "");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -192,7 +200,7 @@ class PremiumAuth {
|
||||
// activation of reFilc+ failed
|
||||
await _settings.update(
|
||||
premiumAccessToken: "",
|
||||
premiumScopes: ["refilc.plus.*"],
|
||||
premiumScopes: [],
|
||||
premiumLogin: "",
|
||||
plusSessionId: "",
|
||||
);
|
||||
|
@ -25,7 +25,10 @@ class _ActivationDashboardState extends State<ActivationDashboard> {
|
||||
});
|
||||
final result =
|
||||
// ignore: use_build_context_synchronously
|
||||
await context.read<PlusProvider>().auth.finishAuth(data.text!);
|
||||
await context
|
||||
.read<PlusProvider>()
|
||||
.auth
|
||||
.finishAuth(data.text!);
|
||||
setState(() {
|
||||
manualActivationLoading = false;
|
||||
});
|
||||
|
@ -8,9 +8,14 @@ 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});
|
||||
const PremiumActivationView({
|
||||
super.key,
|
||||
required this.product,
|
||||
required this.paymentProvider,
|
||||
});
|
||||
|
||||
final String product;
|
||||
final String paymentProvider;
|
||||
|
||||
@override
|
||||
State<PremiumActivationView> createState() => _PremiumActivationViewState();
|
||||
@ -24,7 +29,8 @@ class _PremiumActivationViewState extends State<PremiumActivationView>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<PlusProvider>().auth.initAuth(product: widget.product);
|
||||
context.read<PlusProvider>().auth.initAuth(
|
||||
product: widget.product, paymentProvider: widget.paymentProvider);
|
||||
|
||||
animation =
|
||||
AnimationController(vsync: this, duration: const Duration(seconds: 2));
|
||||
|
@ -36,7 +36,7 @@ dependencies:
|
||||
animations: ^2.0.11
|
||||
flutter_svg: ^2.0.10+1
|
||||
flutter_dynamic_icon: ^2.1.0
|
||||
android_dynamic_icon: ^2.0.0
|
||||
# android_dynamic_icon: ^2.0.0
|
||||
i18n_extension: ^12.0.1
|
||||
http: ^1.2.0
|
||||
fl_chart: ^0.68.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user