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