forked from firka/student-legacy
Merge branch 'master' into bug-fixes
This commit is contained in:
commit
e734579249
@ -1,6 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "reFilc_Logo.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 577 KiB |
@ -13,7 +13,7 @@ class LessonData {
|
||||
var nextRoom: String
|
||||
|
||||
init?() {
|
||||
let sharedDefault = UserDefaults(suiteName: "group.filcnaplo.livecard")!
|
||||
let sharedDefault = UserDefaults(suiteName: "group.refilc.livecard")!
|
||||
|
||||
self.icon = sharedDefault.string(forKey: "icon")!
|
||||
self.index = sharedDefault.string(forKey: "index")!
|
||||
|
@ -68,8 +68,6 @@ struct LockScreenLiveActivityView: View {
|
||||
.monospacedDigit()
|
||||
.padding(.trailing, CGFloat(24))
|
||||
}
|
||||
.activitySystemActionForegroundColor(.teal)
|
||||
.activityBackgroundTint(.teal)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,14 +57,14 @@ Future loginApi({
|
||||
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
|
||||
.getAPI(KretaAPI.nonce, json: false);
|
||||
|
||||
Nonce nonce = getNonce(nonceStr, username, instituteCode);
|
||||
Nonce nonce = getNonce(nonceStr, username.replaceAll(' ', '') + ' ', instituteCode);
|
||||
headers.addAll(nonce.header());
|
||||
|
||||
Map? res = await Provider.of<KretaClient>(context, listen: false)
|
||||
.postAPI(KretaAPI.login,
|
||||
headers: headers,
|
||||
body: User.loginBody(
|
||||
username: username,
|
||||
username: username.replaceAll(' ', '') + ' ',
|
||||
password: password,
|
||||
instituteCode: instituteCode,
|
||||
));
|
||||
@ -83,7 +83,7 @@ Future loginApi({
|
||||
.getAPI(KretaAPI.student(instituteCode));
|
||||
Student student = Student.fromJson(studentJson!);
|
||||
var user = User(
|
||||
username: username,
|
||||
username: username.replaceAll(' ', '') + ' ',
|
||||
password: password,
|
||||
instituteCode: instituteCode,
|
||||
name: student.name,
|
||||
|
@ -44,7 +44,7 @@ class LiveCardProvider extends ChangeNotifier {
|
||||
required SettingsProvider settings,
|
||||
}) : _timetable = timetable,
|
||||
_settings = settings {
|
||||
_liveActivitiesPlugin.init(appGroupId: "group.filcnaplo.livecard");
|
||||
_liveActivitiesPlugin.init(appGroupId: "group.refilc.livecard");
|
||||
_liveActivitiesPlugin.getAllActivitiesIds().then((value) {
|
||||
_latestActivityId = value.isNotEmpty ? value.first : null;
|
||||
});
|
||||
|
@ -169,7 +169,7 @@ class KretaClient {
|
||||
Map? loginRes = await postAPI(KretaAPI.login,
|
||||
headers: headers,
|
||||
body: User.loginBody(
|
||||
username: loginUser.username,
|
||||
username: loginUser.username.replaceAll(' ', '') + ' ',
|
||||
password: loginUser.password,
|
||||
instituteCode: loginUser.instituteCode,
|
||||
));
|
||||
|
@ -22,8 +22,7 @@ class GradeProvider with ChangeNotifier {
|
||||
|
||||
// Public
|
||||
List<Grade> get grades => _grades;
|
||||
DateTime get lastSeenDate =>
|
||||
_settings.gradeOpeningFun ? _lastSeen : DateTime(3000);
|
||||
DateTime get lastSeenDate => _settings.gradeOpeningFun ? _lastSeen : DateTime(3000);
|
||||
String get groups => _groups;
|
||||
List<GroupAverage> get groupAverages => _groupAvg;
|
||||
|
||||
@ -67,9 +66,7 @@ class GradeProvider with ChangeNotifier {
|
||||
_groupAvg = await userQuery.getGroupAverages(userId: userId);
|
||||
notifyListeners();
|
||||
DateTime lastSeenDB = await userQuery.lastSeenGrade(userId: userId);
|
||||
if (lastSeenDB.millisecondsSinceEpoch == 0 ||
|
||||
lastSeenDB.year == 0 ||
|
||||
!_settings.gradeOpeningFun) {
|
||||
if (lastSeenDB.millisecondsSinceEpoch == 0 || lastSeenDB.year == 0 || !_settings.gradeOpeningFun) {
|
||||
_lastSeen = DateTime.now();
|
||||
await seenAll();
|
||||
} else {
|
||||
@ -81,25 +78,13 @@ class GradeProvider with ChangeNotifier {
|
||||
|
||||
// good student mode, renamed subjects
|
||||
Future<void> convertBySettings() async {
|
||||
Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled
|
||||
? await _database.userQuery.renamedSubjects(userId: _user.user!.id)
|
||||
: {};
|
||||
Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled ? await _database.userQuery.renamedSubjects(userId: _user.user!.id) : {};
|
||||
|
||||
for (Grade grade in _grades) {
|
||||
//grade.subject.renamedTo = renamedSubjects.isNotEmpty ? renamedSubjects[grade.subject.id] : null;
|
||||
grade.subject.renamedTo = null;
|
||||
if (renamedSubjects.isNotEmpty) {
|
||||
grade.subject.name =
|
||||
renamedSubjects[grade.subject.id] ?? grade.subject.name;
|
||||
}
|
||||
grade.value.value =
|
||||
_settings.goodStudent ? 5 : grade.json!["SzamErtek"] ?? 0;
|
||||
grade.value.valueName = _settings.goodStudent
|
||||
? "Jeles".i18n
|
||||
: grade.json!["SzovegesErtek"].i18n ?? "";
|
||||
grade.value.shortName = _settings.goodStudent
|
||||
? "Jeles".i18n
|
||||
: grade.json!["SzovegesErtekelesRovidNev"].i18n ?? "";
|
||||
// grade.subject.renamedTo = renamedSubjects.isNotEmpty ? renamedSubjects[grade.subject.id] : null;
|
||||
grade.value.value = _settings.goodStudent ? 5 : grade.json!["SzamErtek"] ?? 0;
|
||||
grade.value.valueName = _settings.goodStudent ? "Jeles".i18n : grade.json!["SzovegesErtek"] ?? "";
|
||||
grade.value.shortName = _settings.goodStudent ? "Jeles".i18n : grade.json!["SzovegesErtekelesRovidNev"] ?? "";
|
||||
}
|
||||
|
||||
notifyListeners();
|
||||
@ -118,16 +103,12 @@ class GradeProvider with ChangeNotifier {
|
||||
if (grades.isNotEmpty || _grades.isNotEmpty) await store(grades);
|
||||
|
||||
List? groupsJson = await _kreta.getAPI(KretaAPI.groups(iss));
|
||||
if (groupsJson == null || groupsJson.isEmpty)
|
||||
throw "Cannot fetch Groups for User ${user.id}";
|
||||
if (groupsJson == null || groupsJson.isEmpty) throw "Cannot fetch Groups for User ${user.id}";
|
||||
_groups = (groupsJson[0]["OktatasNevelesiFeladat"] ?? {})["Uid"] ?? "";
|
||||
|
||||
List? groupAvgJson =
|
||||
await _kreta.getAPI(KretaAPI.groupAverages(iss, _groups));
|
||||
if (groupAvgJson == null)
|
||||
throw "Cannot fetch Class Averages for User ${user.id}";
|
||||
final groupAvgs =
|
||||
groupAvgJson.map((e) => GroupAverage.fromJson(e)).toList();
|
||||
List? groupAvgJson = await _kreta.getAPI(KretaAPI.groupAverages(iss, _groups));
|
||||
if (groupAvgJson == null) throw "Cannot fetch Class Averages for User ${user.id}";
|
||||
final groupAvgs = groupAvgJson.map((e) => GroupAverage.fromJson(e)).toList();
|
||||
await storeGroupAvg(groupAvgs);
|
||||
}
|
||||
|
||||
|
@ -214,25 +214,25 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
||||
gradeCalc(context);
|
||||
},
|
||||
),
|
||||
FloatingActionButton.small(
|
||||
child: const Icon(FeatherIcons.flag, size: 20.0),
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
onPressed: () {
|
||||
if (!Provider.of<PremiumProvider>(context, listen: false)
|
||||
.hasScope(PremiumScopes.goalPlanner)) {
|
||||
PremiumLockedFeatureUpsell.show(
|
||||
context: context, feature: PremiumFeature.goalplanner);
|
||||
return;
|
||||
}
|
||||
// FloatingActionButton.small(
|
||||
// child: const Icon(FeatherIcons.flag, size: 20.0),
|
||||
// backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
// onPressed: () {
|
||||
// if (!Provider.of<PremiumProvider>(context, listen: false)
|
||||
// .hasScope(PremiumScopes.goalPlanner)) {
|
||||
// PremiumLockedFeatureUpsell.show(
|
||||
// context: context, feature: PremiumFeature.goalplanner);
|
||||
// return;
|
||||
// }
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text("Hamarosan...")));
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// const SnackBar(content: Text("Hamarosan...")));
|
||||
|
||||
//Navigator.of(context).push(CupertinoPageRoute(
|
||||
//builder: (context) => PremiumGoalplannerNewGoalScreen(
|
||||
// subject: widget.subject)));
|
||||
},
|
||||
),
|
||||
// Navigator.of(context).push(CupertinoPageRoute(
|
||||
// builder: (context) => PremiumGoalplannerNewGoalScreen(
|
||||
// subject: widget.subject)));
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -11,7 +11,7 @@ extension Localization on String {
|
||||
"happybirthday": "🎂 Happy birthday, %s!",
|
||||
"merryxmas": "🎄 Merry Christmas, %s!",
|
||||
"happynewyear": "🎉 Happy New Year, %s!",
|
||||
"refilcopen": "🎈 Welcome to reFilc, %s!",
|
||||
"refilcopen": "🎈 reFilc is 1 year old, %s!",
|
||||
"empty": "Nothing to see here.",
|
||||
"All": "All",
|
||||
"Grades": "Grades",
|
||||
@ -30,7 +30,7 @@ extension Localization on String {
|
||||
"happybirthday": "🎂 Boldog születésnapot, %s!",
|
||||
"merryxmas": "🎄 Boldog Karácsonyt, %s!",
|
||||
"happynewyear": "🎉 Boldog új évet, %s!",
|
||||
"refilcopen": "🎈 Üdv a reFilc-ben, %s!",
|
||||
"refilcopen": "🎈 1 éves a reFilc, %s!",
|
||||
"empty": "Nincs itt semmi látnivaló.",
|
||||
"All": "Összes",
|
||||
"Grades": "Jegyek",
|
||||
@ -49,7 +49,7 @@ extension Localization on String {
|
||||
"happybirthday": "🎂 Alles Gute zum Geburtstag, %s!",
|
||||
"merryxmas": "🎄 Frohe Weihnachten, %s!",
|
||||
"happynewyear": "🎉 Frohes neues Jahr, %s!",
|
||||
"refilcopen": "🎈 Willkommen bei reFilc, %s!",
|
||||
"refilcopen": "🎈 reFilc ist 1 Jahr alt, %s!",
|
||||
"empty": "Hier gibt es nichts zu sehen.",
|
||||
"All": "Alles",
|
||||
"Grades": "Noten",
|
||||
|
@ -2,7 +2,8 @@ import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SchoolInputTile extends StatelessWidget {
|
||||
const SchoolInputTile({Key? key, required this.school, this.onTap}) : super(key: key);
|
||||
const SchoolInputTile({Key? key, required this.school, this.onTap})
|
||||
: super(key: key);
|
||||
|
||||
final School school;
|
||||
final Function()? onTap;
|
||||
|
@ -634,7 +634,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: AppColors.of(context).text.withOpacity(.25),
|
||||
),
|
||||
const SizedBox(width: 24.0),
|
||||
const SizedBox(width: 14.0),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"graph_class_avg".i18n,
|
||||
@ -679,7 +679,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: AppColors.of(context).text.withOpacity(.25),
|
||||
),
|
||||
const SizedBox(width: 24.0),
|
||||
const SizedBox(width: 14.0),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"news".i18n,
|
||||
@ -724,7 +724,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: AppColors.of(context).text.withOpacity(.25),
|
||||
),
|
||||
const SizedBox(width: 24.0),
|
||||
const SizedBox(width: 14.0),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"surprise_grades".i18n,
|
||||
|
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GradesBody extends StatelessWidget {
|
||||
const GradesBody({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column();
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PersonalityBody extends StatelessWidget {
|
||||
const PersonalityBody({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column();
|
||||
}
|
||||
}
|
55
filcnaplo_mobile_ui/lib/screens/summary/summary_screen.dart
Normal file
55
filcnaplo_mobile_ui/lib/screens/summary/summary_screen.dart
Normal file
@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'pages/grades_page.dart';
|
||||
|
||||
class SummaryScreen extends StatefulWidget {
|
||||
final String currentPage;
|
||||
|
||||
const SummaryScreen({Key? key, this.currentPage = 'personality'})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_SummaryScreenState createState() => _SummaryScreenState();
|
||||
}
|
||||
|
||||
class _SummaryScreenState extends State<SummaryScreen> {
|
||||
final LinearGradient _backgroundGradient = const LinearGradient(
|
||||
colors: [
|
||||
Color(0xff1d56ac),
|
||||
Color(0xff170a3d),
|
||||
],
|
||||
begin: Alignment(-0.8, -1.0),
|
||||
end: Alignment(0.8, 1.0),
|
||||
stops: [-1.0, 1.0],
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
decoration: BoxDecoration(gradient: _backgroundGradient),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(gradient: _backgroundGradient),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: SafeArea(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 24.0,
|
||||
right: 24.0,
|
||||
top: 26.0 + MediaQuery.of(context).padding.top,
|
||||
bottom: 52.0,
|
||||
),
|
||||
child: widget.currentPage == 'grades'
|
||||
? const GradesBody()
|
||||
: widget.currentPage == 'lessons'
|
||||
? const GradesBody()
|
||||
: widget.currentPage == 'allsum'
|
||||
? const GradesBody()
|
||||
: const GradesBody(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import 'package:i18n_extension/i18n_extension.dart';
|
||||
|
||||
extension SettingsLocalization on String {
|
||||
static final _t = Translations.byLocale("hu_hu") +
|
||||
{
|
||||
"en_en": {},
|
||||
"hu_hu": {},
|
||||
"de_de": {},
|
||||
};
|
||||
|
||||
String get i18n => localize(this, _t);
|
||||
String fill(List<Object> params) => localizeFill(this, params);
|
||||
String plural(int value) => localizePlural(value, this, _t);
|
||||
String version(Object modifier) => localizeVersion(modifier, this, _t);
|
||||
}
|
@ -60,7 +60,11 @@ class _PremiumFSTimetableState extends State<PremiumFSTimetable> {
|
||||
final colw = (MediaQuery.of(context).size.width - padding) / days.length;
|
||||
|
||||
return Scaffold(
|
||||
appBar: buildAppBar(),
|
||||
appBar: AppBar(
|
||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
leading: BackButton(color: AppColors.of(context).text),
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
body: ListView.builder(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 24.0),
|
||||
@ -209,14 +213,4 @@ class _PremiumFSTimetableState extends State<PremiumFSTimetable> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
AppBar buildAppBar() {
|
||||
return AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
actions: const [
|
||||
BackButton(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user