forked from firka/student-legacy
refilcplus things
This commit is contained in:
parent
673f02cdd0
commit
1ec226511c
@ -13,7 +13,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:refilc_mobile_ui/screens/error_screen.dart';
|
||||
import 'package:refilc_mobile_ui/screens/error_report_screen.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart' as stripe;
|
||||
// import 'package:firebase_core/firebase_core.dart';
|
||||
|
||||
// import 'firebase_options.dart';
|
||||
@ -33,10 +32,6 @@ void main() async {
|
||||
|
||||
BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask);
|
||||
|
||||
// initialize stripe key
|
||||
stripe.Stripe.publishableKey =
|
||||
'pk_test_51Oo7iUBS0FxsTGxKjGZSQqzDKWHY5ZFYM9XeI0qSdIh2w8jWy6GhHlYpT7GLTzgpl1xhE5YP4BXpA4gMZqPmgMId00cGFYFzbh';
|
||||
|
||||
// Run App
|
||||
runApp(App(
|
||||
database: startup.database,
|
||||
|
@ -77,7 +77,6 @@ dependencies:
|
||||
extension_google_sign_in_as_googleapis_auth: ^2.0.12
|
||||
maps_launcher: ^2.2.0
|
||||
google_fonts: ^6.1.0
|
||||
flutter_stripe: ^10.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_lints: ^3.0.1
|
||||
|
@ -1,8 +1,7 @@
|
||||
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/api/client.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: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';
|
||||
@ -128,49 +127,49 @@ class GithubLoginButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> initPaymentSheet(BuildContext context) async {
|
||||
try {
|
||||
// 1. create payment intent on the server
|
||||
final data = await _createPaymentSheet();
|
||||
// Future<bool> initPaymentSheet(BuildContext context) async {
|
||||
// try {
|
||||
// // 1. create payment intent on the server
|
||||
// final data = await _createPaymentSheet();
|
||||
|
||||
if (data == null) {
|
||||
throw "API error, can't create payment sheet!";
|
||||
}
|
||||
// if (data == null) {
|
||||
// throw "API error, can't create payment sheet!";
|
||||
// }
|
||||
|
||||
// 2. initialize the payment sheet
|
||||
await stripe.Stripe.instance.initPaymentSheet(
|
||||
paymentSheetParameters: stripe.SetupPaymentSheetParameters(
|
||||
// Set to true for custom flow
|
||||
customFlow: false,
|
||||
// Main params
|
||||
merchantDisplayName: 'reFilc',
|
||||
paymentIntentClientSecret: data['paymentIntent'],
|
||||
// Customer keys
|
||||
customerEphemeralKeySecret: data['ephemeralKey'],
|
||||
customerId: data['customer'],
|
||||
// Extra options
|
||||
// applePay: const stripe.PaymentSheetApplePay(
|
||||
// merchantCountryCode: 'HU',
|
||||
// ),
|
||||
googlePay: const stripe.PaymentSheetGooglePay(
|
||||
merchantCountryCode: 'HU',
|
||||
testEnv: true,
|
||||
),
|
||||
style: ThemeMode.system,
|
||||
),
|
||||
);
|
||||
return true;
|
||||
} catch (e) {
|
||||
// ignore: use_build_context_synchronously
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Error: $e')),
|
||||
);
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
// // 2. initialize the payment sheet
|
||||
// await stripe.Stripe.instance.initPaymentSheet(
|
||||
// paymentSheetParameters: stripe.SetupPaymentSheetParameters(
|
||||
// // Set to true for custom flow
|
||||
// customFlow: false,
|
||||
// // Main params
|
||||
// merchantDisplayName: 'reFilc',
|
||||
// paymentIntentClientSecret: data['paymentIntent'],
|
||||
// // Customer keys
|
||||
// customerEphemeralKeySecret: data['ephemeralKey'],
|
||||
// customerId: data['customer'],
|
||||
// // Extra options
|
||||
// // applePay: const stripe.PaymentSheetApplePay(
|
||||
// // merchantCountryCode: 'HU',
|
||||
// // ),
|
||||
// googlePay: const stripe.PaymentSheetGooglePay(
|
||||
// merchantCountryCode: 'HU',
|
||||
// testEnv: true,
|
||||
// ),
|
||||
// style: ThemeMode.system,
|
||||
// ),
|
||||
// );
|
||||
// return true;
|
||||
// } catch (e) {
|
||||
// // ignore: use_build_context_synchronously
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// SnackBar(content: Text('Error: $e')),
|
||||
// );
|
||||
// rethrow;
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<Map?> _createPaymentSheet() async {
|
||||
Map? data = await FilcAPI.createPaymentSheet("refilcplus");
|
||||
return data;
|
||||
}
|
||||
// Future<Map?> _createPaymentSheet() async {
|
||||
// Map? data = await FilcAPI.createPaymentSheet("refilcplus");
|
||||
// return data;
|
||||
// }
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
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: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';
|
||||
|
@ -173,8 +173,8 @@ class PlusPlanCard extends StatelessWidget {
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: 'Minden ',
|
||||
TextSpan(
|
||||
text: 'every'.i18n,
|
||||
),
|
||||
e[1].startsWith('cap')
|
||||
? const TextSpan(
|
||||
@ -186,9 +186,9 @@ class PlusPlanCard extends StatelessWidget {
|
||||
FontWeight.w600,
|
||||
),
|
||||
)
|
||||
: const TextSpan(
|
||||
: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
const TextSpan(
|
||||
text: 'reFilc+',
|
||||
style: TextStyle(
|
||||
color: Color(
|
||||
@ -198,9 +198,9 @@ class PlusPlanCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' és ',
|
||||
text: 'and'.i18n,
|
||||
),
|
||||
TextSpan(
|
||||
const TextSpan(
|
||||
text: 'reFilc+ Gold',
|
||||
style: TextStyle(
|
||||
color: Color(
|
||||
@ -211,7 +211,7 @@ class PlusPlanCard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const TextSpan(text: ' előny'),
|
||||
TextSpan(text: 'benefit'.i18n),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
@ -35,11 +35,11 @@ class PlusScreen extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
const Color(0xffF4F9FF).withOpacity(0.1),
|
||||
const Color(0xffF4F9FF).withOpacity(0.15),
|
||||
const Color(0xffF4F9FF).withOpacity(0.25),
|
||||
const Color(0xffF4F9FF).withOpacity(0.4),
|
||||
const Color(0xffF4F9FF).withOpacity(0.5),
|
||||
const Color(0xffF4F9FF).withOpacity(0.30),
|
||||
const Color(0xffF4F9FF).withOpacity(0.40),
|
||||
const Color(0xffF4F9FF).withOpacity(0.50),
|
||||
const Color(0xffF4F9FF).withOpacity(0.60),
|
||||
const Color(0xffF4F9FF).withOpacity(0.70),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
@ -53,8 +53,8 @@ class PlusScreen extends StatelessWidget {
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
const Color(0xffF4F9FF).withOpacity(0.0),
|
||||
const Color(0xffF4F9FF).withOpacity(0.4),
|
||||
const Color(0xffF4F9FF).withOpacity(0.6),
|
||||
const Color(0xffF4F9FF).withOpacity(0.7),
|
||||
const Color(0xffF4F9FF).withOpacity(0.8),
|
||||
const Color(0xffF4F9FF).withOpacity(0.9),
|
||||
const Color(0xffF4F9FF),
|
||||
],
|
||||
@ -174,19 +174,13 @@ class PlusScreen extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(16.0),
|
||||
bottom: Radius.circular(8.0)),
|
||||
features: const [
|
||||
['✨', 'Előzetes hozzáférés új verziókhoz'],
|
||||
['👥', '2 fiók használata egyszerre'],
|
||||
['👋', 'Egyedi üdvözlő üzenet'],
|
||||
[
|
||||
'📓',
|
||||
'Korlátlan saját jegyzet és feladat a füzet oldalon'
|
||||
],
|
||||
['1️⃣', 'Egyedi jegy ritkaságok'],
|
||||
[
|
||||
'➕',
|
||||
'Összesített átlagszámoló',
|
||||
],
|
||||
features: [
|
||||
['✨', 'rfp_1'.i18n],
|
||||
['👥', 'rfp_2'.i18n],
|
||||
['👋', 'rfp_3'.i18n],
|
||||
['📓', 'rfp_4'.i18n],
|
||||
['1️⃣', 'rfp_5'.i18n],
|
||||
['🎓', 'rfp_6'.i18n],
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
@ -205,16 +199,16 @@ class PlusScreen extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(8.0),
|
||||
bottom: Radius.circular(16.0)),
|
||||
features: const [
|
||||
['🕑', 'Órarend jegyzetek'],
|
||||
['🔤', 'Egyedi betütípusok'],
|
||||
['👥', 'Korlátlan fiók használata egyszerre'],
|
||||
['🎓', 'Összesített átlagszámoló'],
|
||||
['🟦', 'Live Activity szín'],
|
||||
['📱', 'Alkalmazás ikonjának megváltoztatása'],
|
||||
['📒', 'Fejlettebb cél kitűzés'],
|
||||
['📅', 'Naptár szinkronizálás'],
|
||||
['🖋️', 'cap_tier_benefits'],
|
||||
features: [
|
||||
['🕑', 'rfp_7'.i18n],
|
||||
['🔤', 'rfp_8'.i18n],
|
||||
['👥', 'rfp_9'.i18n],
|
||||
// ['🎓', 'Összesített átlagszámoló'],
|
||||
['📱', 'rfp_10'.i18n],
|
||||
['🟦', 'rfp_11'.i18n],
|
||||
['📒', 'rfp_12'.i18n],
|
||||
['📅', 'rfp_13'.i18n],
|
||||
const ['🖋️', 'cap_tier_benefits'],
|
||||
],
|
||||
),
|
||||
// const SizedBox(
|
||||
|
@ -28,6 +28,26 @@ extension SettingsLocalization on String {
|
||||
"eur":
|
||||
"Prices are displayed in euros, which means it's dependant on the exchange rate. 1 EUR ≈ 390 HUF",
|
||||
"active": "Active",
|
||||
// benefits
|
||||
"rfp_1": "Early access to updates",
|
||||
"rfp_2": "Use two accounts simaltaneously",
|
||||
"rfp_3": "Custom welcome message",
|
||||
"rfp_4": "Unlimited custom notes and tasks on the Notebook page",
|
||||
"rfp_5": "Custom grade rarities",
|
||||
"rfp_6": "Overall average calculator",
|
||||
"rfp_7": "Timetable notes",
|
||||
"rfp_8": "Custom font types",
|
||||
"rfp_9": "Unlimited accounts",
|
||||
"rfp_10": "Custom app icon",
|
||||
"rfp_11": "Change Live Activity color",
|
||||
"rfp_12": "Better goal planner",
|
||||
"rfp_13": "Import your timetable into your calendar app",
|
||||
"rfp_14": "",
|
||||
"rfp_15": "",
|
||||
// other
|
||||
"and": " and ",
|
||||
"every": "Every ",
|
||||
"benefit": " benefit",
|
||||
},
|
||||
"hu_hu": {
|
||||
"even_more_cheaper": "Még több reFilc, olcsóbban,\nmint bármi más!",
|
||||
@ -54,6 +74,26 @@ extension SettingsLocalization on String {
|
||||
"eur":
|
||||
"Az árak euróban vannak feltüntetve, így az árfolyam befolyásolja, hogy mennyit kell fizetned a szolgáltatásért. 1 EUR ≈ 390 Ft",
|
||||
"active": "Aktív",
|
||||
// benefits
|
||||
"rfp_1": "Előzetes hozzáférés új verziókhoz",
|
||||
"rfp_2": "2 fiók használata egyszerre",
|
||||
"rfp_3": "Egyedi üdvözlő üzenet",
|
||||
"rfp_4": "Korlátlan saját jegyzet és feladat a füzet oldalon",
|
||||
"rfp_5": "Egyedi jegy ritkaságok",
|
||||
"rfp_6": "Összesített átlagszámoló",
|
||||
"rfp_7": "Órarend jegyzetek",
|
||||
"rfp_8": "Egyedi betütípusok",
|
||||
"rfp_9": "Korlátlan fiók használata egyszerre",
|
||||
"rfp_10": "Alkalmazás ikonjának megváltoztatása",
|
||||
"rfp_11": "Live Activity szín",
|
||||
"rfp_12": "Fejlettebb cél kitűzés",
|
||||
"rfp_13": "Naptár szinkronizálás",
|
||||
"rfp_14": "",
|
||||
"rfp_15": "",
|
||||
// other
|
||||
"and": " és ",
|
||||
"every": "Minden ",
|
||||
"benefit": " előny",
|
||||
},
|
||||
"de_de": {
|
||||
"even_more_cheaper": "Mehr reFilc, günstiger\nals alles andere!",
|
||||
@ -81,6 +121,26 @@ extension SettingsLocalization on String {
|
||||
"eur":
|
||||
"Der Preis wird in Euro angegeben im Bezug zum aktuellen Wechselkurs. 1 EUR ≈ 390 HUF",
|
||||
"active": "Aktiv",
|
||||
// benefits
|
||||
"rfp_1": "Előzetes hozzáférés új verziókhoz",
|
||||
"rfp_2": "2 fiók használata egyszerre",
|
||||
"rfp_3": "Egyedi üdvözlő üzenet",
|
||||
"rfp_4": "Korlátlan saját jegyzet és feladat a füzet oldalon",
|
||||
"rfp_5": "Egyedi jegy ritkaságok",
|
||||
"rfp_6": "Összesített átlagszámoló",
|
||||
"rfp_7": "Órarend jegyzetek",
|
||||
"rfp_8": "Egyedi betütípusok",
|
||||
"rfp_9": "Korlátlan fiók használata egyszerre",
|
||||
"rfp_10": "Alkalmazás ikonjának megváltoztatása",
|
||||
"rfp_11": "Live Activity szín",
|
||||
"rfp_12": "Fejlettebb cél kitűzés",
|
||||
"rfp_13": "Naptár szinkronizálás",
|
||||
"rfp_14": "",
|
||||
"rfp_15": "",
|
||||
// other
|
||||
"and": " és ",
|
||||
"every": "Minden ",
|
||||
"benefit": " előny",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -64,7 +64,6 @@ dependencies:
|
||||
uuid: ^4.3.3
|
||||
maps_launcher: ^2.2.0
|
||||
google_fonts: ^6.1.0
|
||||
flutter_stripe: ^10.0.0
|
||||
flutter_any_logo: ^1.1.1
|
||||
custom_sliding_segmented_control: ^1.8.1
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit a356f5db6403b3ba696009777b7ce65983c926e9
|
||||
Subproject commit d3c1941c59fcd5c11aa2befefb2cb714c61b6309
|
Loading…
x
Reference in New Issue
Block a user