move some settings to extras

This commit is contained in:
BalazsManus
2025-02-15 13:36:18 +01:00
parent eb0308cbed
commit 8925b3a5f8
6 changed files with 1071 additions and 1275 deletions

View File

@@ -16,6 +16,10 @@ import 'package:refilc_plus/models/premium_scopes.dart';
import 'package:refilc_plus/providers/plus_provider.dart';
import 'package:refilc_plus/ui/mobile/plus/upsell.dart';
import 'package:refilc_plus/ui/mobile/settings/welcome_message.dart';
import 'package:refilc_kreta_api/providers/grade_provider.dart';
import 'package:refilc_mobile_ui/common/action_button.dart';
// import 'package:provider/provider.dart';
import 'submenu_screen.i18n.dart';
@@ -23,7 +27,7 @@ class MenuExtrasSettings extends StatelessWidget {
const MenuExtrasSettings({
super.key,
this.borderRadius = const BorderRadius.vertical(
top: Radius.circular(4.0), bottom: Radius.circular(4.0)),
top: Radius.circular(4.0), bottom: Radius.circular(12.0)),
});
final BorderRadius borderRadius;
@@ -181,6 +185,146 @@ class ExtrasSettingsScreenState extends State<ExtrasSettingsScreen> {
),
],
),
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
isSeparated: true,
children: [
PanelButton(
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
onPressed: () async {
if (!settingsProvider.goodStudent) {
showDialog(
context: context,
builder: (context) => WillPopScope(
onWillPop: () async => false,
child: AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0)),
title: Text("attention".i18n),
content: Text("goodstudent_disclaimer".i18n),
actions: [
ActionButton(
label: "understand".i18n,
onTap: () {
Navigator.of(context).pop();
settingsProvider.update(
goodStudent: true);
Provider.of<GradeProvider>(context,
listen: false)
.convertBySettings();
setState(() {});
})
],
),
),
);
} else {
settingsProvider.update(goodStudent: false);
Provider.of<GradeProvider>(context, listen: false)
.convertBySettings();
setState(() {});
}
},
title: Text(
"goodstudent".i18n,
style: TextStyle(
color: AppColors.of(context).text.withValues(
alpha: settingsProvider.goodStudent ? .95 : .25),
),
),
leading: Icon(
FeatherIcons.userCheck,
size: 22.0,
color: AppColors.of(context).text.withValues(
alpha: settingsProvider.goodStudent ? .95 : .25),
),
trailing: Switch(
onChanged: (v) async {
if (v) {
showDialog(
context: context,
builder: (context) => WillPopScope(
onWillPop: () async => false,
child: AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0)),
title: Text("attention".i18n),
content: Text("goodstudent_disclaimer".i18n),
actions: [
ActionButton(
label: "understand".i18n,
onTap: () {
Navigator.of(context).pop();
settingsProvider.update(
goodStudent: true);
Provider.of<GradeProvider>(context,
listen: false)
.convertBySettings();
setState(() {});
})
],
),
),
);
} else {
settingsProvider.update(goodStudent: false);
Provider.of<GradeProvider>(context, listen: false)
.convertBySettings();
setState(() {});
}
},
value: settingsProvider.goodStudent,
activeColor: Theme.of(context).colorScheme.secondary,
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(12.0),
),
),
],
),
SplittedPanel(
padding: const EdgeInsets.only(top: 9.0),
cardPadding: const EdgeInsets.all(4.0),
isSeparated: true,
children: [
PanelButton(
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
onPressed: () async {
settingsProvider.update(
presentationMode: !settingsProvider.presentationMode);
setState(() {});
},
title: Text(
"presentation".i18n,
style: TextStyle(
color: AppColors.of(context).text.withValues(
alpha:
settingsProvider.presentationMode ? .95 : .25),
),
),
leading: Icon(
FeatherIcons.tv,
size: 22.0,
color: AppColors.of(context).text.withValues(
alpha: settingsProvider.presentationMode ? .95 : .25),
),
trailing: Switch(
onChanged: (v) async {
settingsProvider.update(presentationMode: v);
setState(() {});
},
value: settingsProvider.presentationMode,
activeColor: Theme.of(context).colorScheme.secondary,
),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(12.0),
bottom: Radius.circular(12.0),
),
),
],
),
],
),
),

View File

@@ -15,7 +15,7 @@ class MenuGeneralSettings extends StatelessWidget {
const MenuGeneralSettings({
super.key,
this.borderRadius = const BorderRadius.vertical(
top: Radius.circular(4.0), bottom: Radius.circular(4.0)),
top: Radius.circular(12.0), bottom: Radius.circular(4.0)),
});
final BorderRadius borderRadius;

View File

@@ -34,6 +34,11 @@ extension SettingsLocalization on String {
"theme_share_ratelimit": "You can only share 1 theme per minute.",
// cloud sync
"cloud_sync": "Cloud Sync",
"secret": "Secret Settings",
"goodstudent": "Good student mode",
"presentation": "Presentation Mode",
"goodstudent_disclaimer":
"reFilc can not be held liable for the usage of this feature.\n\n(if your mother beats you up because you showed her fake grades, you can only blame yourself for it)",
},
"hu_hu": {
"general": "Általános",
@@ -66,6 +71,11 @@ extension SettingsLocalization on String {
"theme_share_ratelimit": "Csak 1 témát oszthatsz meg percenként.",
// cloud sync
"cloud_sync": "Felhő szinkronizálás",
"secret": "Titkos Beállítások",
"goodstudent": "Jó tanuló mód",
"presentation": "Bemutató mód",
"goodstudent_disclaimer":
"A reFilc minden felelősséget elhárít a funkció használatával kapcsolatban.\n\n(Értsd: ha az anyád megver, mert megtévesztő ábrákat mutattál neki, azért csakis magadat hibáztathatod.)",
},
"de_de": {
"general": "Allgemeine",
@@ -99,6 +109,11 @@ extension SettingsLocalization on String {
"theme_share_ratelimit": "Sie können nur 1 Thema pro Minute teilen.",
// cloud sync
"cloud_sync": "Cloud-Synchronisierung",
"secret": "Geheime Einstellungen",
"presentation": "Präsentationsmodus",
"goodstudent": "Guter Student Modus",
"goodstudent_disclaimer":
"reFilc kann nicht für die Nutzung dieser Funktion haftbar gemacht werden.\n\n(Wenn deine Mutter dich verprügelt, weil du ihr falsche Noten gezeigt hast, kannst du dir nur die Schuld dafür geben)",
},
};