This commit is contained in:
BalazsManus 2025-02-13 20:35:59 +01:00
parent 894b3ac5b5
commit 0cf62aea86

View File

@ -39,6 +39,7 @@ import 'package:refilc_mobile_ui/screens/settings/accounts/account_tile.dart';
import 'package:refilc_mobile_ui/screens/settings/accounts/account_view.dart'; import 'package:refilc_mobile_ui/screens/settings/accounts/account_view.dart';
// import 'package:refilc_mobile_ui/screens/settings/debug/subject_icon_gallery.dart'; // import 'package:refilc_mobile_ui/screens/settings/debug/subject_icon_gallery.dart';
// import 'package:refilc_mobile_ui/screens/settings/modify_subject_names.dart'; // import 'package:refilc_mobile_ui/screens/settings/modify_subject_names.dart';
import 'package:refilc_mobile_ui/screens/settings/notifications_screen.dart';
import 'package:refilc_mobile_ui/screens/settings/privacy_view.dart'; import 'package:refilc_mobile_ui/screens/settings/privacy_view.dart';
import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart'; import 'package:refilc_mobile_ui/screens/settings/settings_helper.dart';
import 'package:refilc_mobile_ui/screens/settings/submenu/code_scanner.dart'; import 'package:refilc_mobile_ui/screens/settings/submenu/code_scanner.dart';
@ -152,7 +153,7 @@ class SettingsScreenState extends State<SettingsScreen>
// check if refresh token is still valid // check if refresh token is still valid
String? err = await refresh(); String? err = await refresh();
if (err != null && err != "success") { if (err != null) {
showDialog( showDialog(
context: context, context: context,
builder: (_) => AlertDialog( builder: (_) => AlertDialog(
@ -325,7 +326,7 @@ class SettingsScreenState extends State<SettingsScreen>
// onPressed: () => // onPressed: () =>
// _showBottomSheet(user.getUser(user.id ?? "")), // _showBottomSheet(user.getUser(user.id ?? "")),
// icon: Icon(FeatherIcons.moreVertical, // icon: Icon(FeatherIcons.moreVertical,
// color: AppColors.of(context).text.withValues(alpha: 0.8)), // color: AppColors.of(context).text.withOpacity(0.8)),
// ), // ),
// const SizedBox( // const SizedBox(
// width: 5, // width: 5,
@ -344,7 +345,7 @@ class SettingsScreenState extends State<SettingsScreen>
// ), // ),
// // _showBottomSheet(user.getUser(user.id ?? "")), // // _showBottomSheet(user.getUser(user.id ?? "")),
// icon: Icon(FeatherIcons.fileText, // icon: Icon(FeatherIcons.fileText,
// color: AppColors.of(context).text.withValues(alpha: 0.8)), // color: AppColors.of(context).text.withOpacity(0.8)),
// ), // ),
], ],
), ),
@ -357,9 +358,7 @@ class SettingsScreenState extends State<SettingsScreen>
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
icon: Icon(FeatherIcons.x, icon: Icon(FeatherIcons.x,
color: AppColors.of(context) color: AppColors.of(context).text.withOpacity(0.8)),
.text
.withValues(alpha: 0.8)),
), ),
const SizedBox( const SizedBox(
width: 5.0, width: 5.0,
@ -425,7 +424,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.info, FeatherIcons.info,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0), bottom: Radius.circular(4.0)), top: Radius.circular(12.0), bottom: Radius.circular(4.0)),
@ -444,7 +443,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.grid, FeatherIcons.grid,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(4.0), bottom: Radius.circular(4.0)), top: Radius.circular(4.0), bottom: Radius.circular(4.0)),
@ -457,7 +456,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.edit3, FeatherIcons.edit3,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(4.0), bottom: Radius.circular(4.0)), top: Radius.circular(4.0), bottom: Radius.circular(4.0)),
@ -477,7 +476,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.users, FeatherIcons.users,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
borderRadius: const BorderRadius.vertical( borderRadius: const BorderRadius.vertical(
top: Radius.circular(4.0), bottom: Radius.circular(4.0)), top: Radius.circular(4.0), bottom: Radius.circular(4.0)),
@ -544,7 +543,7 @@ class SettingsScreenState extends State<SettingsScreen>
// width: 75.0, // width: 75.0,
// decoration: BoxDecoration( // decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12.0), // borderRadius: BorderRadius.circular(12.0),
// color: AppColors.of(context).text.withValues(alpha: .25), // color: AppColors.of(context).text.withOpacity(.25),
// ), // ),
// ), // ),
// ), // ),
@ -782,18 +781,14 @@ class SettingsScreenState extends State<SettingsScreen>
title: Text( title: Text(
"grade_streak".i18n, "grade_streak".i18n,
style: TextStyle( style: TextStyle(
color: AppColors.of(context) color: AppColors.of(context).text.withOpacity(0.95),
.text
.withValues(alpha: 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) color: AppColors.of(context).text.withOpacity(0.75),
.text
.withValues(alpha: 0.75),
), ),
), ),
leading: Image.asset( leading: Image.asset(
@ -807,9 +802,7 @@ class SettingsScreenState extends State<SettingsScreen>
trailing: Text( trailing: Text(
"${user.gradeStreak}", "${user.gradeStreak}",
style: TextStyle( style: TextStyle(
color: AppColors.of(context) color: AppColors.of(context).text.withOpacity(0.95),
.text
.withValues(alpha: 0.95),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 18.0, fontSize: 18.0,
), ),
@ -849,7 +842,7 @@ class SettingsScreenState extends State<SettingsScreen>
// leading: Icon( // leading: Icon(
// FeatherIcons.link, // FeatherIcons.link,
// size: 22.0, // size: 22.0,
// color: AppColors.of(context).text.withValues(alpha: 0.95), // color: AppColors.of(context).text.withOpacity(0.95),
// ), // ),
// trailing: GestureDetector( // trailing: GestureDetector(
// onTap: () { // onTap: () {
@ -876,7 +869,7 @@ class SettingsScreenState extends State<SettingsScreen>
// child: Icon( // child: Icon(
// FeatherIcons.helpCircle, // FeatherIcons.helpCircle,
// size: 20.0, // size: 20.0,
// color: AppColors.of(context).text.withValues(alpha: 0.95), // color: AppColors.of(context).text.withOpacity(0.95),
// ), // ),
// ), // ),
// borderRadius: const BorderRadius.vertical( // borderRadius: const BorderRadius.vertical(
@ -937,9 +930,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.sun, FeatherIcons.sun,
size: 22.0, size: 22.0,
color: AppColors.of(context) color: AppColors.of(context).text.withOpacity(0.95),
.text
.withValues(alpha: 0.95),
), ),
trailing: Text( trailing: Text(
themeModeText, themeModeText,
@ -954,18 +945,18 @@ class SettingsScreenState extends State<SettingsScreen>
), ),
// notifications // notifications
// const SplittedPanel( const SplittedPanel(
// padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
// cardPadding: EdgeInsets.all(4.0), cardPadding: EdgeInsets.all(4.0),
// children: [ children: [
// MenuNotifications( MenuNotifications(
// borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
// top: Radius.circular(12.0), top: Radius.circular(12.0),
// bottom: Radius.circular(12.0), bottom: Radius.circular(12.0),
// ), ),
// ), ),
// ], ],
// ), ),
// extras // extras
const SplittedPanel( const SplittedPanel(
@ -1032,7 +1023,7 @@ 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.withValues(alpha: 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(
@ -1049,7 +1040,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.mail, FeatherIcons.mail,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: Text("news".i18n), title: Text("news".i18n),
onPressed: () => _openNews(context), onPressed: () => _openNews(context),
@ -1062,7 +1053,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.map, FeatherIcons.map,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: Text("stickermap".i18n), title: Text("stickermap".i18n),
onPressed: () => launchUrl( onPressed: () => launchUrl(
@ -1113,7 +1104,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.lock, FeatherIcons.lock,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: Text("privacy".i18n), title: Text("privacy".i18n),
// onPressed: () => launchUrl( // onPressed: () => launchUrl(
@ -1129,7 +1120,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.atSign, FeatherIcons.atSign,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: const Text("Discord"), title: const Text("Discord"),
onPressed: () => launchUrl(Uri.parse("https://dc.refilc.hu"), onPressed: () => launchUrl(Uri.parse("https://dc.refilc.hu"),
@ -1143,7 +1134,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.globe, FeatherIcons.globe,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: const Text("www.refilc.hu"), title: const Text("www.refilc.hu"),
onPressed: () => launchUrl(Uri.parse("https://www.refilc.hu"), onPressed: () => launchUrl(Uri.parse("https://www.refilc.hu"),
@ -1157,7 +1148,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.github, FeatherIcons.github,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: const Text("Github"), title: const Text("Github"),
onPressed: () => launchUrl( onPressed: () => launchUrl(
@ -1172,7 +1163,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.award, FeatherIcons.award,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: 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),
@ -1193,7 +1184,7 @@ class SettingsScreenState extends State<SettingsScreen>
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withValues(alpha: 0.2), color: Colors.black.withOpacity(0.2),
blurRadius: 40.0, blurRadius: 40.0,
) )
], ],
@ -1213,23 +1204,24 @@ 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.withValues(alpha: 0.95) ? AppColors.of(context).text.withOpacity(0.95)
: AppColors.of(context).text.withValues(alpha: .25), : 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.withValues( color: AppColors.of(context).text.withOpacity(
alpha: 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).text.withValues( color: AppColors.of(context)
alpha: settings.analyticsEnabled ? .5 : .2), .text
.withOpacity(settings.analyticsEnabled ? .5 : .2),
), ),
), ),
onChanged: (v) { onChanged: (v) {
@ -1252,7 +1244,7 @@ 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.withValues(alpha: 0.95), color: AppColors.of(context).text.withOpacity(0.95),
), ),
title: Text("feedback".i18n), title: Text("feedback".i18n),
onPressed: () => { onPressed: () => {
@ -1328,7 +1320,7 @@ 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.withValues(alpha: .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(
@ -1346,7 +1338,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.copy, FeatherIcons.copy,
size: 22.0, size: 22.0,
color: AppColors.of(context).text.withValues(alpha: .95), color: AppColors.of(context).text.withOpacity(.95),
), ),
title: Text("copy_jwt".i18n), title: Text("copy_jwt".i18n),
onPressed: () => Clipboard.setData(ClipboardData( onPressed: () => Clipboard.setData(ClipboardData(
@ -1363,8 +1355,7 @@ class SettingsScreenState extends State<SettingsScreen>
leading: Icon( leading: Icon(
FeatherIcons.key, FeatherIcons.key,
size: 22.0, size: 22.0,
color: color: AppColors.of(context).text.withOpacity(.95),
AppColors.of(context).text.withValues(alpha: .95),
), ),
title: const Text("Remove Premium"), title: const Text("Remove Premium"),
onPressed: () { onPressed: () {
@ -1396,8 +1387,8 @@ class SettingsScreenState extends State<SettingsScreen>
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.of(context) color: AppColors.of(context)
.text .text
.withValues(alpha: 0.65)), .withOpacity(0.65)),
child: Text("v${release.data!['version']}"), child: Text("v${release.data!['version']}, módosítva a Filc csapat által"),
); );
} else { } else {
String envAppVer = const String.fromEnvironment( String envAppVer = const String.fromEnvironment(
@ -1411,7 +1402,7 @@ class SettingsScreenState extends State<SettingsScreen>
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.of(context) color: AppColors.of(context)
.text .text
.withValues(alpha: 0.65)), .withOpacity(0.65)),
child: Text("v$envAppVer"), child: Text("v$envAppVer"),
); );
} }
@ -1461,4 +1452,4 @@ class SettingsScreenState extends State<SettingsScreen>
void openSubMenu(BuildContext context, StatefulWidget screen) => void openSubMenu(BuildContext context, StatefulWidget screen) =>
Navigator.of(context) Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => screen)); .push(CupertinoPageRoute(builder: (context) => screen));
} }