remove cloud + remove if true

This commit is contained in:
BalazsManus 2025-02-14 16:52:44 +01:00
parent 0dc921c603
commit 80008d8f00

View File

@ -92,7 +92,7 @@ class SettingsScreen extends StatefulWidget {
class SettingsScreenState extends State<SettingsScreen> class SettingsScreenState extends State<SettingsScreen>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
int devmodeCountdown = 5; int devmodeCountdown = 5;
bool __ss = true; // secret settings bool __ss = false; // secret settings
Future<Map>? futureRelease; Future<Map>? futureRelease;
@ -467,13 +467,6 @@ class SettingsScreenState extends State<SettingsScreen>
top: Radius.circular(12.0), top: Radius.circular(12.0),
bottom: Radius.circular(4.0)), bottom: Radius.circular(4.0)),
), ),
// cloud-sync
const MenuCloudSyncSettings(
borderRadius: BorderRadius.vertical(
top: Radius.circular(4.0),
bottom: Radius.circular(4.0),
),
),
// open dcs (digital collaboration space) // open dcs (digital collaboration space)
PanelButton( PanelButton(
onPressed: () => _openDKT(user.user!), onPressed: () => _openDKT(user.user!),
@ -677,7 +670,10 @@ class SettingsScreenState extends State<SettingsScreen>
updateProvider.releases.first.tag, updateProvider.releases.first.tag,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.secondary, color: Theme
.of(context)
.colorScheme
.secondary,
), ),
), ),
), ),
@ -728,7 +724,8 @@ class SettingsScreenState extends State<SettingsScreen>
if (v) { if (v) {
showDialog( showDialog(
context: context, context: context,
builder: (context) => WillPopScope( builder: (context) =>
WillPopScope(
onWillPop: () async => false, onWillPop: () async => false,
child: AlertDialog( child: AlertDialog(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -742,8 +739,10 @@ class SettingsScreenState extends State<SettingsScreen>
label: "understand".i18n, label: "understand".i18n,
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
settings.update(goodStudent: v); settings.update(
Provider.of<GradeProvider>(context, goodStudent: v);
Provider.of<GradeProvider>(
context,
listen: false) listen: false)
.convertBySettings(); .convertBySettings();
}) })
@ -753,12 +752,16 @@ class SettingsScreenState extends State<SettingsScreen>
); );
} else { } else {
settings.update(goodStudent: v); settings.update(goodStudent: v);
Provider.of<GradeProvider>(context, listen: false) Provider.of<GradeProvider>(
context, listen: false)
.convertBySettings(); .convertBySettings();
} }
}, },
value: settings.goodStudent, value: settings.goodStudent,
activeColor: Theme.of(context).colorScheme.secondary, activeColor: Theme
.of(context)
.colorScheme
.secondary,
), ),
), ),
], ],
@ -781,7 +784,10 @@ class SettingsScreenState extends State<SettingsScreen>
onChanged: (v) => onChanged: (v) =>
settings.update(presentationMode: v), settings.update(presentationMode: v),
value: settings.presentationMode, value: settings.presentationMode,
activeColor: Theme.of(context).colorScheme.secondary, activeColor: Theme
.of(context)
.colorScheme
.secondary,
), ),
), ),
@ -845,14 +851,20 @@ class SettingsScreenState extends State<SettingsScreen>
title: Text( title: Text(
"grade_streak".i18n, "grade_streak".i18n,
style: TextStyle( style: TextStyle(
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
subtitle: Text( subtitle: Text(
"grade_streak_subtitle".i18n, "grade_streak_subtitle".i18n,
style: TextStyle( style: TextStyle(
color: AppColors.of(context).text.withOpacity(0.75), color: AppColors
.of(context)
.text
.withOpacity(0.75),
), ),
), ),
leading: Image.asset( leading: Image.asset(
@ -866,7 +878,10 @@ class SettingsScreenState extends State<SettingsScreen>
trailing: Text( trailing: Text(
"${user.gradeStreak}", "${user.gradeStreak}",
style: TextStyle( style: TextStyle(
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 18.0, fontSize: 18.0,
), ),
@ -994,7 +1009,10 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.sun, FeatherIcons.sun,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
trailing: Text( trailing: Text(
themeModeText, themeModeText,
@ -1087,10 +1105,14 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
Icons.qr_code, Icons.qr_code,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: Text("qr_scanner".i18n), title: Text("qr_scanner".i18n),
onPressed: () => Navigator.of(context).push( onPressed: () =>
Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const CodeScannerScreen(), builder: (context) => const CodeScannerScreen(),
), ),
@ -1104,7 +1126,10 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.mail, FeatherIcons.mail,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: Text("news".i18n), title: Text("news".i18n),
onPressed: () => _openNews(context), onPressed: () => _openNews(context),
@ -1117,10 +1142,14 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.map, FeatherIcons.map,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: Text("stickermap".i18n), title: Text("stickermap".i18n),
onPressed: () => launchUrl( onPressed: () =>
launchUrl(
Uri.parse("https://map.qwit.cloud"), Uri.parse("https://map.qwit.cloud"),
mode: LaunchMode.inAppBrowserView, mode: LaunchMode.inAppBrowserView,
), ),
@ -1168,7 +1197,10 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.lock, FeatherIcons.lock,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: Text("privacy".i18n), title: Text("privacy".i18n),
onPressed: () => _openPrivacy(context), onPressed: () => _openPrivacy(context),
@ -1181,10 +1213,14 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.atSign, FeatherIcons.atSign,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: const Text("Discord"), title: const Text("Discord"),
onPressed: () => launchUrl(Uri.parse("https://discord.gg/6DvjyPAw2T"), onPressed: () =>
launchUrl(Uri.parse("https://discord.gg/6DvjyPAw2T"),
mode: LaunchMode.externalApplication), mode: LaunchMode.externalApplication),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(4.0), top: Radius.circular(4.0),
@ -1209,11 +1245,16 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.github, FeatherIcons.github,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: const Text("Gitea"), title: const Text("Gitea"),
onPressed: () => launchUrl( onPressed: () =>
Uri.parse("https://git.qwit.cloud/refilc/student-legacy"), launchUrl(
Uri.parse(
"https://git.qwit.cloud/refilc/student-legacy"),
mode: LaunchMode.externalApplication), mode: LaunchMode.externalApplication),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(4.0), top: Radius.circular(4.0),
@ -1224,7 +1265,10 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.award, FeatherIcons.award,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: Text("licenses".i18n), title: Text("licenses".i18n),
onPressed: () => showLicensePage(context: context), onPressed: () => showLicensePage(context: context),
@ -1239,9 +1283,14 @@ class SettingsScreenState extends State<SettingsScreen>
margin: const EdgeInsets.all(10.0), margin: const EdgeInsets.all(10.0),
textStyle: TextStyle( textStyle: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.of(context).text), color: AppColors
.of(context)
.text),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface, color: Theme
.of(context)
.colorScheme
.surface,
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -1265,24 +1314,35 @@ class SettingsScreenState extends State<SettingsScreen>
FeatherIcons.barChart2, FeatherIcons.barChart2,
size: 22.0, size: 22.0,
color: settings.analyticsEnabled color: settings.analyticsEnabled
? AppColors.of(context).text.withOpacity(0.95) ? AppColors
: AppColors.of(context).text.withOpacity(.25), .of(context)
.text
.withOpacity(0.95)
: AppColors
.of(context)
.text
.withOpacity(.25),
), ),
title: Text( title: Text(
"Analytics".i18n, "Analytics".i18n,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 16.0, fontSize: 16.0,
color: AppColors.of(context).text.withOpacity( color: AppColors
.of(context)
.text
.withOpacity(
settings.analyticsEnabled ? 1.0 : .5), settings.analyticsEnabled ? 1.0 : .5),
), ),
), ),
subtitle: Text( subtitle: Text(
"Anonymous Usage Analytics".i18n, "Anonymous Usage Analytics".i18n,
style: TextStyle( style: TextStyle(
color: AppColors.of(context) color: AppColors
.of(context)
.text .text
.withOpacity(settings.analyticsEnabled ? .5 : .2), .withOpacity(
settings.analyticsEnabled ? .5 : .2),
), ),
), ),
onChanged: (v) { onChanged: (v) {
@ -1297,7 +1357,10 @@ class SettingsScreenState extends State<SettingsScreen>
settings.update(analyticsEnabled: v); settings.update(analyticsEnabled: v);
}, },
value: settings.analyticsEnabled, value: settings.analyticsEnabled,
activeColor: Theme.of(context).colorScheme.secondary, activeColor: Theme
.of(context)
.colorScheme
.secondary,
), ),
), ),
), ),
@ -1305,10 +1368,14 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
Icons.feedback_outlined, Icons.feedback_outlined,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(0.95), color: AppColors
.of(context)
.text
.withOpacity(0.95),
), ),
title: Text("feedback".i18n), title: Text("feedback".i18n),
onPressed: () => { onPressed: () =>
{
Shake.setScreenshotIncluded(false), Shake.setScreenshotIncluded(false),
Shake.show(ShakeScreen.newTicket), Shake.show(ShakeScreen.newTicket),
Shake.setScreenshotIncluded(true), Shake.setScreenshotIncluded(true),
@ -1329,7 +1396,8 @@ class SettingsScreenState extends State<SettingsScreen>
PanelButton( PanelButton(
title: const Text('loginToGoogle'), title: const Text('loginToGoogle'),
onPressed: () async { onPressed: () async {
ThirdPartyProvider tpp = Provider.of<ThirdPartyProvider>( ThirdPartyProvider tpp = Provider.of<
ThirdPartyProvider>(
context, context,
listen: false); listen: false);
@ -1352,7 +1420,7 @@ class SettingsScreenState extends State<SettingsScreen>
], ],
), ),
// developer options // developer options
if (true) if (settings.developerMode)
SplittedPanel( SplittedPanel(
title: Text("devsettings".i18n), title: Text("devsettings".i18n),
cardPadding: const EdgeInsets.all(4.0), cardPadding: const EdgeInsets.all(4.0),
@ -1367,10 +1435,15 @@ class SettingsScreenState extends State<SettingsScreen>
top: Radius.circular(12.0), top: Radius.circular(12.0),
bottom: Radius.circular(4.0))), bottom: Radius.circular(4.0))),
title: Text("devmode".i18n, title: Text("devmode".i18n,
style: const TextStyle(fontWeight: FontWeight.w500)), style: const TextStyle(
onChanged: (v) => settings.update(developerMode: false), fontWeight: FontWeight.w500)),
onChanged: (v) =>
settings.update(developerMode: false),
value: settings.developerMode, value: settings.developerMode,
activeColor: Theme.of(context).colorScheme.secondary, activeColor: Theme
.of(context)
.colorScheme
.secondary,
), ),
), ),
PanelButton( PanelButton(
@ -1381,17 +1454,22 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
Icons.tune_outlined, Icons.tune_outlined,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(.95), color: AppColors
.of(context)
.text
.withOpacity(.95),
), ),
title: Text("exp_settings".i18n), title: Text("exp_settings".i18n),
onPressed: () => Clipboard.setData(ClipboardData( onPressed: () =>
Clipboard.setData(ClipboardData(
text: json.encode(settings.toMap()), text: json.encode(settings.toMap()),
)), )),
), ),
PanelButton( PanelButton(
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: const Radius.circular(4.0), top: const Radius.circular(4.0),
bottom: Provider.of<PlusProvider>(context, listen: false) bottom: Provider
.of<PlusProvider>(context, listen: false)
.hasPremium .hasPremium
? const Radius.circular(4.0) ? const Radius.circular(4.0)
: const Radius.circular(12.0), : const Radius.circular(12.0),
@ -1399,14 +1477,20 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.copy, FeatherIcons.copy,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(.95), color: AppColors
.of(context)
.text
.withOpacity(.95),
), ),
title: Text("copy_jwt".i18n), title: Text("copy_jwt".i18n),
onPressed: () => Clipboard.setData(ClipboardData( onPressed: () =>
text: Provider.of<KretaClient>(context, listen: false) Clipboard.setData(ClipboardData(
text: Provider
.of<KretaClient>(context, listen: false)
.accessToken!)), .accessToken!)),
), ),
if (Provider.of<PlusProvider>(context, listen: false) if (Provider
.of<PlusProvider>(context, listen: false)
.hasPremium) .hasPremium)
PanelButton( PanelButton(
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
@ -1416,7 +1500,10 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.key, FeatherIcons.key,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withOpacity(.95), color: AppColors
.of(context)
.text
.withOpacity(.95),
), ),
title: const Text("Remove Premium"), title: const Text("Remove Premium"),
onPressed: () { onPressed: () {
@ -1424,7 +1511,8 @@ class SettingsScreenState extends State<SettingsScreen>
.activate(removePremium: true); .activate(removePremium: true);
settings.update( settings.update(
accentColor: AccentColor.filc, store: true); accentColor: AccentColor.filc, store: true);
Provider.of<ThemeModeObserver>(context, listen: false) Provider.of<ThemeModeObserver>(
context, listen: false)
.changeTheme(settings.theme); .changeTheme(settings.theme);
}, },
), ),
@ -1441,14 +1529,23 @@ class SettingsScreenState extends State<SettingsScreen>
builder: (context, release) { builder: (context, release) {
String versionText; String versionText;
if (release.hasData && release.data != null) { if (release.hasData && release.data != null) {
versionText = "v${release.data!['version']}, modosítva a Filc csapat által"; versionText = "v${release
.data!['version']}, modosítva a Filc csapat által";
} else { } else {
versionText = "reFilc, modosítva a Filc csapat által"; versionText =
"reFilc, modosítva a Filc csapat által";
} }
return DefaultTextStyle( return DefaultTextStyle(
style: Theme.of(context).textTheme.titleMedium!.copyWith( style: Theme
.of(context)
.textTheme
.titleMedium!
.copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.of(context).text.withOpacity(0.65)), color: AppColors
.of(context)
.text
.withOpacity(0.65)),
child: Text(versionText), child: Text(versionText),
); );
}, },