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