lot of work in rfp again
This commit is contained in:
parent
b83689a20b
commit
31d5556142
@ -1,13 +1,12 @@
|
||||
import 'package:flutter_stripe/flutter_stripe.dart' as stripe;
|
||||
import 'package:refilc/api/client.dart';
|
||||
// import 'package:refilc/theme/colors/colors.dart';
|
||||
import 'package:refilc/theme/colors/colors.dart';
|
||||
import 'package:refilc_plus/providers/premium_provider.dart';
|
||||
import 'package:refilc_plus/ui/mobile/premium/activation_view/activation_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class GithubLoginButton extends StatelessWidget {
|
||||
const GithubLoginButton({super.key});
|
||||
@ -39,9 +38,9 @@ class GithubLoginButton extends StatelessWidget {
|
||||
// return;
|
||||
// }
|
||||
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
return const PremiumActivationView();
|
||||
}));
|
||||
// Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
// return const PremiumActivationView();
|
||||
// }));
|
||||
// bool initFinished = await initPaymentSheet(context);
|
||||
// if (initFinished) {
|
||||
// stripe.PaymentSheetPaymentOption? result =
|
||||
|
@ -36,9 +36,9 @@ class GithubConnectButton extends StatelessWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
return const PremiumActivationView();
|
||||
}));
|
||||
// Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
// // return const PremiumActivationView();
|
||||
// }));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
|
@ -1,4 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:refilc_plus/providers/premium_provider.dart';
|
||||
import 'package:refilc_plus/ui/mobile/premium/activation_view/activation_view.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class PlusPlanCard extends StatelessWidget {
|
||||
@ -9,7 +12,7 @@ class PlusPlanCard extends StatelessWidget {
|
||||
required this.description,
|
||||
required this.color,
|
||||
this.price = 0,
|
||||
this.url,
|
||||
required this.id,
|
||||
this.active = false,
|
||||
this.borderRadius,
|
||||
this.features = const [],
|
||||
@ -20,7 +23,7 @@ class PlusPlanCard extends StatelessWidget {
|
||||
final String description;
|
||||
final Color color;
|
||||
final double price;
|
||||
final Uri? url;
|
||||
final String id;
|
||||
final bool active;
|
||||
final BorderRadiusGeometry? borderRadius;
|
||||
final List<List<String>> features;
|
||||
@ -29,12 +32,21 @@ class PlusPlanCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (url != null) {
|
||||
launchUrl(
|
||||
url!,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
if (Provider.of<PremiumProvider>(context, listen: false).hasPremium) {
|
||||
if (!active) {
|
||||
launchUrl(
|
||||
Uri.parse(
|
||||
'https://billing.stripe.com/p/login/5kAbJXeMkaRi8dWeUU'),
|
||||
mode: LaunchMode.inAppBrowserView,
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
return PremiumActivationView(product: id);
|
||||
}));
|
||||
},
|
||||
child: Card(
|
||||
margin: EdgeInsets.zero,
|
||||
|
@ -167,11 +167,11 @@ class PlusScreen extends StatelessWidget {
|
||||
context.watch<PremiumProvider>().scopes) ==
|
||||
PremiumFeatureLevel.cap,
|
||||
iconPath: 'assets/images/plus_tier_cap.png',
|
||||
title: 'Kupak',
|
||||
title: 'reFilc+',
|
||||
description:
|
||||
'Több személyre szabás, több fiók, egyszerű feladatfeljegyzés.',
|
||||
color: const Color(0xFF47BB00),
|
||||
url: parseTierUri(tierId: '371828'),
|
||||
color: Color.fromARGB(255, 97, 0, 187),
|
||||
id: 'refilcplus',
|
||||
price: 0.99,
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(16.0),
|
||||
@ -194,11 +194,11 @@ class PlusScreen extends StatelessWidget {
|
||||
context.watch<PremiumProvider>().scopes) ==
|
||||
PremiumFeatureLevel.ink,
|
||||
iconPath: 'assets/images/plus_tier_ink.png',
|
||||
title: 'Tinta',
|
||||
title: 'reFilc+ Gold',
|
||||
description:
|
||||
'Férj hozzá még több funkcióhoz, használj még több profilt és tedd egyszerűbbé mindennapjaid.',
|
||||
color: const Color(0xFF0061BB),
|
||||
url: parseTierUri(tierId: '371944'),
|
||||
color: Color.fromARGB(255, 187, 137, 0),
|
||||
id: 'refilcplusgold',
|
||||
price: 2.99,
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(8.0),
|
||||
@ -223,7 +223,7 @@ class PlusScreen extends StatelessWidget {
|
||||
description:
|
||||
'Férj hozzá még több funkcióhoz, használj még több profilt és tedd egyszerűbbé mindennapjaid.',
|
||||
color: const Color(0xFFFFC700),
|
||||
url: parseTierUri(tierId: '371945'),
|
||||
id: 'refilcplusgold',
|
||||
price: 4.99,
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(8.0),
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 2d396110bd98c90180a6bb52e706499a18f42df8
|
||||
Subproject commit fe892d55b3da9130b4873f9d74f349c27cd73e99
|
Loading…
x
Reference in New Issue
Block a user