forked from firka/student-legacy
v5 settings almost finished (first half)
This commit is contained in:
parent
bf81680b56
commit
1d92a5336e
@ -7,6 +7,7 @@ import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/absence/absence_viewable.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/absence_group/absence_group_tile.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/cretification/certification_card.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/grade/new_grades.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:animated_list_plus/animated_list_plus.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/lesson/changed_lesson_tile.dart';
|
||||
@ -150,9 +151,11 @@ List<Widget> sortDateWidgets(
|
||||
index,
|
||||
len: elements.length,
|
||||
isAfterSeparated: index > 0 &&
|
||||
(elements[index - 1].widget is CertificationCard),
|
||||
(elements[index - 1].widget is CertificationCard ||
|
||||
elements[index - 1].widget is NewGradesSurprise),
|
||||
isBeforeSeparated: (index < elements.length - 1) &&
|
||||
(elements[index + 1].widget is CertificationCard),
|
||||
(elements[index + 1].widget is CertificationCard ||
|
||||
elements[index + 1].widget is NewGradesSurprise),
|
||||
),
|
||||
items: elements,
|
||||
),
|
||||
|
@ -26,6 +26,7 @@ import 'package:filcnaplo_kreta_api/providers/message_provider.dart';
|
||||
import 'package:filcnaplo_kreta_api/providers/note_provider.dart';
|
||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/cretification/certification_card.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/grade/new_grades.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/widgets/note/note_viewable.dart';
|
||||
import 'package:refilc_plus/providers/premium_provider.dart';
|
||||
import 'package:refilc_plus/ui/mobile/premium/premium_inline.dart';
|
||||
@ -213,7 +214,7 @@ Widget filterItemBuilder(
|
||||
child: item,
|
||||
);
|
||||
|
||||
bool separated = item is CertificationCard;
|
||||
bool separated = item is CertificationCard || item is NewGradesSurprise;
|
||||
|
||||
return item is Panel
|
||||
// Re-add & animate shadow
|
||||
|
@ -22,7 +22,7 @@ class NewGradesSurprise extends StatelessWidget {
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4.0),
|
||||
padding: const EdgeInsets.only(left: 4.0, right: 4.0, top: 1.0),
|
||||
child: ListTile(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
|
@ -92,6 +92,10 @@ extension SettingsLocalization on String {
|
||||
"paint_id": "Paint ID...",
|
||||
"set_as_current": "Set as current",
|
||||
"share_subj_theme": "Share Theme",
|
||||
"no_name": "Untitled Paint",
|
||||
"current_paint": "Current Paint",
|
||||
"rename_subjects": "Rename Subjects",
|
||||
"rename_teachers": "Rename Teachers",
|
||||
},
|
||||
"hu_hu": {
|
||||
"personal_details": "Személyes információk",
|
||||
@ -182,6 +186,10 @@ extension SettingsLocalization on String {
|
||||
"paint_id": "Téma azonosító...",
|
||||
"set_as_current": "Beállítás jelenleginek",
|
||||
"share_subj_theme": "Téma Megosztás",
|
||||
"no_name": "Névtelen téma",
|
||||
"current_paint": "Jelenlegi téma",
|
||||
"rename_subjects": "Tantárgyak átnevezése",
|
||||
"rename_teachers": "Tanárok átnevezése",
|
||||
},
|
||||
"de_de": {
|
||||
"personal_details": "Persönliche Angaben",
|
||||
@ -272,6 +280,10 @@ extension SettingsLocalization on String {
|
||||
"paint_id": "Themen-ID...",
|
||||
"set_as_current": "Als aktuell einstellen",
|
||||
"share_subj_theme": "Thema Teilen",
|
||||
"no_name": "Anonymes Thema",
|
||||
"current_paint": "Aktuelles Thema",
|
||||
"rename_subjects": "Fächer umbenennen",
|
||||
"rename_teachers": "Lehrer umbenennen",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1,9 +1,14 @@
|
||||
// import 'package:filcnaplo/models/settings.dart';
|
||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||
import 'package:filcnaplo/models/settings.dart';
|
||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
||||
import 'package:filcnaplo_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:refilc_plus/ui/mobile/settings/welcome_message.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
import 'submenu_screen.i18n.dart';
|
||||
|
||||
@ -38,12 +43,21 @@ class MenuExtrasSettings extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class ExtrasSettingsScreen extends StatelessWidget {
|
||||
class ExtrasSettingsScreen extends StatefulWidget {
|
||||
const ExtrasSettingsScreen({super.key});
|
||||
|
||||
@override
|
||||
ExtrasSettingsScreenState createState() => ExtrasSettingsScreenState();
|
||||
}
|
||||
|
||||
class ExtrasSettingsScreenState extends State<ExtrasSettingsScreen> {
|
||||
late SettingsProvider settingsProvider;
|
||||
late UserProvider user;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// SettingsProvider settings = Provider.of<SettingsProvider>(context);
|
||||
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||
UserProvider user = Provider.of<UserProvider>(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@ -58,7 +72,58 @@ class ExtrasSettingsScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0),
|
||||
child: Column(
|
||||
children: [],
|
||||
children: [
|
||||
SplittedPanel(
|
||||
padding: const EdgeInsets.only(top: 8.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(
|
||||
gradeOpeningFun: !settingsProvider.gradeOpeningFun);
|
||||
|
||||
setState(() {});
|
||||
},
|
||||
title: Text(
|
||||
"surprise_grades".i18n,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text.withOpacity(
|
||||
settingsProvider.gradeOpeningFun ? .95 : .25),
|
||||
),
|
||||
),
|
||||
leading: Icon(
|
||||
FeatherIcons.gift,
|
||||
size: 22.0,
|
||||
color: AppColors.of(context).text.withOpacity(
|
||||
settingsProvider.gradeOpeningFun ? .95 : .25),
|
||||
),
|
||||
trailing: Switch(
|
||||
onChanged: (v) async {
|
||||
settingsProvider.update(gradeOpeningFun: v);
|
||||
|
||||
setState(() {});
|
||||
},
|
||||
value: settingsProvider.gradeOpeningFun,
|
||||
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: [
|
||||
WelcomeMessagePanelButton(settingsProvider, user),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -264,10 +264,9 @@ class PaintListScreenState extends State<PaintListScreen>
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
settingsProvider.currentThemeDisplayName !=
|
||||
'displayName'
|
||||
settingsProvider.currentThemeDisplayName != ''
|
||||
? settingsProvider.currentThemeDisplayName
|
||||
: 'Névtelen téma',
|
||||
: 'no_name'.i18n,
|
||||
style: TextStyle(
|
||||
color:
|
||||
AppColors.of(context).text.withOpacity(.95),
|
||||
|
@ -7,16 +7,19 @@ extension SettingsLocalization on String {
|
||||
"general": "General",
|
||||
"personalization": "Personalization",
|
||||
"extras": "Extras",
|
||||
"surprise_grades": "Surprise Grades",
|
||||
},
|
||||
"hu_hu": {
|
||||
"general": "Általános",
|
||||
"personalization": "Személyre szabás",
|
||||
"extras": "Extrák",
|
||||
"surprise_grades": "Meglepetés jegyek",
|
||||
},
|
||||
"de_de": {
|
||||
"general": "Allgemeine",
|
||||
"personalization": "Personalisierung",
|
||||
"extras": "Extras",
|
||||
"surprise_grades": "Überraschende Noten",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -254,7 +254,7 @@ class _PremiumCustomAccentColorSettingState
|
||||
colors: isBackgroundDifferent
|
||||
? [
|
||||
Theme.of(context).colorScheme.background.withOpacity(1 -
|
||||
((currentTheme == ThemeMode.dark ? 0.65 : 0.45) *
|
||||
((currentTheme == ThemeMode.dark ? 0.65 : 0.25) *
|
||||
backgroundAnimation.value)),
|
||||
backgroundGradientBottomColor,
|
||||
]
|
||||
@ -396,8 +396,12 @@ class _PremiumCustomAccentColorSettingState
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 32.0, vertical: 6.0),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 32.0,
|
||||
right: 32.0,
|
||||
top: 16.0,
|
||||
bottom: 6.0,
|
||||
),
|
||||
child: FilterBar(
|
||||
items: const [
|
||||
Tab(text: "All"),
|
||||
@ -632,6 +636,9 @@ class _PremiumCustomAccentColorSettingState
|
||||
},
|
||||
),
|
||||
censored: true,
|
||||
padding: const EdgeInsets.only(
|
||||
right: 6.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user