finished refilc+ purchase page
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:filcnaplo/icons/filc_icons.dart';
|
||||
import 'package:filcnaplo_mobile_ui/premium/premium_screen.dart';
|
||||
import 'package:filcnaplo_mobile_ui/premium/plus_screen.dart';
|
||||
import 'package:refilc_plus/models/premium_scopes.dart';
|
||||
import 'package:refilc_plus/providers/premium_provider.dart';
|
||||
import 'package:refilc_plus/ui/mobile/premium/upsell.dart';
|
||||
@@ -85,7 +85,7 @@ class ActiveSponsorCard extends StatelessWidget {
|
||||
onTap: () {
|
||||
Navigator.of(context, rootNavigator: true)
|
||||
.push(MaterialPageRoute(builder: (context) {
|
||||
return const PremiumScreen();
|
||||
return const PlusScreen();
|
||||
}));
|
||||
},
|
||||
child: Padding(
|
||||
|
||||
113
filcnaplo_mobile_ui/lib/premium/components/github_button.dart
Normal file
113
filcnaplo_mobile_ui/lib/premium/components/github_button.dart
Normal file
@@ -0,0 +1,113 @@
|
||||
import 'package:filcnaplo/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';
|
||||
|
||||
class GithubLoginButton extends StatelessWidget {
|
||||
const GithubLoginButton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final premium = Provider.of<PremiumProvider>(context);
|
||||
|
||||
return Card(
|
||||
margin: EdgeInsets.zero,
|
||||
elevation: 0,
|
||||
color: const Color(0xFFC1CBDF),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(14.0),
|
||||
onTap: () {
|
||||
if (premium.hasPremium) {
|
||||
premium.auth.refreshAuth(removePremium: true);
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
"reFilc+ támogatás deaktiválva!",
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0),
|
||||
),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
));
|
||||
return;
|
||||
}
|
||||
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
|
||||
return const PremiumActivationView();
|
||||
}));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/btn_github.svg",
|
||||
height: 28.0,
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Transform.translate(
|
||||
offset: const Offset(3.5, 4.6),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFC1CBDF),
|
||||
// color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const SizedBox(
|
||||
height: 10.0,
|
||||
width: 10.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Transform.translate(
|
||||
offset: const Offset(2.0, 2.0),
|
||||
child: Icon(
|
||||
premium.hasPremium
|
||||
? FeatherIcons.minusCircle
|
||||
: FeatherIcons.plusCircle,
|
||||
color: const Color(0xFF243F76),
|
||||
size: 14.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 18.0,
|
||||
),
|
||||
Text(
|
||||
premium.hasPremium
|
||||
? "Github szétkapcsolása"
|
||||
: "Fiók összekötése Github-al",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 18,
|
||||
color: Color(0xFF243F76),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 4.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,154 +1,223 @@
|
||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class PremiumPlanCard extends StatelessWidget {
|
||||
const PremiumPlanCard({
|
||||
class PlusPlanCard extends StatelessWidget {
|
||||
const PlusPlanCard({
|
||||
super.key,
|
||||
this.icon,
|
||||
this.title,
|
||||
this.description,
|
||||
required this.iconPath,
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.color,
|
||||
this.price = 0,
|
||||
this.url,
|
||||
this.gradient,
|
||||
this.active = false,
|
||||
this.borderRadius,
|
||||
this.features = const [],
|
||||
});
|
||||
|
||||
final Widget? icon;
|
||||
final Widget? title;
|
||||
final int price;
|
||||
final Widget? description;
|
||||
final String? url;
|
||||
final Gradient? gradient;
|
||||
final String iconPath;
|
||||
final String title;
|
||||
final String description;
|
||||
final Color color;
|
||||
final double price;
|
||||
final Uri? url;
|
||||
final bool active;
|
||||
final BorderRadiusGeometry? borderRadius;
|
||||
final List<List<String>> features;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
margin: EdgeInsets.zero,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
|
||||
child: InkWell(
|
||||
customBorder:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
|
||||
onTap: () {
|
||||
if (url != null) {
|
||||
launchUrl(
|
||||
Uri.parse(url!),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
}
|
||||
},
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (url != null) {
|
||||
launchUrl(
|
||||
url!,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Card(
|
||||
margin: EdgeInsets.zero,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: borderRadius!,
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
surfaceTintColor: Theme.of(context).colorScheme.background,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
padding: const EdgeInsets.only(
|
||||
top: 18.0, bottom: 16.0, left: 22.0, right: 18.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if (!active)
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
IconTheme(
|
||||
data: Theme.of(context)
|
||||
.iconTheme
|
||||
.copyWith(size: 42.0),
|
||||
child: icon!,
|
||||
),
|
||||
const SizedBox(height: 12.0),
|
||||
],
|
||||
DefaultTextStyle(
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.displaySmall!
|
||||
.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0),
|
||||
child: title!,
|
||||
),
|
||||
],
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
iconPath,
|
||||
width: 25.0,
|
||||
height: 25.0,
|
||||
),
|
||||
)
|
||||
else
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: gradient,
|
||||
borderRadius: BorderRadius.circular(99.0),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(99.0),
|
||||
const SizedBox(
|
||||
width: 16.0,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 22.0,
|
||||
color: color,
|
||||
fontWeight: FontWeight.w600,
|
||||
height: 1.2,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
gradient: active
|
||||
? const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color.fromARGB(255, 196, 213, 253),
|
||||
Color.fromARGB(255, 227, 235, 250),
|
||||
Color.fromARGB(255, 214, 226, 250),
|
||||
],
|
||||
)
|
||||
: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFFEFF4FE),
|
||||
Color(0xFFEFF4FE),
|
||||
],
|
||||
),
|
||||
margin: const EdgeInsets.all(4.0),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 12.0),
|
||||
child: const Text(
|
||||
"Aktív",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
color: const Color(0xFFEFF4FE),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0, vertical: 0.0),
|
||||
child: Text(
|
||||
active
|
||||
? 'Aktív'
|
||||
: '${price.toStringAsFixed(2).replaceAll('.', ',')} €',
|
||||
style: const TextStyle(
|
||||
fontSize: 16.6,
|
||||
color: Color(0xFF243F76),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(children: [
|
||||
TextSpan(text: "\$$price"),
|
||||
TextSpan(
|
||||
text: " / hó",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium!
|
||||
.color!
|
||||
.withOpacity(.7)),
|
||||
),
|
||||
]),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 24.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (active) ...[
|
||||
const SizedBox(height: 18.0),
|
||||
Row(
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
IconTheme(
|
||||
data: Theme.of(context).iconTheme.copyWith(
|
||||
size: 24.0, color: AppColors.of(context).text),
|
||||
child: icon!,
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 12.0),
|
||||
DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.displaySmall!.copyWith(
|
||||
fontWeight: FontWeight.bold, fontSize: 25.0),
|
||||
child: title!,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 6.0),
|
||||
if (description != null)
|
||||
DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium!
|
||||
.color!
|
||||
.withOpacity(.8),
|
||||
fontSize: 18),
|
||||
child: description!,
|
||||
const SizedBox(
|
||||
height: 12.0,
|
||||
),
|
||||
Text(
|
||||
description,
|
||||
style: TextStyle(
|
||||
color: const Color(0xFF011234).withOpacity(0.6),
|
||||
fontSize: 13.69,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 14.20,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: features
|
||||
.map((e) => Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 22.22,
|
||||
child: Text(
|
||||
e[0],
|
||||
style: const TextStyle(fontSize: 18.0),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 14.0,
|
||||
),
|
||||
Expanded(
|
||||
child: e[1].endsWith('tier_benefits')
|
||||
? Text.rich(
|
||||
style: const TextStyle(
|
||||
height: 1.2,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF011234),
|
||||
fontSize: 13.69,
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: 'Minden ',
|
||||
),
|
||||
e[1].startsWith('cap')
|
||||
? const TextSpan(
|
||||
text: 'Kupak',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Color(0xFF47BB00),
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
)
|
||||
: const TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'Kupak',
|
||||
style: TextStyle(
|
||||
color: Color(
|
||||
0xFF47BB00),
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' és ',
|
||||
),
|
||||
TextSpan(
|
||||
text: 'Tinta',
|
||||
style: TextStyle(
|
||||
color: Color(
|
||||
0xFF0061BB),
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const TextSpan(text: ' előny'),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
e[1],
|
||||
maxLines: 2,
|
||||
style: const TextStyle(
|
||||
height: 1.2,
|
||||
color: Color(0xFF011234),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 13.69,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user