finished main premium authentication shit

This commit is contained in:
Kima 2024-01-06 21:38:26 +01:00
parent de1e9fd8f4
commit af13555afb
5 changed files with 62 additions and 37 deletions

View File

@ -17,16 +17,26 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<!-- Deep Links -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with https://api.refilcapp.hu -->
<!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
<data
android:scheme="refilcapp"
android:host="refilc.hu" />
</intent-filter>
<!-- <intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!- Accepts URIs that begin with https://api.refilc.hu ->
<data
android:scheme="https"
android:host="api.refilcapp.hu"
android:pathPrefix="/v1/auth/callback" />
</intent-filter>
android:host="api.refilc.hu"
android:pathPrefix="/v2/rf-plus/auth/finish" />
</intent-filter> -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />

View File

@ -27,8 +27,11 @@ class FilcAPI {
static const ads = "$baseUrl/v1/private/ads";
static const config = "$baseUrl/v1/private/config";
static const reportApi = "$baseUrl/v1/private/crash-report";
static const premiumApi = "https://api.filcnaplo.hu/premium/activate";
// static const premiumScopesApi = "https://api.filcnaplo.hu/premium/scopes";
static const rfPlus = "$baseUrl/v2/rf-plus";
static const plusAuthLogin = "$rfPlus/auth/login";
static const plusAuthCallback = "$rfPlus/auth/callback";
static const plusActivation = "$rfPlus/activate";
static const plusScopes = "$rfPlus/scopes";
// Updates
static const repo = "refilc/naplo";

View File

@ -6,7 +6,6 @@ import 'package:filcnaplo/models/config.dart';
import 'package:filcnaplo/models/icon_pack.dart';
import 'package:filcnaplo/theme/colors/accent.dart';
import 'package:filcnaplo/theme/colors/dark_mobile.dart';
import 'package:refilc_plus/models/premium_scopes.dart';
import 'package:flutter/material.dart';
import 'package:uuid/uuid.dart';
@ -338,9 +337,9 @@ class SettingsProvider extends ChangeNotifier {
customHighlightColor: const Color(0xff222222),
customIconColor: const Color(0x00000000),
shadowEffect: true,
premiumScopes: [PremiumScopes.all],
premiumAccessToken: "igen",
premiumLogin: "igen",
premiumScopes: [],
premiumAccessToken: "",
premiumLogin: "",
lastAccountId: "",
renameSubjectsEnabled: false,
renameSubjectsItalics: false,

View File

@ -22,8 +22,8 @@ class PremiumScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final middleColor = Theme.of(context).brightness == Brightness.dark
? const Color.fromARGB(255, 20, 57, 46)
: const Color.fromARGB(255, 10, 140, 123);
? const Color.fromARGB(255, 20, 33, 57)
: const Color.fromARGB(255, 10, 55, 140);
final future = FilcAPI.getSupporters();
@ -43,7 +43,7 @@ class PremiumScreen extends StatelessWidget {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
const Color(0xff124F3D),
const Color.fromARGB(255, 65, 51, 143),
middleColor,
],
),
@ -85,25 +85,36 @@ class PremiumScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 64.0),
Image.asset("assets/images/logo.png"),
const SizedBox(height: 12.0),
const Text(
"Még több filc.",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 25.0,
color: Colors.white),
Row(
children: [
Image.asset(
"assets/icons/ic_rounded.png",
width: 69.0,
height: 69.0,
),
const SizedBox(
width: 15.0,
),
const Text(
"reFilc Premium.",
"reFilc+",
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: 35.0,
color: Colors.white),
),
],
),
const SizedBox(height: 12.0),
const Text(
"Még több reFilc, olcsóbban, mint bármi más!*",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 25.0,
color: Colors.white),
),
const SizedBox(height: 15.0),
Text(
"Támogasd a filcet, és szerezz cserébe pár kényelmes jutalmat!",
"Támogasd a QwIT** csapatát, és szerezz cserébe pár kényelmes jutalmat!",
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 20,

View File

@ -1,6 +1,8 @@
// ignore_for_file: no_leading_underscores_for_local_identifiers, use_build_context_synchronously, deprecated_member_use
import 'package:filcnaplo/api/providers/update_provider.dart';
import 'package:filcnaplo/theme/colors/accent.dart';
import 'package:filcnaplo/theme/observer.dart';
import 'package:filcnaplo_kreta_api/providers/absence_provider.dart';
import 'package:filcnaplo_kreta_api/providers/event_provider.dart';
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
@ -35,6 +37,7 @@ import 'package:filcnaplo_mobile_ui/screens/settings/modify_subject_names.dart';
import 'package:filcnaplo_mobile_ui/screens/settings/notifications_screen.dart';
import 'package:filcnaplo_mobile_ui/screens/settings/privacy_view.dart';
import 'package:filcnaplo_mobile_ui/screens/settings/settings_helper.dart';
import 'package:refilc_plus/providers/premium_provider.dart';
import 'package:refilc_plus/ui/mobile/settings/app_icon_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
@ -1130,19 +1133,18 @@ class SettingsScreenState extends State<SettingsScreen>
),
// if (Provider.of<PremiumProvider>(context, listen: false)
// .hasPremium)
// PanelButton(
// leading: const Icon(FeatherIcons.key),
// title: const Text("Remove Premium"),
// onPressed: () {
// Provider.of<PremiumProvider>(context, listen: false)
// .activate(removePremium: true);
// settings.update(
// accentColor: AccentColor.filc, store: true);
// Provider.of<ThemeModeObserver>(context,
// listen: false)
// .changeTheme(settings.theme);
// },
// ),
PanelButton(
leading: const Icon(FeatherIcons.key),
title: const Text("Remove Premium"),
onPressed: () {
Provider.of<PremiumProvider>(context, listen: false)
.activate(removePremium: true);
settings.update(
accentColor: AccentColor.filc, store: true);
Provider.of<ThemeModeObserver>(context, listen: false)
.changeTheme(settings.theme);
},
),
],
),
),