Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82db2e2091 | ||
|
|
774f63aa89 | ||
|
|
8375e1877a | ||
|
|
b00fab090c | ||
|
|
382961971d | ||
|
|
04c5c819f8 | ||
|
|
6249015bef | ||
|
|
2fade7117b | ||
|
|
49c396e746 | ||
|
|
be4737f9db | ||
|
|
d27c059b23 | ||
|
|
21a5771211 | ||
|
|
501d83c229 | ||
|
|
6651bbf14a | ||
|
|
ddf1944883 | ||
|
|
bf0eeb83e4 | ||
|
|
d41c39849b | ||
|
|
25294dd4a7 | ||
|
|
d0f347c80d | ||
|
|
44464e1946 | ||
|
|
5a371d7200 | ||
|
|
27fefb4c27 | ||
|
|
efe58eeea9 | ||
|
|
8e629ef596 | ||
|
|
d188cefc07 | ||
|
|
c5b6f92b0e | ||
|
|
2d5cbe8799 | ||
|
|
c7c3b421f4 | ||
|
|
adfa653062 | ||
|
|
86f7cf3b2e | ||
|
|
1cc885e4b7 | ||
|
|
a4207b8348 | ||
|
|
3e600f69f0 | ||
|
|
205d90523c | ||
|
|
906de6dd45 | ||
|
|
3ff0927834 | ||
|
|
14e5614adc | ||
|
|
6ed89b2a1e | ||
|
|
5272ac5a01 | ||
|
|
46e6120af3 | ||
|
|
600bf7d763 | ||
|
|
10750f898f | ||
|
|
1d5ebe7bbd | ||
|
|
2aa8db8f42 | ||
|
|
f95d4582be | ||
|
|
63889325cf | ||
|
|
acbffd6d72 | ||
|
|
b19da9cb66 | ||
|
|
fd80aec51f | ||
|
|
5776622276 | ||
|
|
69ea3e1a7f | ||
|
|
3d451f6f91 | ||
|
|
387e2e46db | ||
|
|
a7f1681902 | ||
|
|
4b127bdf56 | ||
|
|
dbb6125ab5 | ||
|
|
b6d4ac6168 | ||
|
|
9d20d08838 | ||
|
|
f39ac80770 | ||
|
|
41991b3b66 | ||
|
|
53ec3e567a | ||
|
|
176608bfc5 | ||
|
|
92b4094550 | ||
|
|
45c6fccb89 | ||
|
|
014329d7fe | ||
|
|
dca01d0ed0 | ||
|
|
493adaa5f2 | ||
|
|
8451983163 | ||
|
|
2b7e143812 | ||
|
|
9845a35c6e | ||
|
|
b92ac9ffbc | ||
|
|
f435f31523 | ||
|
|
6abc61db7b | ||
|
|
cd8ab8bfdb | ||
|
|
24a6393aca | ||
|
|
64fb22de74 | ||
|
|
14ce4c82fb | ||
|
|
7d1f4e992c | ||
|
|
17b8b96767 | ||
|
|
7ac5d64d19 | ||
|
|
d9bd555e6a | ||
|
|
b5bf994b8d | ||
|
|
8b216bd27b | ||
|
|
a9bd11a4d7 | ||
|
|
129a95f359 | ||
|
|
8b65d4d519 | ||
|
|
353297bc90 | ||
|
|
63d24f7e89 | ||
|
|
4b93c891c8 | ||
|
|
6f85a4ebc1 | ||
|
|
b37af9f5a5 | ||
|
|
3a26fd9ec9 | ||
|
|
9cda8c5d29 | ||
|
|
6212489001 | ||
|
|
b4ff2fa815 | ||
|
|
a11ebce6fb | ||
|
|
fa75c1ec06 | ||
|
|
79677d657e | ||
|
|
50d1803a18 | ||
|
|
34f9929b16 | ||
|
|
056bf7ab58 | ||
|
|
c4dc03f41d | ||
|
|
6d7a21dc02 | ||
|
|
9406efee8d |
77
.gitignore
vendored
77
.gitignore
vendored
@@ -1,52 +1,37 @@
|
|||||||
# See https://www.dartlang.org/guides/libraries/private-files
|
|
||||||
|
|
||||||
.gitignore
|
filcnaplo/.flutter-plugins
|
||||||
|
filcnaplo/.flutter-plugins-dependencies
|
||||||
|
filcnaplo/pubspec.lock
|
||||||
|
filcnaplo/.dart_tool/
|
||||||
|
filcnaplo/android/
|
||||||
|
filcnaplo/ios/
|
||||||
|
filcnaplo/windows/
|
||||||
|
filcnaplo/linux/
|
||||||
|
filcnaplo/macos/
|
||||||
|
filcnaplo/build/
|
||||||
|
|
||||||
termek.txt
|
filcnaplo_desktop_ui/.flutter-plugins
|
||||||
.DS_Store
|
filcnaplo_desktop_ui/.flutter-plugins-dependencies
|
||||||
filc3.properties
|
filcnaplo_desktop_ui/pubspec.lock
|
||||||
local.properties
|
filcnaplo_desktop_ui/.dart_tool/
|
||||||
# Files and directories created by pub
|
|
||||||
.dart_tool/
|
|
||||||
.packages
|
|
||||||
build/
|
|
||||||
# If you're building an application, you may want to check-in your pubspec.lock
|
|
||||||
pubspec.lock
|
|
||||||
|
|
||||||
# Directory created by dartdoc
|
filcnaplo_kreta_api/.flutter-plugins
|
||||||
# If you don't generate documentation locally you can remove this line.
|
filcnaplo_kreta_api/.flutter-plugins-dependencies
|
||||||
doc/api/
|
filcnaplo_kreta_api/pubspec.lock
|
||||||
|
filcnaplo_kreta_api/.dart_tool/
|
||||||
|
|
||||||
# Avoid committing generated Javascript files:
|
filcnaplo_mobile_ui/.flutter-plugins
|
||||||
*.dart.js
|
filcnaplo_mobile_ui/.flutter-plugins-dependencies
|
||||||
*.info.json # Produced by the --dump-info flag.
|
filcnaplo_mobile_ui/pubspec.lock
|
||||||
*.js # When generated by dart2js. Don't specify *.js if your
|
filcnaplo_mobile_ui/.dart_tool/
|
||||||
# project includes source files written in JavaScript.
|
|
||||||
*.js_
|
|
||||||
*.js.deps
|
|
||||||
*.js.map
|
|
||||||
|
|
||||||
*.txt
|
filcnaplo_premium/.flutter-plugins
|
||||||
filcnaplo/macos/Flutter/GeneratedPluginRegistrant.swift
|
filcnaplo_premium/.flutter-plugins-dependencies
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/connectivity_plus
|
filcnaplo_premium/pubspec.lock
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/dynamic_color
|
filcnaplo_premium/.dart_tool/
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/flutter_acrylic
|
filcnaplo_premium/android/
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/permission_handler_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/share_plus_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/generated_config.cmake
|
|
||||||
filcnaplo/windows/flutter/generated_plugin_registrant.cc
|
|
||||||
filcnaplo/windows/flutter/generated_plugin_registrant.h
|
|
||||||
filcnaplo/windows/flutter/generated_plugins.cmake
|
|
||||||
filcnaplo/linux/flutter/generated_plugin_registrant.cc
|
|
||||||
filcnaplo/linux/flutter/generated_plugin_registrant.h
|
|
||||||
filcnaplo/linux/flutter/generated_plugins.cmake
|
|
||||||
filcnaplo/macos/Flutter/*
|
|
||||||
filcnaplo/ios/Podfile.lock
|
|
||||||
.vscode/
|
|
||||||
key.properties
|
|
||||||
|
|
||||||
.flutter-plugins*
|
.vscode
|
||||||
filcnaplo/ios/Flutter/flutter_export_environment 4.sh
|
.github
|
||||||
filcnaplo/ios/Flutter/Generated 4.xcconfig
|
.idea
|
||||||
|
.gitmodules
|
||||||
|
|||||||
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
40
.vscode/launch.json
vendored
40
.vscode/launch.json
vendored
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "filcnaplo",
|
|
||||||
"cwd": "filcnaplo",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart",
|
|
||||||
"toolArgs": [
|
|
||||||
"--dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// "name": "filcnaplo release",
|
|
||||||
// "cwd": "filcnaplo release",
|
|
||||||
// "request": "launch",
|
|
||||||
// "type": "dart",
|
|
||||||
// "program": "lib/main.dart",
|
|
||||||
// "toolArgs": [
|
|
||||||
// "--dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1)"
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
"name": "Flutter",
|
|
||||||
"program": "lib/main.dart",
|
|
||||||
"cwd": "filcnaplo",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart",
|
|
||||||
"flutterMode": "debug"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Flutter (release)",
|
|
||||||
"program": "lib/main.dart",
|
|
||||||
"cwd": "filcnaplo",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart",
|
|
||||||
"flutterMode": "release"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
47
filcnaplo/.gitignore
vendored
47
filcnaplo/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
key.properties
|
|
||||||
12
filcnaplo/android/.gitignore
vendored
12
filcnaplo/android/.gitignore
vendored
@@ -1,12 +0,0 @@
|
|||||||
gradle-wrapper.jar
|
|
||||||
/.gradle
|
|
||||||
/captures/
|
|
||||||
/gradlew
|
|
||||||
/gradlew.bat
|
|
||||||
/local.properties
|
|
||||||
GeneratedPluginRegistrant.java
|
|
||||||
|
|
||||||
# Remember to never publicly share your keystore.
|
|
||||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
|
||||||
key.properties
|
|
||||||
.project
|
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
android:layout_below="@id/iv_1"
|
android:layout_below="@id/iv_1"
|
||||||
android:layout_marginHorizontal="15dp"
|
android:layout_marginHorizontal="15dp"
|
||||||
android:fontFamily="@font/montserrat_medium"
|
android:fontFamily="@font/montserrat_medium"
|
||||||
android:text="A widget használatához, bejelentkezés szükséges."
|
android:text="A widget használatához bejelentkezés szükséges."
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:textSize="17sp"
|
android:textSize="17sp"
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
||||||
33
filcnaplo/ios/.gitignore
vendored
33
filcnaplo/ios/.gitignore
vendored
@@ -1,33 +0,0 @@
|
|||||||
*.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
*.moved-aside
|
|
||||||
*.pbxuser
|
|
||||||
*.perspectivev3
|
|
||||||
**/*sync/
|
|
||||||
.sconsign.dblite
|
|
||||||
.tags*
|
|
||||||
**/.vagrant/
|
|
||||||
**/DerivedData/
|
|
||||||
Icon?
|
|
||||||
**/Pods/
|
|
||||||
**/.symlinks/
|
|
||||||
profile
|
|
||||||
xcuserdata
|
|
||||||
**/.generated/
|
|
||||||
Flutter/App.framework
|
|
||||||
Flutter/Flutter.framework
|
|
||||||
Flutter/Flutter.podspec
|
|
||||||
Flutter/Generated.xcconfig
|
|
||||||
Flutter/ephemeral/
|
|
||||||
Flutter/app.flx
|
|
||||||
Flutter/app.zip
|
|
||||||
Flutter/flutter_assets/
|
|
||||||
Flutter/flutter_export_environment.sh
|
|
||||||
ServiceDefinitions.json
|
|
||||||
Runner/GeneratedPluginRegistrant.*
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
|
||||||
!default.mode1v3
|
|
||||||
!default.mode2v3
|
|
||||||
!default.pbxuser
|
|
||||||
!default.perspectivev3
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Uncomment this line to define a global platform for your project
|
# Uncomment this line to define a global platform for your project
|
||||||
# platform :ios, '11.0'
|
platform :ios, '12.0'
|
||||||
|
|
||||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
@@ -39,5 +39,8 @@ end
|
|||||||
post_install do |installer|
|
post_install do |installer|
|
||||||
installer.pods_project.targets.each do |target|
|
installer.pods_project.targets.each do |target|
|
||||||
flutter_additional_ios_build_settings(target)
|
flutter_additional_ios_build_settings(target)
|
||||||
|
target.build_configurations.each do |config|
|
||||||
|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -221,9 +221,9 @@
|
|||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
|
3127F74F28EAEC8A00C2EFB3 /* Embed Foundation Extensions */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
71459C0EB905E05018E3D78F /* [CP] Embed Pods Frameworks */,
|
71459C0EB905E05018E3D78F /* [CP] Embed Pods Frameworks */,
|
||||||
3127F74F28EAEC8A00C2EFB3 /* Embed Foundation Extensions */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 195;
|
CURRENT_PROJECT_VERSION = 195;
|
||||||
DEVELOPMENT_TEAM = 48XS7JAZB7;
|
DEVELOPMENT_TEAM = 4DKAF249F3;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = reFilc;
|
INFOPLIST_KEY_CFBundleDisplayName = reFilc;
|
||||||
@@ -488,7 +488,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.6.0;
|
MARKETING_VERSION = 3.6.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.refilctest.naplo;
|
PRODUCT_BUNDLE_IDENTIFIER = com.refilc2.naplo;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -510,7 +510,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = 48XS7JAZB7;
|
DEVELOPMENT_TEAM = 4DKAF249F3;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = livecard/Info.plist;
|
INFOPLIST_FILE = livecard/Info.plist;
|
||||||
@@ -526,7 +526,7 @@
|
|||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.refilctest.naplo.livecardpro;
|
PRODUCT_BUNDLE_IDENTIFIER = com.refilc2.naplo.livecardpro;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
@@ -552,7 +552,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = 48XS7JAZB7;
|
DEVELOPMENT_TEAM = 4DKAF249F3;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = livecard/Info.plist;
|
INFOPLIST_FILE = livecard/Info.plist;
|
||||||
@@ -567,7 +567,7 @@
|
|||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.refilctest.naplo.livecardpro;
|
PRODUCT_BUNDLE_IDENTIFIER = com.refilc2.naplo.livecardpro;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
@@ -592,7 +592,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = 48XS7JAZB7;
|
DEVELOPMENT_TEAM = 4DKAF249F3;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = livecard/Info.plist;
|
INFOPLIST_FILE = livecard/Info.plist;
|
||||||
@@ -607,7 +607,7 @@
|
|||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 1.0;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.refilctest.naplo.livecardpro;
|
PRODUCT_BUNDLE_IDENTIFIER = com.refilc2.naplo.livecardpro;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
@@ -736,7 +736,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 195;
|
CURRENT_PROJECT_VERSION = 195;
|
||||||
DEVELOPMENT_TEAM = 48XS7JAZB7;
|
DEVELOPMENT_TEAM = 4DKAF249F3;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = reFilc;
|
INFOPLIST_KEY_CFBundleDisplayName = reFilc;
|
||||||
@@ -746,7 +746,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.6.0;
|
MARKETING_VERSION = 3.6.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.refilctest.naplo;
|
PRODUCT_BUNDLE_IDENTIFIER = com.refilc2.naplo;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
@@ -764,7 +764,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 195;
|
CURRENT_PROJECT_VERSION = 195;
|
||||||
DEVELOPMENT_TEAM = 48XS7JAZB7;
|
DEVELOPMENT_TEAM = 4DKAF249F3;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = reFilc;
|
INFOPLIST_KEY_CFBundleDisplayName = reFilc;
|
||||||
@@ -774,7 +774,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.6.0;
|
MARKETING_VERSION = 3.6.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.refilctest.naplo;
|
PRODUCT_BUNDLE_IDENTIFIER = com.refilc2.naplo;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<string>development</string>
|
<string>development</string>
|
||||||
<key>com.apple.security.application-groups</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<array>
|
<array>
|
||||||
<string>group.refilcnaplo.livecard</string>
|
<string>group.refilc2.livecard</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class LessonData {
|
|||||||
var nextRoom: String
|
var nextRoom: String
|
||||||
|
|
||||||
init?() {
|
init?() {
|
||||||
let sharedDefault = UserDefaults(suiteName: "group.refilc.livecard")!
|
let sharedDefault = UserDefaults(suiteName: "group.refilc2.livecard")!
|
||||||
|
|
||||||
self.color = sharedDefault.string(forKey: "color")!
|
self.color = sharedDefault.string(forKey: "color")!
|
||||||
self.icon = sharedDefault.string(forKey: "icon")!
|
self.icon = sharedDefault.string(forKey: "icon")!
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<string>development</string>
|
<string>development</string>
|
||||||
<key>com.apple.security.application-groups</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<array>
|
<array>
|
||||||
<string>group.refilcnaplo.livecard</string>
|
<string>group.refilc2.livecard</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -91,14 +91,15 @@ struct LockScreenLiveActivityView: View {
|
|||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
Text(timerInterval: lesson!.date, countsDown: true)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
.frame(width: 85)
|
.frame(width: 85)
|
||||||
.font(.title)
|
.font(.title2)
|
||||||
.monospacedDigit()
|
.monospacedDigit()
|
||||||
.padding(.trailing, CGFloat(24))
|
.padding(.trailing, CGFloat(24))
|
||||||
}
|
}
|
||||||
.activityBackgroundTint(
|
.activityBackgroundTint(
|
||||||
lesson!.color == "#676767"
|
lesson!.color != "#676767"
|
||||||
? nil
|
? Color(hex: lesson!.color)
|
||||||
: Color(hex: lesson!.color)
|
// Ha nem megy hat nem megy
|
||||||
|
: Color.clear
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,12 +119,22 @@ struct LiveCardWidget: Widget {
|
|||||||
DynamicIslandExpandedRegion(.leading) {
|
DynamicIslandExpandedRegion(.leading) {
|
||||||
VStack {
|
VStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Image(systemName: lesson!.icon)
|
ProgressView(
|
||||||
.resizable()
|
timerInterval: lesson!.date,
|
||||||
.aspectRatio(contentMode: .fit)
|
countsDown: true,
|
||||||
.frame(width: CGFloat(30), height: CGFloat(30))
|
label: {
|
||||||
.padding(.leading, CGFloat(6))
|
Image(systemName: lesson!.icon)
|
||||||
.padding(.bottom, CGFloat(6))
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: CGFloat(32), height: CGFloat(32))
|
||||||
|
},
|
||||||
|
currentValueLabel: {
|
||||||
|
Image(systemName: lesson!.icon)
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: CGFloat(32), height: CGFloat(32))
|
||||||
|
}
|
||||||
|
).progressViewStyle(.circular)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DynamicIslandExpandedRegion(.center) {
|
DynamicIslandExpandedRegion(.center) {
|
||||||
@@ -136,7 +147,7 @@ struct LiveCardWidget: Widget {
|
|||||||
Text(lesson!.description)
|
Text(lesson!.description)
|
||||||
.lineLimit(2)
|
.lineLimit(2)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
}
|
}.padding(EdgeInsets(top: 0.0, leading: 5.0, bottom: 0.0, trailing: 0.0))
|
||||||
}
|
}
|
||||||
DynamicIslandExpandedRegion(.trailing) {
|
DynamicIslandExpandedRegion(.trailing) {
|
||||||
VStack {
|
VStack {
|
||||||
@@ -156,7 +167,8 @@ struct LiveCardWidget: Widget {
|
|||||||
Image(systemName: lesson!.icon)
|
Image(systemName: lesson!.icon)
|
||||||
}
|
}
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
} compactTrailing: {
|
}
|
||||||
|
compactTrailing: {
|
||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
Text(timerInterval: lesson!.date, countsDown: true)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
.frame(width: 40)
|
.frame(width: 40)
|
||||||
@@ -164,22 +176,29 @@ struct LiveCardWidget: Widget {
|
|||||||
|
|
||||||
/// Collapsed
|
/// Collapsed
|
||||||
} minimal: {
|
} minimal: {
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center, content: {
|
||||||
Image(systemName: lesson!.icon)
|
ProgressView(
|
||||||
.resizable()
|
timerInterval: lesson!.date,
|
||||||
.aspectRatio(contentMode: .fit)
|
countsDown: true,
|
||||||
.frame(width: CGFloat(12), height: CGFloat(12))
|
label: {
|
||||||
|
Image(systemName: lesson!.icon)
|
||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
.resizable()
|
||||||
.multilineTextAlignment(.center)
|
.aspectRatio(contentMode: .fit)
|
||||||
.monospacedDigit()
|
.frame(width: CGFloat(12), height: CGFloat(12))
|
||||||
.font(.system(size: CGFloat(10)))
|
},
|
||||||
}
|
currentValueLabel: {
|
||||||
|
Image(systemName: lesson!.icon)
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: CGFloat(12), height: CGFloat(12))
|
||||||
|
}
|
||||||
|
).progressViewStyle(.circular)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
.keylineTint(
|
.keylineTint(
|
||||||
lesson!.color == "#676767"
|
lesson!.color != "#676767"
|
||||||
? nil
|
? Color(hex: lesson!.color)
|
||||||
: Color(hex: lesson!.color)
|
: Color.clear
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ class FilcAPI {
|
|||||||
static const allThemes = "$themeGet/all";
|
static const allThemes = "$themeGet/all";
|
||||||
static const themeByID = "$themeGet/";
|
static const themeByID = "$themeGet/";
|
||||||
|
|
||||||
|
static const gradeColorsShare = "$baseUrl/v2/shared/grade-colors/add";
|
||||||
|
static const gradeColorsGet = "$baseUrl/v2/shared/grade-colors/get";
|
||||||
|
static const allGradeColors = "$gradeColorsGet/all";
|
||||||
|
static const gradeColorsByID = "$gradeColorsGet/";
|
||||||
|
|
||||||
static Future<bool> checkConnectivity() async =>
|
static Future<bool> checkConnectivity() async =>
|
||||||
(await Connectivity().checkConnectivity()) != ConnectivityResult.none;
|
(await Connectivity().checkConnectivity()) != ConnectivityResult.none;
|
||||||
|
|
||||||
@@ -53,9 +58,14 @@ class FilcAPI {
|
|||||||
.map((json) => School.fromJson(json))
|
.map((json) => School.fromJson(json))
|
||||||
.toList();
|
.toList();
|
||||||
schools.add(School(
|
schools.add(School(
|
||||||
city: "Tiszabura",
|
city: "Stockholm",
|
||||||
instituteCode: "supporttest-reni-tiszabura-teszt01",
|
instituteCode: "refilc-test-sweden",
|
||||||
name: "FILC Éles Reni tiszabura-teszt",
|
name: "reFilc Test SE - Leo Ekström High School",
|
||||||
|
));
|
||||||
|
schools.add(School(
|
||||||
|
city: "Madrid",
|
||||||
|
instituteCode: "refilc-test-spain",
|
||||||
|
name: "reFilc Test ES - Emilio Obrero University",
|
||||||
));
|
));
|
||||||
return schools;
|
return schools;
|
||||||
} else {
|
} else {
|
||||||
@@ -180,12 +190,22 @@ class FilcAPI {
|
|||||||
|
|
||||||
static Future<void> sendReport(ErrorReport report) async {
|
static Future<void> sendReport(ErrorReport report) async {
|
||||||
try {
|
try {
|
||||||
http.Response res = await http.post(Uri.parse(reportApi), body: {
|
Map body = {
|
||||||
"os": report.os,
|
"os": report.os,
|
||||||
"version": report.version,
|
"version": report.version,
|
||||||
"error": report.error,
|
"error": report.error,
|
||||||
"stack_trace": report.stack,
|
"stack_trace": report.stack,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
var client = http.Client();
|
||||||
|
|
||||||
|
http.Response res = await client.post(
|
||||||
|
Uri.parse(reportApi),
|
||||||
|
body: body,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
@@ -203,6 +223,11 @@ class FilcAPI {
|
|||||||
theme.json['background_color'] = theme.backgroundColor.value.toString();
|
theme.json['background_color'] = theme.backgroundColor.value.toString();
|
||||||
theme.json['panels_color'] = theme.panelsColor.value.toString();
|
theme.json['panels_color'] = theme.panelsColor.value.toString();
|
||||||
theme.json['accent_color'] = theme.accentColor.value.toString();
|
theme.json['accent_color'] = theme.accentColor.value.toString();
|
||||||
|
theme.json['icon_color'] = theme.iconColor.value.toString();
|
||||||
|
theme.json['shadow_effect'] = theme.shadowEffect.toString();
|
||||||
|
|
||||||
|
// set linked grade colors
|
||||||
|
theme.json['grade_colors_id'] = theme.gradeColors.id;
|
||||||
|
|
||||||
http.Response res = await http.post(
|
http.Response res = await http.post(
|
||||||
Uri.parse(themeShare),
|
Uri.parse(themeShare),
|
||||||
@@ -230,7 +255,49 @@ class FilcAPI {
|
|||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
}
|
}
|
||||||
} on Exception catch (error, stacktrace) {
|
} on Exception catch (error, stacktrace) {
|
||||||
log("ERROR: FilcAPI.addSharedTheme: $error $stacktrace");
|
log("ERROR: FilcAPI.getSharedTheme: $error $stacktrace");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<void> addSharedGradeColors(
|
||||||
|
SharedGradeColors gradeColors) async {
|
||||||
|
try {
|
||||||
|
gradeColors.json.remove('json');
|
||||||
|
gradeColors.json['is_public'] = gradeColors.isPublic.toString();
|
||||||
|
gradeColors.json['five_color'] = gradeColors.fiveColor.value.toString();
|
||||||
|
gradeColors.json['four_color'] = gradeColors.fourColor.value.toString();
|
||||||
|
gradeColors.json['three_color'] = gradeColors.threeColor.value.toString();
|
||||||
|
gradeColors.json['two_color'] = gradeColors.twoColor.value.toString();
|
||||||
|
gradeColors.json['one_color'] = gradeColors.oneColor.value.toString();
|
||||||
|
|
||||||
|
http.Response res = await http.post(
|
||||||
|
Uri.parse(gradeColorsShare),
|
||||||
|
body: gradeColors.json,
|
||||||
|
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (res.statusCode != 201) {
|
||||||
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
|
}
|
||||||
|
|
||||||
|
log('Shared grade colors successfully with ID: ${gradeColors.id}');
|
||||||
|
} on Exception catch (error, stacktrace) {
|
||||||
|
log("ERROR: FilcAPI.addSharedGradeColors: $error $stacktrace");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map?> getSharedGradeColors(String id) async {
|
||||||
|
try {
|
||||||
|
http.Response res = await http.get(Uri.parse(gradeColorsByID + id));
|
||||||
|
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
return (jsonDecode(res.body) as Map);
|
||||||
|
} else {
|
||||||
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
|
}
|
||||||
|
} on Exception catch (error, stacktrace) {
|
||||||
|
log("ERROR: FilcAPI.getSharedGradeColors: $error $stacktrace");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// ignore_for_file: avoid_print, use_build_context_synchronously
|
// ignore_for_file: avoid_print, use_build_context_synchronously
|
||||||
|
|
||||||
import 'package:filcnaplo/utils/jwt.dart';
|
import 'package:filcnaplo/utils/jwt.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/absence_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/absence_provider.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/event_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/event_provider.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
||||||
@@ -20,6 +21,7 @@ import 'package:filcnaplo_kreta_api/models/week.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:filcnaplo/api/nonce.dart';
|
import 'package:filcnaplo/api/nonce.dart';
|
||||||
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
enum LoginState {
|
enum LoginState {
|
||||||
missingFields,
|
missingFields,
|
||||||
@@ -47,87 +49,141 @@ Future loginAPI({
|
|||||||
void Function(User)? onLogin,
|
void Function(User)? onLogin,
|
||||||
void Function()? onSuccess,
|
void Function()? onSuccess,
|
||||||
}) async {
|
}) async {
|
||||||
Provider.of<KretaClient>(context, listen: false).userAgent =
|
Future testLogin(School school) async {
|
||||||
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
var user = User(
|
||||||
|
username: username,
|
||||||
|
password: password,
|
||||||
|
instituteCode: instituteCode,
|
||||||
|
name: 'Teszt Lajos',
|
||||||
|
student: Student(
|
||||||
|
birth: DateTime.now(),
|
||||||
|
id: const Uuid().v4(),
|
||||||
|
name: 'Teszt Lajos',
|
||||||
|
school: school,
|
||||||
|
yearId: '1',
|
||||||
|
parents: ['Teszt András', 'Teszt Linda'],
|
||||||
|
json: {"a": "b"},
|
||||||
|
address: '1117 Budapest, Gábor Dénes utca 4.',
|
||||||
|
),
|
||||||
|
role: Role.parent,
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, String> headers = {
|
if (onLogin != null) onLogin(user);
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
|
||||||
};
|
|
||||||
|
|
||||||
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
|
// store test user in db
|
||||||
.getAPI(KretaAPI.nonce, json: false);
|
await Provider.of<DatabaseProvider>(context, listen: false)
|
||||||
|
.store
|
||||||
|
.storeUser(user);
|
||||||
|
Provider.of<UserProvider>(context, listen: false).addUser(user);
|
||||||
|
Provider.of<UserProvider>(context, listen: false).setUser(user.id);
|
||||||
|
|
||||||
Nonce nonce = getNonce(nonceStr, username, instituteCode);
|
if (onSuccess != null) onSuccess();
|
||||||
headers.addAll(nonce.header());
|
|
||||||
|
|
||||||
Map? res = await Provider.of<KretaClient>(context, listen: false)
|
return LoginState.success;
|
||||||
.postAPI(KretaAPI.login,
|
}
|
||||||
headers: headers,
|
|
||||||
body: User.loginBody(
|
|
||||||
username: username,
|
|
||||||
password: password,
|
|
||||||
instituteCode: instituteCode,
|
|
||||||
));
|
|
||||||
if (res != null) {
|
|
||||||
if (res.containsKey("error")) {
|
|
||||||
if (res["error"] == "invalid_grant") {
|
|
||||||
return LoginState.invalidGrant;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (res.containsKey("access_token")) {
|
|
||||||
try {
|
|
||||||
Provider.of<KretaClient>(context, listen: false).accessToken =
|
|
||||||
res["access_token"];
|
|
||||||
Map? studentJson =
|
|
||||||
await Provider.of<KretaClient>(context, listen: false)
|
|
||||||
.getAPI(KretaAPI.student(instituteCode));
|
|
||||||
Student student = Student.fromJson(studentJson!);
|
|
||||||
var user = User(
|
|
||||||
username: username,
|
|
||||||
password: password,
|
|
||||||
instituteCode: instituteCode,
|
|
||||||
name: student.name,
|
|
||||||
student: student,
|
|
||||||
role: JwtUtils.getRoleFromJWT(res["access_token"])!,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (onLogin != null) onLogin(user);
|
// if institute matches one of test things do test login
|
||||||
|
if (instituteCode == 'refilc-test-sweden') {
|
||||||
|
School school = School(
|
||||||
|
city: "Stockholm",
|
||||||
|
instituteCode: "refilc-test-sweden",
|
||||||
|
name: "reFilc Test SE - Leo Ekström High School",
|
||||||
|
);
|
||||||
|
|
||||||
// Store User in the database
|
await testLogin(school);
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false)
|
} else if (instituteCode == 'refilc-test-spain') {
|
||||||
.store
|
School school = School(
|
||||||
.storeUser(user);
|
city: "Madrid",
|
||||||
Provider.of<UserProvider>(context, listen: false).addUser(user);
|
instituteCode: "refilc-test-spain",
|
||||||
Provider.of<UserProvider>(context, listen: false).setUser(user.id);
|
name: "reFilc Test ES - Emilio Obrero University",
|
||||||
|
);
|
||||||
|
|
||||||
// Get user data
|
await testLogin(school);
|
||||||
|
} else {
|
||||||
|
// normal login from here
|
||||||
|
Provider.of<KretaClient>(context, listen: false).userAgent =
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
||||||
|
|
||||||
|
Map<String, String> headers = {
|
||||||
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
|
};
|
||||||
|
|
||||||
|
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(KretaAPI.nonce, json: false);
|
||||||
|
|
||||||
|
Nonce nonce = getNonce(nonceStr, username, instituteCode);
|
||||||
|
headers.addAll(nonce.header());
|
||||||
|
|
||||||
|
Map? res = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.postAPI(KretaAPI.login,
|
||||||
|
headers: headers,
|
||||||
|
body: User.loginBody(
|
||||||
|
username: username,
|
||||||
|
password: password,
|
||||||
|
instituteCode: instituteCode,
|
||||||
|
));
|
||||||
|
if (res != null) {
|
||||||
|
if (res.containsKey("error")) {
|
||||||
|
if (res["error"] == "invalid_grant") {
|
||||||
|
return LoginState.invalidGrant;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (res.containsKey("access_token")) {
|
||||||
try {
|
try {
|
||||||
await Future.wait([
|
Provider.of<KretaClient>(context, listen: false).accessToken =
|
||||||
Provider.of<GradeProvider>(context, listen: false).fetch(),
|
res["access_token"];
|
||||||
Provider.of<TimetableProvider>(context, listen: false)
|
Map? studentJson =
|
||||||
.fetch(week: Week.current()),
|
await Provider.of<KretaClient>(context, listen: false)
|
||||||
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
.getAPI(KretaAPI.student(instituteCode));
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
Student student = Student.fromJson(studentJson!);
|
||||||
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
var user = User(
|
||||||
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
username: username,
|
||||||
Provider.of<EventProvider>(context, listen: false).fetch(),
|
password: password,
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
instituteCode: instituteCode,
|
||||||
]);
|
name: student.name,
|
||||||
|
student: student,
|
||||||
|
role: JwtUtils.getRoleFromJWT(res["access_token"])!,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (onLogin != null) onLogin(user);
|
||||||
|
|
||||||
|
// Store User in the database
|
||||||
|
await Provider.of<DatabaseProvider>(context, listen: false)
|
||||||
|
.store
|
||||||
|
.storeUser(user);
|
||||||
|
Provider.of<UserProvider>(context, listen: false).addUser(user);
|
||||||
|
Provider.of<UserProvider>(context, listen: false).setUser(user.id);
|
||||||
|
|
||||||
|
// Get user data
|
||||||
|
try {
|
||||||
|
await Future.wait([
|
||||||
|
Provider.of<GradeProvider>(context, listen: false).fetch(),
|
||||||
|
Provider.of<TimetableProvider>(context, listen: false)
|
||||||
|
.fetch(week: Week.current()),
|
||||||
|
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
||||||
|
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
||||||
|
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
||||||
|
Provider.of<EventProvider>(context, listen: false).fetch(),
|
||||||
|
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
||||||
|
]);
|
||||||
|
} catch (error) {
|
||||||
|
print("WARNING: failed to fetch user data: $error");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onSuccess != null) onSuccess();
|
||||||
|
|
||||||
|
return LoginState.success;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
print("WARNING: failed to fetch user data: $error");
|
print("ERROR: loginAPI: $error");
|
||||||
|
// maybe check debug mode
|
||||||
|
// ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("ERROR: $error")));
|
||||||
|
return LoginState.failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onSuccess != null) onSuccess();
|
|
||||||
|
|
||||||
return LoginState.success;
|
|
||||||
} catch (error) {
|
|
||||||
print("ERROR: loginAPI: $error");
|
|
||||||
// maybe check debug mode
|
|
||||||
// ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("ERROR: $error")));
|
|
||||||
return LoginState.failed;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return LoginState.failed;
|
return LoginState.failed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,24 +51,24 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
_liveActivitiesPlugin.areActivitiesEnabled().then((value) {
|
_liveActivitiesPlugin.areActivitiesEnabled().then((value) {
|
||||||
// Console log
|
// Console log
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print("Live card enabled: $value");
|
print("iOS LiveActivity enabled: $value");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
_liveActivitiesPlugin.init(appGroupId: "group.refilc.livecard");
|
_liveActivitiesPlugin.init(appGroupId: "group.refilc2.livecard");
|
||||||
|
|
||||||
_liveActivitiesPlugin.getAllActivitiesIds().then((value) {
|
_liveActivitiesPlugin.getAllActivitiesIds().then((value) {
|
||||||
_latestActivityId = value.isNotEmpty ? value.first : null;
|
_latestActivityId = value.isNotEmpty ? value.first : null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) => update());
|
|
||||||
_delay = settings.bellDelayEnabled
|
|
||||||
? Duration(seconds: settings.bellDelay)
|
|
||||||
: Duration.zero;
|
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_timer = Timer.periodic(const Duration(seconds: 1), (timer) => update());
|
||||||
|
_delay = settings.bellDelayEnabled
|
||||||
|
? Duration(seconds: settings.bellDelay)
|
||||||
|
: Duration.zero;
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -88,7 +88,7 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
static DateTime _now() {
|
static DateTime _now() {
|
||||||
// return DateTime(2023, 8, 31, 8, 0);
|
// return DateTime(2023, 9, 27, 9, 30);
|
||||||
return DateTime.now();
|
return DateTime.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
"index":
|
"index":
|
||||||
currentLesson != null ? '${currentLesson!.lessonIndex}. ' : "",
|
currentLesson != null ? '${currentLesson!.lessonIndex}. ' : "",
|
||||||
"title": currentLesson != null
|
"title": currentLesson != null
|
||||||
? ShortSubject.resolve(subject: currentLesson?.subject).capital()
|
? currentLesson?.subject.renamedTo ?? ShortSubject.resolve(subject: currentLesson?.subject).capital()
|
||||||
: "",
|
: "",
|
||||||
"subtitle": currentLesson?.room.replaceAll("_", " ") ?? "",
|
"subtitle": currentLesson?.room.replaceAll("_", " ") ?? "",
|
||||||
"description": currentLesson?.description ?? "",
|
"description": currentLesson?.description ?? "",
|
||||||
@@ -131,7 +131,7 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
_delay.inMilliseconds)
|
_delay.inMilliseconds)
|
||||||
.toString(),
|
.toString(),
|
||||||
"nextSubject": nextLesson != null
|
"nextSubject": nextLesson != null
|
||||||
? ShortSubject.resolve(subject: nextLesson?.subject).capital()
|
? nextLesson?.subject.renamedTo ?? ShortSubject.resolve(subject: nextLesson?.subject).capital()
|
||||||
: "",
|
: "",
|
||||||
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
|
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
|
||||||
};
|
};
|
||||||
@@ -160,7 +160,7 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
_delay.inMilliseconds)
|
_delay.inMilliseconds)
|
||||||
.toString(),
|
.toString(),
|
||||||
"nextSubject": (nextLesson != null
|
"nextSubject": (nextLesson != null
|
||||||
? ShortSubject.resolve(subject: nextLesson?.subject)
|
? nextLesson?.subject.renamedTo ?? ShortSubject.resolve(subject: nextLesson?.subject).capital()
|
||||||
: "")
|
: "")
|
||||||
.capital(),
|
.capital(),
|
||||||
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
|
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
|
||||||
@@ -196,7 +196,7 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print('ERROR: Unable to create or update iOS LiveCard!');
|
print('ERROR: Unable to create or update iOS LiveActivity!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
@@ -12,6 +14,7 @@ class StatusProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
StatusProvider() {
|
StatusProvider() {
|
||||||
_handleNetworkChanges();
|
_handleNetworkChanges();
|
||||||
|
_handleDNSFailure();
|
||||||
Connectivity().checkConnectivity().then((value) => _networkType = value);
|
Connectivity().checkConnectivity().then((value) => _networkType = value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,6 +27,7 @@ class StatusProvider extends ChangeNotifier {
|
|||||||
_networkType = event;
|
_networkType = event;
|
||||||
if (event == ConnectivityResult.none) {
|
if (event == ConnectivityResult.none) {
|
||||||
if (!_stack.contains(Status.network)) {
|
if (!_stack.contains(Status.network)) {
|
||||||
|
_stack.remove(Status.apiError);
|
||||||
_stack.insert(0, Status.network);
|
_stack.insert(0, Status.network);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -36,6 +40,31 @@ class StatusProvider extends ChangeNotifier {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _handleDNSFailure() {
|
||||||
|
try {
|
||||||
|
InternetAddress.lookup('api.refilc.hu').then((status) {
|
||||||
|
if (status.isEmpty) {
|
||||||
|
if (!_stack.contains(Status.network)) {
|
||||||
|
_stack.remove(Status.apiError);
|
||||||
|
_stack.insert(0, Status.network);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (_stack.contains(Status.network)) {
|
||||||
|
_stack.remove(Status.network);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} on SocketException catch (_) {
|
||||||
|
if (!_stack.contains(Status.network)) {
|
||||||
|
_stack.remove(Status.apiError);
|
||||||
|
_stack.insert(0, Status.network);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void triggerRequest(http.Response res) {
|
void triggerRequest(http.Response res) {
|
||||||
if (res.headers.containsKey("x-maintenance-mode") ||
|
if (res.headers.containsKey("x-maintenance-mode") ||
|
||||||
res.statusCode == 503) {
|
res.statusCode == 503) {
|
||||||
@@ -50,10 +79,12 @@ class StatusProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.body == "invalid_grant" ||
|
if (res.body == 'invalid_grant' ||
|
||||||
res.body.replaceAll(' ', '') == '' ||
|
res.body.replaceAll(' ', '') == '' ||
|
||||||
res.statusCode == 400) {
|
res.statusCode == 400) {
|
||||||
if (!_stack.contains(Status.apiError)) {
|
if (!_stack.contains(Status.apiError) &&
|
||||||
|
!_stack.contains(Status.network)) {
|
||||||
|
if (res.statusCode == 401) return;
|
||||||
_stack.insert(0, Status.apiError);
|
_stack.insert(0, Status.apiError);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,12 @@ class UpdateProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
// Check for new releases
|
// Check for new releases
|
||||||
if (_releases.isNotEmpty) {
|
if (_releases.isNotEmpty) {
|
||||||
_available = _releases.first.version
|
if (!_releases.first.prerelease) {
|
||||||
.compareTo(Version.fromString(currentVersion)) ==
|
_available = _releases.first.version
|
||||||
1;
|
.compareTo(Version.fromString(currentVersion)) ==
|
||||||
|
1;
|
||||||
|
}
|
||||||
|
|
||||||
// ignore: avoid_print
|
// ignore: avoid_print
|
||||||
if (_available) print("INFO: New update: ${releases.first.version}");
|
if (_available) print("INFO: New update: ${releases.first.version}");
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ class App extends StatelessWidget {
|
|||||||
create: (context) => HomeworkProvider(
|
create: (context) => HomeworkProvider(
|
||||||
context: context,
|
context: context,
|
||||||
database: database,
|
database: database,
|
||||||
|
user: user,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ChangeNotifierProvider<MessageProvider>(
|
ChangeNotifierProvider<MessageProvider>(
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ const settingsDB = DatabaseStruct("settings", {
|
|||||||
"accent_color": int, "news": int, "seen_news": String,
|
"accent_color": int, "news": int, "seen_news": String,
|
||||||
"developer_mode": int,
|
"developer_mode": int,
|
||||||
"update_channel": int, "config": String, "custom_accent_color": int,
|
"update_channel": int, "config": String, "custom_accent_color": int,
|
||||||
"custom_background_color": int, "custom_highlight_color": int, // general
|
"custom_background_color": int, "custom_highlight_color": int,
|
||||||
|
"custom_icon_color": int, "shadow_effect": int, // general
|
||||||
"grade_color1": int, "grade_color2": int, "grade_color3": int,
|
"grade_color1": int, "grade_color2": int, "grade_color3": int,
|
||||||
"grade_color4": int, "grade_color5": int, // grade colors
|
"grade_color4": int, "grade_color5": int, // grade colors
|
||||||
"vibration_strength": int, "ab_weeks": int, "swap_ab_weeks": int,
|
"vibration_strength": int, "ab_weeks": int, "swap_ab_weeks": int,
|
||||||
@@ -33,6 +34,7 @@ const settingsDB = DatabaseStruct("settings", {
|
|||||||
"renamed_subjects_italics": int, "renamed_teachers_enabled": int,
|
"renamed_subjects_italics": int, "renamed_teachers_enabled": int,
|
||||||
"renamed_teachers_italics": int,
|
"renamed_teachers_italics": int,
|
||||||
"live_activity_color": String,
|
"live_activity_color": String,
|
||||||
|
"welcome_message": String,
|
||||||
});
|
});
|
||||||
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
||||||
// YOU'VE BEEN WARNED!!!
|
// YOU'VE BEEN WARNED!!!
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class NotificationsHelper {
|
|||||||
if (userProvider.getUsers().length == 1) {
|
if (userProvider.getUsers().length == 1) {
|
||||||
await flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.show(
|
||||||
absence.id.hashCode,
|
absence.id.hashCode,
|
||||||
"title_absence".i18n,
|
"title_absence".i18n, // https://discord.com/channels/1111649116020285532/1153273625206591528
|
||||||
"body_absence".i18n.fill(
|
"body_absence".i18n.fill(
|
||||||
[
|
[
|
||||||
DateFormat("yyyy-MM-dd").format(absence.date),
|
DateFormat("yyyy-MM-dd").format(absence.date),
|
||||||
@@ -210,7 +210,7 @@ class NotificationsHelper {
|
|||||||
} else {
|
} else {
|
||||||
await flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.show(
|
||||||
absence.id.hashCode,
|
absence.id.hashCode,
|
||||||
"title_absence".i18n,
|
"title_absence".i18n, // https://discord.com/channels/1111649116020285532/1153273625206591528
|
||||||
"body_absence_multiuser".i18n.fill(
|
"body_absence_multiuser".i18n.fill(
|
||||||
[
|
[
|
||||||
userProvider.displayName!,
|
userProvider.displayName!,
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ class SubjectIconData {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
SubjectIconVariants createIcon({required IconData material, required IconData cupertino}) {
|
SubjectIconVariants createIcon(
|
||||||
|
{required IconData material, required IconData cupertino}) {
|
||||||
return {
|
return {
|
||||||
IconPack.material: material,
|
IconPack.material: material,
|
||||||
IconPack.cupertino: cupertino,
|
IconPack.cupertino: cupertino,
|
||||||
@@ -30,82 +31,224 @@ SubjectIconVariants createIcon({required IconData material, required IconData cu
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SubjectIcon {
|
class SubjectIcon {
|
||||||
static String resolveName({Subject? subject, String? subjectName}) => _resolve(subject: subject, subjectName: subjectName).name;
|
static String resolveName({GradeSubject? subject, String? subjectName}) =>
|
||||||
static IconData resolveVariant({Subject? subject, String? subjectName, required BuildContext context}) =>
|
_resolve(subject: subject, subjectName: subjectName).name;
|
||||||
_resolve(subject: subject, subjectName: subjectName).data[Provider.of<SettingsProvider>(context, listen: false).iconPack]!;
|
static IconData resolveVariant(
|
||||||
|
{GradeSubject? subject,
|
||||||
|
String? subjectName,
|
||||||
|
required BuildContext context}) =>
|
||||||
|
_resolve(subject: subject, subjectName: subjectName).data[
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false).iconPack]!;
|
||||||
|
|
||||||
static SubjectIconData _resolve({Subject? subject, String? subjectName}) {
|
static SubjectIconData _resolve(
|
||||||
|
{GradeSubject? subject, String? subjectName}) {
|
||||||
assert(!(subject == null && subjectName == null));
|
assert(!(subject == null && subjectName == null));
|
||||||
|
|
||||||
String name = (subject?.name ?? subjectName ?? "").toLowerCase().specialChars().trim();
|
String name = (subject?.name ?? subjectName ?? "")
|
||||||
String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
.toLowerCase()
|
||||||
|
.specialChars()
|
||||||
|
.trim();
|
||||||
|
String category =
|
||||||
|
subject?.category.description.toLowerCase().specialChars() ?? "";
|
||||||
|
|
||||||
// todo: check for categories
|
// todo: check for categories
|
||||||
if (RegExp("mate(k|matika)").hasMatch(name) || category == "matematika") {
|
if (RegExp("mate(k|matika)").hasMatch(name) || category == "matematika") {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.function, material: Icons.calculate_outlined), name: "function");
|
|
||||||
} else if (RegExp("magyar nyelv|nyelvtan").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.textformat_alt, material: Icons.spellcheck_outlined), name: "textformat.alt");
|
|
||||||
} else if (RegExp("irodalom").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.book, material: Icons.menu_book_outlined), name: "book");
|
|
||||||
} else if (RegExp("tor(i|tenelem)").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.compass, material: Icons.hourglass_empty_outlined), name: "safari");
|
|
||||||
} else if (RegExp("foldrajz").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.map, material: Icons.public_outlined), name: "map");
|
|
||||||
} else if (RegExp("rajz|muvtori|muveszet|vizualis").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.paintbrush, material: Icons.palette_outlined), name: "paintbrush");
|
|
||||||
} else if (RegExp("fizika").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.lightbulb, material: Icons.emoji_objects_outlined), name: "lightbulb");
|
|
||||||
} else if (RegExp("^enek|zene|szolfezs|zongora|korus").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.music_note, material: Icons.music_note_outlined), name: "music.note");
|
|
||||||
} else if (RegExp("^tes(i|tneveles)|sport").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.sportscourt, material: Icons.sports_soccer_outlined), name: "sportscourt");
|
|
||||||
} else if (RegExp("kemia").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.lab_flask, material: Icons.science_outlined), name: "testtube.2");
|
|
||||||
} else if (RegExp("biologia").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.paw, material: Icons.pets_outlined), name: "pawprint");
|
|
||||||
} else if (RegExp("kornyezet|termeszet ?(tudomany|ismeret)|hon( es nep)?ismeret").hasMatch(name)) {
|
|
||||||
return SubjectIconData(
|
return SubjectIconData(
|
||||||
data: createIcon(cupertino: CupertinoIcons.arrow_3_trianglepath, material: Icons.eco_outlined), name: "arrow.3.trianglepath");
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.function,
|
||||||
|
material: Icons.calculate_outlined),
|
||||||
|
name: "function");
|
||||||
|
} else if (RegExp("magyar nyelv|nyelvtan").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.textformat_alt,
|
||||||
|
material: Icons.spellcheck_outlined),
|
||||||
|
name: "textformat.alt");
|
||||||
|
} else if (RegExp("irodalom").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.book,
|
||||||
|
material: Icons.menu_book_outlined),
|
||||||
|
name: "book");
|
||||||
|
} else if (RegExp("tor(i|tenelem)").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.compass,
|
||||||
|
material: Icons.hourglass_empty_outlined),
|
||||||
|
name: "safari");
|
||||||
|
} else if (RegExp("foldrajz").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.map, material: Icons.public_outlined),
|
||||||
|
name: "map");
|
||||||
|
} else if (RegExp("rajz|muvtori|muveszet|vizualis").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.paintbrush,
|
||||||
|
material: Icons.palette_outlined),
|
||||||
|
name: "paintbrush");
|
||||||
|
} else if (RegExp("fizika").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.lightbulb,
|
||||||
|
material: Icons.emoji_objects_outlined),
|
||||||
|
name: "lightbulb");
|
||||||
|
} else if (RegExp("^enek|zene|szolfezs|zongora|korus").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.music_note,
|
||||||
|
material: Icons.music_note_outlined),
|
||||||
|
name: "music.note");
|
||||||
|
} else if (RegExp("^tes(i|tneveles)|sport").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.sportscourt,
|
||||||
|
material: Icons.sports_soccer_outlined),
|
||||||
|
name: "sportscourt");
|
||||||
|
} else if (RegExp("kemia").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.lab_flask,
|
||||||
|
material: Icons.science_outlined),
|
||||||
|
name: "testtube.2");
|
||||||
|
} else if (RegExp("biologia").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.paw, material: Icons.pets_outlined),
|
||||||
|
name: "pawprint");
|
||||||
|
} else if (RegExp(
|
||||||
|
"kornyezet|termeszet ?(tudomany|ismeret)|hon( es nep)?ismeret")
|
||||||
|
.hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.arrow_3_trianglepath,
|
||||||
|
material: Icons.eco_outlined),
|
||||||
|
name: "arrow.3.trianglepath");
|
||||||
} else if (RegExp("(hit|erkolcs)tan|vallas|etika").hasMatch(name)) {
|
} else if (RegExp("(hit|erkolcs)tan|vallas|etika").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.heart, material: Icons.favorite_border_outlined), name: "heart");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.heart,
|
||||||
|
material: Icons.favorite_border_outlined),
|
||||||
|
name: "heart");
|
||||||
} else if (RegExp("penzugy").hasMatch(name)) {
|
} else if (RegExp("penzugy").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.money_dollar, material: Icons.savings_outlined), name: "dollarsign");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.money_dollar,
|
||||||
|
material: Icons.savings_outlined),
|
||||||
|
name: "dollarsign");
|
||||||
} else if (RegExp("informatika|szoftver|iroda|digitalis").hasMatch(name)) {
|
} else if (RegExp("informatika|szoftver|iroda|digitalis").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.device_laptop, material: Icons.computer_outlined), name: "laptopcomputer");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.device_laptop,
|
||||||
|
material: Icons.computer_outlined),
|
||||||
|
name: "laptopcomputer");
|
||||||
} else if (RegExp("prog").hasMatch(name)) {
|
} else if (RegExp("prog").hasMatch(name)) {
|
||||||
return SubjectIconData(
|
return SubjectIconData(
|
||||||
data: createIcon(cupertino: CupertinoIcons.chevron_left_slash_chevron_right, material: Icons.code_outlined),
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.chevron_left_slash_chevron_right,
|
||||||
|
material: Icons.code_outlined),
|
||||||
name: "chevron.left.forwardslash.chevron.right");
|
name: "chevron.left.forwardslash.chevron.right");
|
||||||
} else if (RegExp("halozat").hasMatch(name)) {
|
} else if (RegExp("halozat").hasMatch(name)) {
|
||||||
return SubjectIconData(
|
return SubjectIconData(
|
||||||
data: createIcon(cupertino: CupertinoIcons.antenna_radiowaves_left_right, material: Icons.wifi_tethering_outlined),
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.antenna_radiowaves_left_right,
|
||||||
|
material: Icons.wifi_tethering_outlined),
|
||||||
name: "antenna.radiowaves.left.and.right");
|
name: "antenna.radiowaves.left.and.right");
|
||||||
} else if (RegExp("szinhaz").hasMatch(name)) {
|
} else if (RegExp("szinhaz").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.hifispeaker, material: Icons.theater_comedy_outlined), name: "hifispeaker");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.hifispeaker,
|
||||||
|
material: Icons.theater_comedy_outlined),
|
||||||
|
name: "hifispeaker");
|
||||||
} else if (RegExp("film|media").hasMatch(name)) {
|
} else if (RegExp("film|media").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.film, material: Icons.theaters_outlined), name: "film");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.film,
|
||||||
|
material: Icons.theaters_outlined),
|
||||||
|
name: "film");
|
||||||
} else if (RegExp("elektro(tech)?nika").hasMatch(name)) {
|
} else if (RegExp("elektro(tech)?nika").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.bolt, material: Icons.electrical_services_outlined), name: "bolt");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.bolt,
|
||||||
|
material: Icons.electrical_services_outlined),
|
||||||
|
name: "bolt");
|
||||||
} else if (RegExp("gepesz|mernok|ipar").hasMatch(name)) {
|
} else if (RegExp("gepesz|mernok|ipar").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.wrench, material: Icons.precision_manufacturing_outlined), name: "wrench");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.wrench,
|
||||||
|
material: Icons.precision_manufacturing_outlined),
|
||||||
|
name: "wrench");
|
||||||
} else if (RegExp("technika").hasMatch(name)) {
|
} else if (RegExp("technika").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.hammer, material: Icons.build_outlined), name: "hammer");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.hammer, material: Icons.build_outlined),
|
||||||
|
name: "hammer");
|
||||||
} else if (RegExp("tanc").hasMatch(name)) {
|
} else if (RegExp("tanc").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.music_mic, material: Icons.speaker_outlined), name: "music.mic");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.music_mic,
|
||||||
|
material: Icons.speaker_outlined),
|
||||||
|
name: "music.mic");
|
||||||
} else if (RegExp("filozofia").hasMatch(name)) {
|
} else if (RegExp("filozofia").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.bubble_left, material: Icons.psychology_outlined), name: "bubble.left");
|
return SubjectIconData(
|
||||||
} else if (RegExp("osztaly(fonoki|kozosseg)").hasMatch(name) || name == "ofo") {
|
data: createIcon(
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.group, material: Icons.groups_outlined), name: "person.3");
|
cupertino: CupertinoIcons.bubble_left,
|
||||||
|
material: Icons.psychology_outlined),
|
||||||
|
name: "bubble.left");
|
||||||
|
} else if (RegExp("osztaly(fonoki|kozosseg)").hasMatch(name) ||
|
||||||
|
name == "ofo") {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.group, material: Icons.groups_outlined),
|
||||||
|
name: "person.3");
|
||||||
} else if (RegExp("gazdasag").hasMatch(name)) {
|
} else if (RegExp("gazdasag").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.chart_pie, material: Icons.account_balance_outlined), name: "chart.pie");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.chart_pie,
|
||||||
|
material: Icons.account_balance_outlined),
|
||||||
|
name: "chart.pie");
|
||||||
} else if (RegExp("szorgalom").hasMatch(name)) {
|
} else if (RegExp("szorgalom").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.checkmark_seal, material: Icons.verified_outlined), name: "checkmark.seal");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.checkmark_seal,
|
||||||
|
material: Icons.verified_outlined),
|
||||||
|
name: "checkmark.seal");
|
||||||
} else if (RegExp("magatartas").hasMatch(name)) {
|
} else if (RegExp("magatartas").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.smiley, material: Icons.emoji_people_outlined), name: "face.smiling");
|
return SubjectIconData(
|
||||||
} else if (RegExp("angol|nemet|francia|olasz|orosz|spanyol|latin|kinai|nyelv").hasMatch(name)) {
|
data: createIcon(
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.globe, material: Icons.translate_outlined), name: "globe");
|
cupertino: CupertinoIcons.smiley,
|
||||||
|
material: Icons.emoji_people_outlined),
|
||||||
|
name: "face.smiling");
|
||||||
|
} else if (RegExp(
|
||||||
|
"angol|nemet|francia|olasz|orosz|spanyol|latin|kinai|nyelv")
|
||||||
|
.hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.globe,
|
||||||
|
material: Icons.translate_outlined),
|
||||||
|
name: "globe");
|
||||||
} else if (RegExp("linux").hasMatch(name)) {
|
} else if (RegExp("linux").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(material: FilcIcons.linux, cupertino: FilcIcons.linux));
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
material: FilcIcons.linux, cupertino: FilcIcons.linux));
|
||||||
|
} else if (RegExp("adatbazis").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.table_badge_more,
|
||||||
|
material: Icons.table_chart),
|
||||||
|
name: "table.badge.more");
|
||||||
|
} else if (RegExp("asztali alkalmazasok").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.macwindow,
|
||||||
|
material: Icons.desktop_windows_outlined),
|
||||||
|
name: "macwindow");
|
||||||
|
} else if (RegExp("projekt").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.person_3_fill,
|
||||||
|
material: Icons.groups_3),
|
||||||
|
name: "person.3.fill");
|
||||||
}
|
}
|
||||||
|
|
||||||
return SubjectIconData();
|
return SubjectIconData();
|
||||||
@@ -113,10 +256,13 @@ class SubjectIcon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShortSubject {
|
class ShortSubject {
|
||||||
static String resolve({Subject? subject, String? subjectName}) {
|
static String resolve({GradeSubject? subject, String? subjectName}) {
|
||||||
assert(!(subject == null && subjectName == null));
|
assert(!(subject == null && subjectName == null));
|
||||||
|
|
||||||
String name = (subject?.name ?? subjectName ?? "").toLowerCase().specialChars().trim();
|
String name = (subject?.name ?? subjectName ?? "")
|
||||||
|
.toLowerCase()
|
||||||
|
.specialChars()
|
||||||
|
.trim();
|
||||||
// String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
// String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
||||||
|
|
||||||
if (RegExp("magyar irodalom").hasMatch(name)) {
|
if (RegExp("magyar irodalom").hasMatch(name)) {
|
||||||
@@ -131,7 +277,9 @@ class ShortSubject {
|
|||||||
return "Tesi";
|
return "Tesi";
|
||||||
} else if (RegExp("tortenelem").hasMatch(name)) {
|
} else if (RegExp("tortenelem").hasMatch(name)) {
|
||||||
return "Töri";
|
return "Töri";
|
||||||
} else if (RegExp("(angol|nemet|francia|olasz|orosz|spanyol|latin|kinai) nyelv").hasMatch(name)) {
|
} else if (RegExp(
|
||||||
|
"(angol|nemet|francia|olasz|orosz|spanyol|latin|kinai) nyelv")
|
||||||
|
.hasMatch(name)) {
|
||||||
return (subject?.name ?? subjectName ?? "?").replaceAll(" nyelv", "");
|
return (subject?.name ?? subjectName ?? "?").replaceAll(" nyelv", "");
|
||||||
} else if (RegExp("informatika").hasMatch(name)) {
|
} else if (RegExp("informatika").hasMatch(name)) {
|
||||||
return "Infó";
|
return "Infó";
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class Ad {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory Ad.fromJson(Map json) {
|
factory Ad.fromJson(Map json) {
|
||||||
print(json);
|
|
||||||
return Ad(
|
return Ad(
|
||||||
title: json['title'] ?? 'Ad',
|
title: json['title'] ?? 'Ad',
|
||||||
description: json['description'] ?? '',
|
description: json['description'] ?? '',
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
Color _customAccentColor;
|
Color _customAccentColor;
|
||||||
Color _customBackgroundColor;
|
Color _customBackgroundColor;
|
||||||
Color _customHighlightColor;
|
Color _customHighlightColor;
|
||||||
|
Color _customIconColor;
|
||||||
|
bool _shadowEffect;
|
||||||
List<String> _premiumScopes;
|
List<String> _premiumScopes;
|
||||||
String _premiumAccessToken;
|
String _premiumAccessToken;
|
||||||
String _premiumLogin;
|
String _premiumLogin;
|
||||||
@@ -76,6 +78,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool _renamedTeachersEnabled;
|
bool _renamedTeachersEnabled;
|
||||||
bool _renamedTeachersItalics;
|
bool _renamedTeachersItalics;
|
||||||
Color _liveActivityColor;
|
Color _liveActivityColor;
|
||||||
|
String _welcomeMessage;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
DatabaseProvider? database,
|
DatabaseProvider? database,
|
||||||
@@ -111,6 +114,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required Color customAccentColor,
|
required Color customAccentColor,
|
||||||
required Color customBackgroundColor,
|
required Color customBackgroundColor,
|
||||||
required Color customHighlightColor,
|
required Color customHighlightColor,
|
||||||
|
required Color customIconColor,
|
||||||
|
required bool shadowEffect,
|
||||||
required List<String> premiumScopes,
|
required List<String> premiumScopes,
|
||||||
required String premiumAccessToken,
|
required String premiumAccessToken,
|
||||||
required String premiumLogin,
|
required String premiumLogin,
|
||||||
@@ -120,6 +125,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required bool renameTeachersEnabled,
|
required bool renameTeachersEnabled,
|
||||||
required bool renameTeachersItalics,
|
required bool renameTeachersItalics,
|
||||||
required Color liveActivityColor,
|
required Color liveActivityColor,
|
||||||
|
required String welcomeMessage,
|
||||||
}) : _database = database,
|
}) : _database = database,
|
||||||
_language = language,
|
_language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
@@ -153,6 +159,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_customAccentColor = customAccentColor,
|
_customAccentColor = customAccentColor,
|
||||||
_customBackgroundColor = customBackgroundColor,
|
_customBackgroundColor = customBackgroundColor,
|
||||||
_customHighlightColor = customHighlightColor,
|
_customHighlightColor = customHighlightColor,
|
||||||
|
_customIconColor = customIconColor,
|
||||||
|
_shadowEffect = shadowEffect,
|
||||||
_premiumScopes = premiumScopes,
|
_premiumScopes = premiumScopes,
|
||||||
_premiumAccessToken = premiumAccessToken,
|
_premiumAccessToken = premiumAccessToken,
|
||||||
_premiumLogin = premiumLogin,
|
_premiumLogin = premiumLogin,
|
||||||
@@ -161,7 +169,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_renamedSubjectsItalics = renameSubjectsItalics,
|
_renamedSubjectsItalics = renameSubjectsItalics,
|
||||||
_renamedTeachersEnabled = renameTeachersEnabled,
|
_renamedTeachersEnabled = renameTeachersEnabled,
|
||||||
_renamedTeachersItalics = renameTeachersItalics,
|
_renamedTeachersItalics = renameTeachersItalics,
|
||||||
_liveActivityColor = liveActivityColor;
|
_liveActivityColor = liveActivityColor,
|
||||||
|
_welcomeMessage = welcomeMessage;
|
||||||
|
|
||||||
factory SettingsProvider.fromMap(Map map,
|
factory SettingsProvider.fromMap(Map map,
|
||||||
{required DatabaseProvider database}) {
|
{required DatabaseProvider database}) {
|
||||||
@@ -214,6 +223,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
customAccentColor: Color(map["custom_accent_color"]),
|
customAccentColor: Color(map["custom_accent_color"]),
|
||||||
customBackgroundColor: Color(map["custom_background_color"]),
|
customBackgroundColor: Color(map["custom_background_color"]),
|
||||||
customHighlightColor: Color(map["custom_highlight_color"]),
|
customHighlightColor: Color(map["custom_highlight_color"]),
|
||||||
|
customIconColor: Color(map["custom_icon_color"]),
|
||||||
|
shadowEffect: map["shadow_effect"] == 1,
|
||||||
premiumScopes: jsonDecode(map["premium_scopes"]).cast<String>(),
|
premiumScopes: jsonDecode(map["premium_scopes"]).cast<String>(),
|
||||||
premiumAccessToken: map["premium_token"],
|
premiumAccessToken: map["premium_token"],
|
||||||
premiumLogin: map["premium_login"],
|
premiumLogin: map["premium_login"],
|
||||||
@@ -223,6 +234,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersEnabled: map["renamed_teachers_enabled"] == 1,
|
renameTeachersEnabled: map["renamed_teachers_enabled"] == 1,
|
||||||
renameTeachersItalics: map["renamed_teachers_italics"] == 1,
|
renameTeachersItalics: map["renamed_teachers_italics"] == 1,
|
||||||
liveActivityColor: Color(map["live_activity_color"]),
|
liveActivityColor: Color(map["live_activity_color"]),
|
||||||
|
welcomeMessage: map["welcome_message"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +275,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"custom_accent_color": _customAccentColor.value,
|
"custom_accent_color": _customAccentColor.value,
|
||||||
"custom_background_color": _customBackgroundColor.value,
|
"custom_background_color": _customBackgroundColor.value,
|
||||||
"custom_highlight_color": _customHighlightColor.value,
|
"custom_highlight_color": _customHighlightColor.value,
|
||||||
|
"custom_icon_color": _customIconColor.value,
|
||||||
|
"shadow_effect": _shadowEffect ? 1 : 0,
|
||||||
"premium_scopes": jsonEncode(_premiumScopes),
|
"premium_scopes": jsonEncode(_premiumScopes),
|
||||||
"premium_token": _premiumAccessToken,
|
"premium_token": _premiumAccessToken,
|
||||||
"premium_login": _premiumLogin,
|
"premium_login": _premiumLogin,
|
||||||
@@ -272,6 +286,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"renamed_teachers_enabled": _renamedTeachersEnabled ? 1 : 0,
|
"renamed_teachers_enabled": _renamedTeachersEnabled ? 1 : 0,
|
||||||
"renamed_teachers_italics": _renamedTeachersItalics ? 1 : 0,
|
"renamed_teachers_italics": _renamedTeachersItalics ? 1 : 0,
|
||||||
"live_activity_color": _liveActivityColor.value,
|
"live_activity_color": _liveActivityColor.value,
|
||||||
|
"welcome_message": _welcomeMessage,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,6 +331,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
customAccentColor: const Color(0xff3D7BF4),
|
customAccentColor: const Color(0xff3D7BF4),
|
||||||
customBackgroundColor: const Color(0xff000000),
|
customBackgroundColor: const Color(0xff000000),
|
||||||
customHighlightColor: const Color(0xff222222),
|
customHighlightColor: const Color(0xff222222),
|
||||||
|
customIconColor: const Color(0x00000000),
|
||||||
|
shadowEffect: true,
|
||||||
premiumScopes: [PremiumScopes.all],
|
premiumScopes: [PremiumScopes.all],
|
||||||
premiumAccessToken: "igen",
|
premiumAccessToken: "igen",
|
||||||
premiumLogin: "igen",
|
premiumLogin: "igen",
|
||||||
@@ -325,6 +342,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersEnabled: false,
|
renameTeachersEnabled: false,
|
||||||
renameTeachersItalics: false,
|
renameTeachersItalics: false,
|
||||||
liveActivityColor: const Color(0xFF676767),
|
liveActivityColor: const Color(0xFF676767),
|
||||||
|
welcomeMessage: '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,6 +382,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
: _customAccentColor;
|
: _customAccentColor;
|
||||||
Color? get customBackgroundColor => _customBackgroundColor;
|
Color? get customBackgroundColor => _customBackgroundColor;
|
||||||
Color? get customHighlightColor => _customHighlightColor;
|
Color? get customHighlightColor => _customHighlightColor;
|
||||||
|
Color? get customIconColor => _customIconColor;
|
||||||
|
bool get shadowEffect => _shadowEffect;
|
||||||
List<String> get premiumScopes => _premiumScopes;
|
List<String> get premiumScopes => _premiumScopes;
|
||||||
String get premiumAccessToken => _premiumAccessToken;
|
String get premiumAccessToken => _premiumAccessToken;
|
||||||
String get premiumLogin => _premiumLogin;
|
String get premiumLogin => _premiumLogin;
|
||||||
@@ -373,6 +393,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool get renamedTeachersEnabled => _renamedTeachersEnabled;
|
bool get renamedTeachersEnabled => _renamedTeachersEnabled;
|
||||||
bool get renamedTeachersItalics => _renamedTeachersItalics;
|
bool get renamedTeachersItalics => _renamedTeachersItalics;
|
||||||
Color get liveActivityColor => _liveActivityColor;
|
Color get liveActivityColor => _liveActivityColor;
|
||||||
|
String get welcomeMessage => _welcomeMessage;
|
||||||
|
|
||||||
Future<void> update({
|
Future<void> update({
|
||||||
bool store = true,
|
bool store = true,
|
||||||
@@ -408,6 +429,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
Color? customAccentColor,
|
Color? customAccentColor,
|
||||||
Color? customBackgroundColor,
|
Color? customBackgroundColor,
|
||||||
Color? customHighlightColor,
|
Color? customHighlightColor,
|
||||||
|
Color? customIconColor,
|
||||||
|
bool? shadowEffect,
|
||||||
List<String>? premiumScopes,
|
List<String>? premiumScopes,
|
||||||
String? premiumAccessToken,
|
String? premiumAccessToken,
|
||||||
String? premiumLogin,
|
String? premiumLogin,
|
||||||
@@ -417,6 +440,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool? renamedTeachersEnabled,
|
bool? renamedTeachersEnabled,
|
||||||
bool? renamedTeachersItalics,
|
bool? renamedTeachersItalics,
|
||||||
Color? liveActivityColor,
|
Color? liveActivityColor,
|
||||||
|
String? welcomeMessage,
|
||||||
}) async {
|
}) async {
|
||||||
if (language != null && language != _language) _language = language;
|
if (language != null && language != _language) _language = language;
|
||||||
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
||||||
@@ -503,6 +527,12 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
customHighlightColor != _customHighlightColor) {
|
customHighlightColor != _customHighlightColor) {
|
||||||
_customHighlightColor = customHighlightColor;
|
_customHighlightColor = customHighlightColor;
|
||||||
}
|
}
|
||||||
|
if (customIconColor != null && customIconColor != _customIconColor) {
|
||||||
|
_customIconColor = customIconColor;
|
||||||
|
}
|
||||||
|
if (shadowEffect != null && shadowEffect != _shadowEffect) {
|
||||||
|
_shadowEffect = shadowEffect;
|
||||||
|
}
|
||||||
if (premiumScopes != null && premiumScopes != _premiumScopes) {
|
if (premiumScopes != null && premiumScopes != _premiumScopes) {
|
||||||
_premiumScopes = premiumScopes;
|
_premiumScopes = premiumScopes;
|
||||||
}
|
}
|
||||||
@@ -535,6 +565,9 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
if (liveActivityColor != null && liveActivityColor != _liveActivityColor) {
|
if (liveActivityColor != null && liveActivityColor != _liveActivityColor) {
|
||||||
_liveActivityColor = liveActivityColor;
|
_liveActivityColor = liveActivityColor;
|
||||||
}
|
}
|
||||||
|
if (welcomeMessage != null && welcomeMessage != _welcomeMessage) {
|
||||||
|
_welcomeMessage = welcomeMessage;
|
||||||
|
}
|
||||||
if (store) await _database?.store.storeSettings(this);
|
if (store) await _database?.store.storeSettings(this);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ class SharedTheme {
|
|||||||
Color backgroundColor;
|
Color backgroundColor;
|
||||||
Color panelsColor;
|
Color panelsColor;
|
||||||
Color accentColor;
|
Color accentColor;
|
||||||
|
Color iconColor;
|
||||||
|
bool shadowEffect;
|
||||||
|
SharedGradeColors gradeColors;
|
||||||
|
|
||||||
SharedTheme({
|
SharedTheme({
|
||||||
required this.json,
|
required this.json,
|
||||||
@@ -17,9 +20,12 @@ class SharedTheme {
|
|||||||
required this.backgroundColor,
|
required this.backgroundColor,
|
||||||
required this.panelsColor,
|
required this.panelsColor,
|
||||||
required this.accentColor,
|
required this.accentColor,
|
||||||
|
required this.iconColor,
|
||||||
|
required this.shadowEffect,
|
||||||
|
required this.gradeColors,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory SharedTheme.fromJson(Map json) {
|
factory SharedTheme.fromJson(Map json, SharedGradeColors gradeColors) {
|
||||||
return SharedTheme(
|
return SharedTheme(
|
||||||
json: json,
|
json: json,
|
||||||
id: json['public_id'],
|
id: json['public_id'],
|
||||||
@@ -28,6 +34,47 @@ class SharedTheme {
|
|||||||
backgroundColor: Color(json['background_color']),
|
backgroundColor: Color(json['background_color']),
|
||||||
panelsColor: Color(json['panels_color']),
|
panelsColor: Color(json['panels_color']),
|
||||||
accentColor: Color(json['accent_color']),
|
accentColor: Color(json['accent_color']),
|
||||||
|
iconColor: Color(json['icon_color']),
|
||||||
|
shadowEffect: json['shadow_effect'] ?? true,
|
||||||
|
gradeColors: gradeColors,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SharedGradeColors {
|
||||||
|
Map json;
|
||||||
|
String id;
|
||||||
|
bool isPublic;
|
||||||
|
String nickname;
|
||||||
|
Color fiveColor;
|
||||||
|
Color fourColor;
|
||||||
|
Color threeColor;
|
||||||
|
Color twoColor;
|
||||||
|
Color oneColor;
|
||||||
|
|
||||||
|
SharedGradeColors({
|
||||||
|
required this.json,
|
||||||
|
required this.id,
|
||||||
|
this.isPublic = false,
|
||||||
|
this.nickname = 'Anonymous',
|
||||||
|
required this.fiveColor,
|
||||||
|
required this.fourColor,
|
||||||
|
required this.threeColor,
|
||||||
|
required this.twoColor,
|
||||||
|
required this.oneColor,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SharedGradeColors.fromJson(Map json) {
|
||||||
|
return SharedGradeColors(
|
||||||
|
json: json,
|
||||||
|
id: json['public_id'],
|
||||||
|
isPublic: json['is_public'] ?? false,
|
||||||
|
nickname: json['nickname'] ?? 'Anonymous',
|
||||||
|
fiveColor: Color(json['five_color']),
|
||||||
|
fourColor: Color(json['four_color']),
|
||||||
|
threeColor: Color(json['three_color']),
|
||||||
|
twoColor: Color(json['two_color']),
|
||||||
|
oneColor: Color(json['one_color']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,21 @@ enum SubjectLessonCountUpdateState { ready, updating }
|
|||||||
|
|
||||||
class SubjectLessonCount {
|
class SubjectLessonCount {
|
||||||
DateTime lastUpdated;
|
DateTime lastUpdated;
|
||||||
Map<Subject, int> subjects;
|
Map<GradeSubject, int> subjects;
|
||||||
SubjectLessonCountUpdateState state;
|
SubjectLessonCountUpdateState state;
|
||||||
|
|
||||||
SubjectLessonCount({required this.lastUpdated, required this.subjects, this.state = SubjectLessonCountUpdateState.ready});
|
SubjectLessonCount(
|
||||||
|
{required this.lastUpdated,
|
||||||
|
required this.subjects,
|
||||||
|
this.state = SubjectLessonCountUpdateState.ready});
|
||||||
|
|
||||||
factory SubjectLessonCount.fromMap(Map json) {
|
factory SubjectLessonCount.fromMap(Map json) {
|
||||||
return SubjectLessonCount(
|
return SubjectLessonCount(
|
||||||
lastUpdated: DateTime.fromMillisecondsSinceEpoch(json["last_updated"] ?? 0),
|
lastUpdated:
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(json["last_updated"] ?? 0),
|
||||||
subjects: ((json["subjects"] as Map?) ?? {}).map(
|
subjects: ((json["subjects"] as Map?) ?? {}).map(
|
||||||
(key, value) => MapEntry(
|
(key, value) => MapEntry(
|
||||||
Subject(id: key, name: "", category: Category.fromJson({})),
|
GradeSubject(id: key, name: "", category: Category.fromJson({})),
|
||||||
value,
|
value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
import 'package:filcnaplo_kreta_api/client/api.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/student.dart';
|
import 'package:filcnaplo_kreta_api/models/student.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
@@ -43,7 +44,16 @@ class User {
|
|||||||
username: map["username"],
|
username: map["username"],
|
||||||
password: map["password"],
|
password: map["password"],
|
||||||
name: map["name"].trim(),
|
name: map["name"].trim(),
|
||||||
student: Student.fromJson(jsonDecode(map["student"])),
|
student: map["student"] != 'null'
|
||||||
|
? Student.fromJson(jsonDecode(map["student"]))
|
||||||
|
: Student(
|
||||||
|
id: const Uuid().v4(),
|
||||||
|
name: 'Ismeretlen Diák',
|
||||||
|
school: School(instituteCode: '', name: '', city: ''),
|
||||||
|
birth: DateTime.now(),
|
||||||
|
yearId: '1',
|
||||||
|
parents: [],
|
||||||
|
),
|
||||||
role: Role.values[map["role"] ?? 0],
|
role: Role.values[map["role"] ?? 0],
|
||||||
nickname: map["nickname"] ?? "",
|
nickname: map["nickname"] ?? "",
|
||||||
picture: map["picture"] ?? "",
|
picture: map["picture"] ?? "",
|
||||||
@@ -93,4 +103,13 @@ class User {
|
|||||||
"refresh_user_data": "false",
|
"refresh_user_data": "false",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Map<String, Object?> logoutBody({
|
||||||
|
required String refreshToken,
|
||||||
|
}) {
|
||||||
|
return {
|
||||||
|
"refresh_token": refreshToken,
|
||||||
|
"client_id": KretaAPI.clientId,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
|||||||
gradeProvider.grades, gradeProvider.lastSeenDate);
|
gradeProvider.grades, gradeProvider.lastSeenDate);
|
||||||
if (settingsProvider.gradeOpeningFun) {
|
if (settingsProvider.gradeOpeningFun) {
|
||||||
items.addAll(
|
items.addAll(
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
await getFilterWidgets(FilterType.newGrades, context: context));
|
await getFilterWidgets(FilterType.newGrades, context: context));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -213,19 +214,21 @@ Widget filterItemBuilder(
|
|||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor.withOpacity(
|
offset: const Offset(0, 21),
|
||||||
Theme.of(context).shadowColor.opacity *
|
blurRadius: 23.0,
|
||||||
CurvedAnimation(
|
color: Theme.of(context).shadowColor.withOpacity(
|
||||||
parent: CurvedAnimation(
|
Theme.of(context).shadowColor.opacity *
|
||||||
parent: animation,
|
CurvedAnimation(
|
||||||
curve: Curves.easeInOutCubic),
|
parent: CurvedAnimation(
|
||||||
curve: const Interval(2 / 3, 1.0),
|
parent: animation,
|
||||||
).value,
|
curve: Curves.easeInOutCubic),
|
||||||
),
|
curve: const Interval(2 / 3, 1.0),
|
||||||
),
|
).value,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: child,
|
child: child,
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
|
|
||||||
GradeCalculatorProvider calculatorProvider =
|
GradeCalculatorProvider calculatorProvider =
|
||||||
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
||||||
SettingsProvider settingsProvider =
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
Provider.of<SettingsProvider>(context);
|
|
||||||
// Test order:
|
// Test order:
|
||||||
// description
|
// description
|
||||||
// mode
|
// mode
|
||||||
@@ -50,7 +49,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = subjectName;
|
title = subjectName;
|
||||||
isTitleItalic = grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
isTitleItalic =
|
||||||
|
grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test order:
|
// Test order:
|
||||||
@@ -62,7 +62,9 @@ class GradeTile extends StatelessWidget {
|
|||||||
? modeDescription
|
? modeDescription
|
||||||
: ""
|
: ""
|
||||||
: subjectName;
|
: subjectName;
|
||||||
isSubtitleItalic = isSubjectView ? false : grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
isSubtitleItalic = isSubjectView
|
||||||
|
? false
|
||||||
|
: grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
} else {
|
} else {
|
||||||
subtitle = grade.value.valueName.split("(")[0];
|
subtitle = grade.value.valueName.split("(")[0];
|
||||||
}
|
}
|
||||||
@@ -127,9 +129,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontStyle: isTitleItalic
|
fontStyle: isTitleItalic ? FontStyle.italic : null),
|
||||||
? FontStyle.italic
|
|
||||||
: null),
|
|
||||||
),
|
),
|
||||||
subtitle: subtitle != ""
|
subtitle: subtitle != ""
|
||||||
? censored
|
? censored
|
||||||
@@ -149,7 +149,10 @@ class GradeTile extends StatelessWidget {
|
|||||||
subtitle,
|
subtitle,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w500, fontStyle: isSubtitleItalic ? FontStyle.italic : null),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontStyle:
|
||||||
|
isSubtitleItalic ? FontStyle.italic : null),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
trailing: isSubjectView
|
trailing: isSubjectView
|
||||||
@@ -210,8 +213,8 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
GradeValue value = this.value;
|
GradeValue value = this.value;
|
||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
||||||
|
|
||||||
Color color =
|
Color color = this.color ??
|
||||||
this.color ?? gradeColor(context: context, value: value.value, nocolor: nocolor);
|
gradeColor(context: context, value: value.value, nocolor: nocolor);
|
||||||
Widget valueText;
|
Widget valueText;
|
||||||
final percentage = value.percentage;
|
final percentage = value.percentage;
|
||||||
|
|
||||||
@@ -283,7 +286,9 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
color: color.withOpacity(contrast ? 1.0 : .25),
|
color: color.withOpacity(contrast ? 1.0 : .25),
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
if (shadow)
|
if (shadow &&
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false)
|
||||||
|
.shadowEffect)
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: color,
|
color: color,
|
||||||
blurRadius: 62.0,
|
blurRadius: 62.0,
|
||||||
|
|||||||
1
filcnaplo/linux/.gitignore
vendored
1
filcnaplo/linux/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
flutter/ephemeral
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
project(runner LANGUAGES CXX)
|
|
||||||
|
|
||||||
set(BINARY_NAME "filcnaplo")
|
|
||||||
set(APPLICATION_ID "hu.filc.filcnaplo")
|
|
||||||
|
|
||||||
cmake_policy(SET CMP0063 NEW)
|
|
||||||
|
|
||||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
|
||||||
|
|
||||||
# Root filesystem for cross-building.
|
|
||||||
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
|
||||||
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
|
|
||||||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Configure build options.
|
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
||||||
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
|
||||||
STRING "Flutter build mode" FORCE)
|
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
||||||
"Debug" "Profile" "Release")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Compilation settings that should be applied to most targets.
|
|
||||||
function(APPLY_STANDARD_SETTINGS TARGET)
|
|
||||||
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
|
||||||
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
|
||||||
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
|
||||||
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
|
||||||
|
|
||||||
# Flutter library and tool build rules.
|
|
||||||
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
|
||||||
|
|
||||||
# System-level dependencies.
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
|
||||||
|
|
||||||
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
|
||||||
|
|
||||||
# Application build
|
|
||||||
add_executable(${BINARY_NAME}
|
|
||||||
"main.cc"
|
|
||||||
"my_application.cc"
|
|
||||||
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
|
||||||
)
|
|
||||||
apply_standard_settings(${BINARY_NAME})
|
|
||||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
|
||||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
|
||||||
add_dependencies(${BINARY_NAME} flutter_assemble)
|
|
||||||
# Only the install-generated bundle's copy of the executable will launch
|
|
||||||
# correctly, since the resources must in the right relative locations. To avoid
|
|
||||||
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
|
||||||
# the default top-level location.
|
|
||||||
set_target_properties(${BINARY_NAME}
|
|
||||||
PROPERTIES
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Generated plugin build rules, which manage building the plugins and adding
|
|
||||||
# them to the application.
|
|
||||||
include(flutter/generated_plugins.cmake)
|
|
||||||
|
|
||||||
|
|
||||||
# === Installation ===
|
|
||||||
# By default, "installing" just makes a relocatable bundle in the build
|
|
||||||
# directory.
|
|
||||||
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
|
|
||||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
||||||
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Start with a clean build bundle directory every time.
|
|
||||||
install(CODE "
|
|
||||||
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
|
|
||||||
" COMPONENT Runtime)
|
|
||||||
|
|
||||||
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
|
||||||
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
|
||||||
|
|
||||||
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
|
|
||||||
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
|
|
||||||
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
|
|
||||||
if(PLUGIN_BUNDLED_LIBRARIES)
|
|
||||||
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
|
|
||||||
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Fully re-copy the assets directory on each build to avoid having stale files
|
|
||||||
# from a previous install.
|
|
||||||
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
|
||||||
install(CODE "
|
|
||||||
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
|
||||||
" COMPONENT Runtime)
|
|
||||||
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
|
||||||
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
|
||||||
|
|
||||||
# Install the AOT library on non-Debug builds only.
|
|
||||||
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
||||||
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
endif()
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
|
|
||||||
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
|
||||||
|
|
||||||
# Configuration provided via flutter tool.
|
|
||||||
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
|
||||||
|
|
||||||
# TODO: Move the rest of this into files in ephemeral. See
|
|
||||||
# https://github.com/flutter/flutter/issues/57146.
|
|
||||||
|
|
||||||
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
|
||||||
# which isn't available in 3.10.
|
|
||||||
function(list_prepend LIST_NAME PREFIX)
|
|
||||||
set(NEW_LIST "")
|
|
||||||
foreach(element ${${LIST_NAME}})
|
|
||||||
list(APPEND NEW_LIST "${PREFIX}${element}")
|
|
||||||
endforeach(element)
|
|
||||||
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# === Flutter Library ===
|
|
||||||
# System-level dependencies.
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
|
||||||
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
|
||||||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
|
||||||
|
|
||||||
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
|
||||||
|
|
||||||
# Published to parent scope for install step.
|
|
||||||
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
|
||||||
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
|
||||||
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
|
||||||
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
|
||||||
|
|
||||||
list(APPEND FLUTTER_LIBRARY_HEADERS
|
|
||||||
"fl_basic_message_channel.h"
|
|
||||||
"fl_binary_codec.h"
|
|
||||||
"fl_binary_messenger.h"
|
|
||||||
"fl_dart_project.h"
|
|
||||||
"fl_engine.h"
|
|
||||||
"fl_json_message_codec.h"
|
|
||||||
"fl_json_method_codec.h"
|
|
||||||
"fl_message_codec.h"
|
|
||||||
"fl_method_call.h"
|
|
||||||
"fl_method_channel.h"
|
|
||||||
"fl_method_codec.h"
|
|
||||||
"fl_method_response.h"
|
|
||||||
"fl_plugin_registrar.h"
|
|
||||||
"fl_plugin_registry.h"
|
|
||||||
"fl_standard_message_codec.h"
|
|
||||||
"fl_standard_method_codec.h"
|
|
||||||
"fl_string_codec.h"
|
|
||||||
"fl_value.h"
|
|
||||||
"fl_view.h"
|
|
||||||
"flutter_linux.h"
|
|
||||||
)
|
|
||||||
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
|
||||||
add_library(flutter INTERFACE)
|
|
||||||
target_include_directories(flutter INTERFACE
|
|
||||||
"${EPHEMERAL_DIR}"
|
|
||||||
)
|
|
||||||
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
|
||||||
target_link_libraries(flutter INTERFACE
|
|
||||||
PkgConfig::GTK
|
|
||||||
PkgConfig::GLIB
|
|
||||||
PkgConfig::GIO
|
|
||||||
)
|
|
||||||
add_dependencies(flutter flutter_assemble)
|
|
||||||
|
|
||||||
# === Flutter tool backend ===
|
|
||||||
# _phony_ is a non-existent file to force this command to run every time,
|
|
||||||
# since currently there's no way to get a full input/output list from the
|
|
||||||
# flutter tool.
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E env
|
|
||||||
${FLUTTER_TOOL_ENVIRONMENT}
|
|
||||||
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
|
||||||
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
add_custom_target(flutter_assemble DEPENDS
|
|
||||||
"${FLUTTER_LIBRARY}"
|
|
||||||
${FLUTTER_LIBRARY_HEADERS}
|
|
||||||
)
|
|
||||||
@@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) {
|
|||||||
if (use_header_bar) {
|
if (use_header_bar) {
|
||||||
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
||||||
gtk_widget_show(GTK_WIDGET(header_bar));
|
gtk_widget_show(GTK_WIDGET(header_bar));
|
||||||
gtk_header_bar_set_title(header_bar, "Filc Napló");
|
gtk_header_bar_set_title(header_bar, "reFilc");
|
||||||
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
||||||
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
||||||
} else {
|
} else {
|
||||||
gtk_window_set_title(window, "Filc Napló");
|
gtk_window_set_title(window, "reFilc");
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_window_set_default_size(window, 1280, 720);
|
gtk_window_set_default_size(window, 1280, 720);
|
||||||
|
|||||||
7
filcnaplo/macos/.gitignore
vendored
7
filcnaplo/macos/.gitignore
vendored
@@ -1,7 +0,0 @@
|
|||||||
# Flutter-related
|
|
||||||
**/Flutter/ephemeral/
|
|
||||||
**/Pods/
|
|
||||||
|
|
||||||
# Xcode-related
|
|
||||||
**/dgph
|
|
||||||
**/xcuserdata/
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
|
||||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
|
||||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
|
||||||
@@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
|
|||||||
homepage: https://refilc.hu
|
homepage: https://refilc.hu
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 4.2.3+223
|
version: 4.4.0+233
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.17.0 <3.0.0"
|
||||||
|
|||||||
17
filcnaplo/windows/.gitignore
vendored
17
filcnaplo/windows/.gitignore
vendored
@@ -1,17 +0,0 @@
|
|||||||
flutter/ephemeral/
|
|
||||||
|
|
||||||
# Visual Studio user-specific files.
|
|
||||||
*.suo
|
|
||||||
*.user
|
|
||||||
*.userosscache
|
|
||||||
*.sln.docstates
|
|
||||||
|
|
||||||
# Visual Studio build-related files.
|
|
||||||
x64/
|
|
||||||
x86/
|
|
||||||
|
|
||||||
# Visual Studio cache files
|
|
||||||
# files ending in .cache can be ignored
|
|
||||||
*.[Cc]ache
|
|
||||||
# but keep track of directories ending in .cache
|
|
||||||
!*.[Cc]ache/
|
|
||||||
47
filcnaplo_desktop_ui/.gitignore
vendored
47
filcnaplo_desktop_ui/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
pubspec.lock
|
|
||||||
@@ -31,7 +31,7 @@ import 'absences_page.i18n.dart';
|
|||||||
enum AbsenceFilter { absences, delays, misses }
|
enum AbsenceFilter { absences, delays, misses }
|
||||||
|
|
||||||
class SubjectAbsence {
|
class SubjectAbsence {
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
List<Absence> absences;
|
List<Absence> absences;
|
||||||
double percentage;
|
double percentage;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
late String firstName;
|
late String firstName;
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
late List<SubjectAbsence> absences = [];
|
late List<SubjectAbsence> absences = [];
|
||||||
final Map<Subject, Lesson> _lessonCount = {};
|
final Map<GradeSubject, Lesson> _lessonCount = {};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -87,7 +87,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void buildSubjectAbsences() {
|
void buildSubjectAbsences() {
|
||||||
Map<Subject, SubjectAbsence> _absences = {};
|
Map<GradeSubject, SubjectAbsence> _absences = {};
|
||||||
|
|
||||||
for (final absence in absenceProvider.absences) {
|
for (final absence in absenceProvider.absences) {
|
||||||
if (absence.delay != 0) continue;
|
if (absence.delay != 0) continue;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class GradeSubjectView extends StatefulWidget {
|
|||||||
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
final double groupAverage;
|
final double groupAverage;
|
||||||
|
|
||||||
void push(BuildContext context, {bool root = false}) {
|
void push(BuildContext context, {bool root = false}) {
|
||||||
@@ -62,7 +62,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
|
|
||||||
bool gradeCalcMode = false;
|
bool gradeCalcMode = false;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject) => !gradeCalcMode
|
List<Grade> getSubjectGrades(GradeSubject subject) => !gradeCalcMode
|
||||||
? gradeProvider.grades.where((e) => e.subject == subject).toList()
|
? gradeProvider.grades.where((e) => e.subject == subject).toList()
|
||||||
: calculatorProvider.grades.where((e) => e.subject == subject).toList();
|
: calculatorProvider.grades.where((e) => e.subject == subject).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
|
|
||||||
int avgDropValue = 0;
|
int avgDropValue = 0;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject, {int days = 0}) => gradeProvider
|
List<Grade> getSubjectGrades(GradeSubject subject, {int days = 0}) => gradeProvider
|
||||||
.grades
|
.grades
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.subject == subject &&
|
e.subject == subject &&
|
||||||
@@ -51,14 +51,14 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
void generateTiles() {
|
void generateTiles() {
|
||||||
List<Subject> subjects = gradeProvider.grades
|
List<GradeSubject> subjects = gradeProvider.grades
|
||||||
.map((e) => e.subject)
|
.map((e) => e.subject)
|
||||||
.toSet()
|
.toSet()
|
||||||
.toList()
|
.toList()
|
||||||
..sort((a, b) => a.name.compareTo(b.name));
|
..sort((a, b) => a.name.compareTo(b.name));
|
||||||
List<Widget> tiles = [];
|
List<Widget> tiles = [];
|
||||||
|
|
||||||
Map<Subject, double> subjectAvgs = {};
|
Map<GradeSubject, double> subjectAvgs = {};
|
||||||
|
|
||||||
tiles.addAll(subjects.map((subject) {
|
tiles.addAll(subjects.map((subject) {
|
||||||
List<Grade> subjectGrades = getSubjectGrades(subject);
|
List<Grade> subjectGrades = getSubjectGrades(subject);
|
||||||
@@ -144,8 +144,8 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: StatisticsTile(
|
child: StatisticsTile(
|
||||||
outline: true,
|
outline: true,
|
||||||
title: AutoSizeText(
|
title: AutoSizeText( // https://discord.com/channels/1111649116020285532/1153397476578050130
|
||||||
"classavg".i18n,
|
"classavg".i18n,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
wrapWords: false,
|
wrapWords: false,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ extension Localization on String {
|
|||||||
"7_days_average": "Weekly Average",
|
"7_days_average": "Weekly Average",
|
||||||
"subjectavg": "Subject Average",
|
"subjectavg": "Subject Average",
|
||||||
"classavg": "Class Average",
|
"classavg": "Class Average",
|
||||||
"fail_warning": "Faliure warning",
|
"fail_warning": "Failure warning",
|
||||||
"fail_warning_description": "You are failing %d subject(s)",
|
"fail_warning_description": "You are failing %d subject(s)",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import 'package:filcnaplo/api/client.dart';
|
|||||||
import 'package:filcnaplo/api/login.dart';
|
import 'package:filcnaplo/api/login.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/login/login_button.dart';
|
import 'package:filcnaplo_mobile_ui/screens/login/login_button.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/login/login_input.dart';
|
import 'package:filcnaplo_mobile_ui/screens/login/login_input.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/login/school_input/school_input.dart';
|
// import 'package:filcnaplo_desktop_ui/screens/login/school_input/school_input.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||||
@@ -36,8 +36,8 @@ class LoginScreen extends StatefulWidget {
|
|||||||
class _LoginScreenState extends State<LoginScreen> {
|
class _LoginScreenState extends State<LoginScreen> {
|
||||||
final usernameController = TextEditingController();
|
final usernameController = TextEditingController();
|
||||||
final passwordController = TextEditingController();
|
final passwordController = TextEditingController();
|
||||||
final schoolController = SchoolInputController();
|
// final schoolController = SchoolInputController();
|
||||||
final _scrollController = ScrollController();
|
// final _scrollController = ScrollController();
|
||||||
|
|
||||||
LoginState _loginState = LoginState.normal;
|
LoginState _loginState = LoginState.normal;
|
||||||
bool showBack = false;
|
bool showBack = false;
|
||||||
@@ -57,9 +57,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
FilcAPI.getSchools().then((schools) {
|
FilcAPI.getSchools().then((schools) {
|
||||||
if (schools != null) {
|
if (schools != null) {
|
||||||
schoolController.update(() {
|
// schoolController.update(() {
|
||||||
schoolController.schools = schools;
|
// schoolController.schools = schools;
|
||||||
});
|
// });
|
||||||
} else {
|
} else {
|
||||||
ElegantNotification.error(
|
ElegantNotification.error(
|
||||||
background: Colors.white,
|
background: Colors.white,
|
||||||
@@ -238,10 +238,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SchoolInput(
|
// SchoolInput(
|
||||||
scroll: _scrollController,
|
// scroll: _scrollController,
|
||||||
controller: schoolController,
|
// controller: schoolController,
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -320,8 +320,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
String password = passwordController.text;
|
String password = passwordController.text;
|
||||||
|
|
||||||
if (username == "" ||
|
if (username == "" ||
|
||||||
password == "" ||
|
password ==
|
||||||
schoolController.selectedSchool == null) {
|
"" /*||
|
||||||
|
schoolController.selectedSchool == null*/
|
||||||
|
) {
|
||||||
return setState(() => _loginState = LoginState.missingFields);
|
return setState(() => _loginState = LoginState.missingFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +332,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
loginAPI(
|
loginAPI(
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password,
|
||||||
instituteCode: schoolController.selectedSchool!.instituteCode,
|
instituteCode: 'shit',
|
||||||
|
// instituteCode: schoolController.selectedSchool!.instituteCode,
|
||||||
context: context,
|
context: context,
|
||||||
onLogin: (user) {
|
onLogin: (user) {
|
||||||
ElegantNotification.success(
|
ElegantNotification.success(
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
import 'package:filcnaplo_mobile_ui/screens/login/login_input.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/screens/login/school_input/school_input_overlay.dart';
|
||||||
|
import 'package:filcnaplo_desktop_ui/screens/login/school_input/school_input_tile.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/screens/login/school_input/school_search.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||||
|
|
||||||
|
class SchoolInput extends StatefulWidget {
|
||||||
|
const SchoolInput({Key? key, required this.controller, required this.scroll})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
final SchoolInputController controller;
|
||||||
|
final ScrollController scroll;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_SchoolInputState createState() => _SchoolInputState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SchoolInputState extends State<SchoolInput> {
|
||||||
|
final _focusNode = FocusNode();
|
||||||
|
final _layerLink = LayerLink();
|
||||||
|
late SchoolInputOverlay overlay;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
widget.controller.update = (fn) {
|
||||||
|
if (mounted) setState(fn);
|
||||||
|
};
|
||||||
|
|
||||||
|
overlay = SchoolInputOverlay(layerLink: _layerLink);
|
||||||
|
|
||||||
|
// Show school list when focused
|
||||||
|
_focusNode.addListener(() {
|
||||||
|
if (_focusNode.hasFocus) {
|
||||||
|
WidgetsBinding.instance
|
||||||
|
.addPostFrameCallback((_) => overlay.createOverlayEntry(context));
|
||||||
|
Future.delayed(const Duration(milliseconds: 100)).then((value) {
|
||||||
|
if (mounted && widget.scroll.hasClients) {
|
||||||
|
widget.scroll.animateTo(widget.scroll.offset + 500,
|
||||||
|
duration: const Duration(milliseconds: 500),
|
||||||
|
curve: Curves.ease);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
overlay.entry?.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// LoginInput TextField listener
|
||||||
|
widget.controller.textController.addListener(() {
|
||||||
|
String text = widget.controller.textController.text;
|
||||||
|
if (text.isEmpty) {
|
||||||
|
overlay.children = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<School> results =
|
||||||
|
searchSchools(widget.controller.schools ?? [], text);
|
||||||
|
setState(() {
|
||||||
|
overlay.children = results
|
||||||
|
.map((School e) => SchoolInputTile(
|
||||||
|
school: e,
|
||||||
|
onTap: () => _selectSchool(e),
|
||||||
|
))
|
||||||
|
.toList();
|
||||||
|
});
|
||||||
|
Overlay.of(context).setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _selectSchool(School school) {
|
||||||
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
widget.controller.selectedSchool = school;
|
||||||
|
widget.controller.textController.text = school.name;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CompositedTransformTarget(
|
||||||
|
link: _layerLink,
|
||||||
|
child: widget.controller.schools == null
|
||||||
|
? Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black.withOpacity(0.15),
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
|
child: SizedBox(
|
||||||
|
height: 28.0,
|
||||||
|
width: 28.0,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: LoginInput(
|
||||||
|
style: LoginInputStyle.school,
|
||||||
|
focusNode: _focusNode,
|
||||||
|
onClear: () {
|
||||||
|
widget.controller.selectedSchool = null;
|
||||||
|
FocusScope.of(context).requestFocus(_focusNode);
|
||||||
|
},
|
||||||
|
controller: widget.controller.textController,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SchoolInputController {
|
||||||
|
final textController = TextEditingController();
|
||||||
|
School? selectedSchool;
|
||||||
|
List<School>? schools;
|
||||||
|
late void Function(void Function()) update;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
final School school;
|
||||||
|
final Function()? onTap;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: GestureDetector(
|
||||||
|
onPanDown: (e) {
|
||||||
|
onTap!();
|
||||||
|
},
|
||||||
|
child: InkWell(
|
||||||
|
onTapDown: (e) {},
|
||||||
|
borderRadius: BorderRadius.circular(6.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(6.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// School name
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 4.0),
|
||||||
|
child: Text(
|
||||||
|
school.name,
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
// School id
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
school.instituteCode,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// School city
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
school.city,
|
||||||
|
textAlign: TextAlign.right,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -63,8 +63,12 @@ class NavigationScreenState extends State<NavigationScreen>
|
|||||||
await Window.initialize();
|
await Window.initialize();
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
// Transparent sidebar
|
// Transparent sidebar
|
||||||
|
if (Platform.isLinux) return;
|
||||||
|
|
||||||
await Window.setEffect(
|
await Window.setEffect(
|
||||||
effect: WindowEffect.acrylic,
|
effect: Platform.isLinux
|
||||||
|
? WindowEffect.transparent
|
||||||
|
: WindowEffect.acrylic,
|
||||||
color: Platform.isMacOS
|
color: Platform.isMacOS
|
||||||
? Colors.transparent
|
? Colors.transparent
|
||||||
: const Color.fromARGB(27, 27, 27, 27));
|
: const Color.fromARGB(27, 27, 27, 27));
|
||||||
|
|||||||
@@ -176,13 +176,16 @@ class _SidebarState extends State<Sidebar> {
|
|||||||
String? userId = user.id;
|
String? userId = user.id;
|
||||||
if (userId == null) return;
|
if (userId == null) return;
|
||||||
|
|
||||||
// Delete User
|
// revoke refresh token
|
||||||
|
await Provider.of<KretaClient>(context, listen: false).logout();
|
||||||
|
|
||||||
|
// delete user from app
|
||||||
user.removeUser(userId);
|
user.removeUser(userId);
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false)
|
await Provider.of<DatabaseProvider>(context, listen: false)
|
||||||
.store
|
.store
|
||||||
.removeUser(userId);
|
.removeUser(userId);
|
||||||
|
|
||||||
// If no other Users left, go back to LoginScreen
|
// if no other users left, go back to login screen
|
||||||
if (user.getUsers().isNotEmpty) {
|
if (user.getUsers().isNotEmpty) {
|
||||||
user.setUser(user.getUsers().first.id);
|
user.setUser(user.getUsers().first.id);
|
||||||
restore().then((_) => user.setUser(user.getUsers().first.id));
|
restore().then((_) => user.setUser(user.getUsers().first.id));
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ extension SettingsLocalization on String {
|
|||||||
{
|
{
|
||||||
"en_en": {
|
"en_en": {
|
||||||
"personal_details": "Personal Details",
|
"personal_details": "Personal Details",
|
||||||
"open_dkt": "Open DKT",
|
"open_dkt": "Open DCS",
|
||||||
"edit_nickname": "Edit Nickname",
|
"edit_nickname": "Edit Nickname",
|
||||||
"edit_profile_picture": "Edit Profile Picture",
|
"edit_profile_picture": "Edit Profile Picture",
|
||||||
"remove_profile_picture": "Remove Profile Picture",
|
"remove_profile_picture": "Remove Profile Picture",
|
||||||
@@ -39,7 +39,8 @@ extension SettingsLocalization on String {
|
|||||||
"done": "Done",
|
"done": "Done",
|
||||||
"reset": "Reset",
|
"reset": "Reset",
|
||||||
"open": "Open",
|
"open": "Open",
|
||||||
"data_collected": "Data collected: Platform (eg. Android), App version (eg. 3.0.0), Unique Install Identifier",
|
"data_collected":
|
||||||
|
"Data collected: Platform (eg. Android), App version (eg. 3.0.0), Unique Install Identifier",
|
||||||
"Analytics": "Analytics",
|
"Analytics": "Analytics",
|
||||||
"Anonymous Usage Analytics": "Anonymous Usage Analytics",
|
"Anonymous Usage Analytics": "Anonymous Usage Analytics",
|
||||||
"graph_class_avg": "Class average on graph",
|
"graph_class_avg": "Class average on graph",
|
||||||
@@ -98,7 +99,8 @@ extension SettingsLocalization on String {
|
|||||||
"done": "Kész",
|
"done": "Kész",
|
||||||
"reset": "Visszaállítás",
|
"reset": "Visszaállítás",
|
||||||
"open": "Megnyitás",
|
"open": "Megnyitás",
|
||||||
"data_collected": "Gyűjtött adat: Platform (pl. Android), App verzió (pl. 3.0.0), Egyedi telepítési azonosító",
|
"data_collected":
|
||||||
|
"Gyűjtött adat: Platform (pl. Android), App verzió (pl. 3.0.0), Egyedi telepítési azonosító",
|
||||||
"Analytics": "Analitika",
|
"Analytics": "Analitika",
|
||||||
"Anonymous Usage Analytics": "Névtelen használati analitika",
|
"Anonymous Usage Analytics": "Névtelen használati analitika",
|
||||||
"graph_class_avg": "Osztályátlag a grafikonon",
|
"graph_class_avg": "Osztályátlag a grafikonon",
|
||||||
@@ -123,7 +125,7 @@ extension SettingsLocalization on String {
|
|||||||
},
|
},
|
||||||
"de_de": {
|
"de_de": {
|
||||||
"personal_details": "Persönliche Angaben",
|
"personal_details": "Persönliche Angaben",
|
||||||
"open_dkt": "Öffnen DKT",
|
"open_dkt": "Öffnen RDZ",
|
||||||
"edit_nickname": "Spitznamen bearbeiten",
|
"edit_nickname": "Spitznamen bearbeiten",
|
||||||
"edit_profile_picture": "Profilbild bearbeiten",
|
"edit_profile_picture": "Profilbild bearbeiten",
|
||||||
"remove_profile_picture": "Profilbild entfernen",
|
"remove_profile_picture": "Profilbild entfernen",
|
||||||
@@ -157,7 +159,8 @@ extension SettingsLocalization on String {
|
|||||||
"done": "Fertig",
|
"done": "Fertig",
|
||||||
"reset": "Zurücksetzen",
|
"reset": "Zurücksetzen",
|
||||||
"open": "Öffnen",
|
"open": "Öffnen",
|
||||||
"data_collected": "Erhobene Daten: Plattform (z.B. Android), App version (z.B. 3.0.0), Eindeutige Installationskennung",
|
"data_collected":
|
||||||
|
"Erhobene Daten: Plattform (z.B. Android), App version (z.B. 3.0.0), Eindeutige Installationskennung",
|
||||||
"Analytics": "Analytik",
|
"Analytics": "Analytik",
|
||||||
"Anonymous Usage Analytics": "Anonyme Nutzungsanalyse",
|
"Anonymous Usage Analytics": "Anonyme Nutzungsanalyse",
|
||||||
"graph_class_avg": "Klassendurchschnitt in der Grafik",
|
"graph_class_avg": "Klassendurchschnitt in der Grafik",
|
||||||
|
|||||||
47
filcnaplo_kreta_api/.gitignore
vendored
47
filcnaplo_kreta_api/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
pubspec.lock
|
|
||||||
@@ -3,6 +3,7 @@ import 'package:intl/intl.dart';
|
|||||||
class KretaAPI {
|
class KretaAPI {
|
||||||
// IDP API
|
// IDP API
|
||||||
static const login = BaseKreta.kretaIdp + KretaApiEndpoints.token;
|
static const login = BaseKreta.kretaIdp + KretaApiEndpoints.token;
|
||||||
|
static const logout = BaseKreta.kretaIdp + KretaApiEndpoints.revoke;
|
||||||
static const nonce = BaseKreta.kretaIdp + KretaApiEndpoints.nonce;
|
static const nonce = BaseKreta.kretaIdp + KretaApiEndpoints.nonce;
|
||||||
static const clientId = "kreta-ellenorzo-mobile-android";
|
static const clientId = "kreta-ellenorzo-mobile-android";
|
||||||
|
|
||||||
@@ -53,6 +54,30 @@ class KretaAPI {
|
|||||||
String iss, String uid, String type) =>
|
String iss, String uid, String type) =>
|
||||||
BaseKreta.kreta(iss) +
|
BaseKreta.kreta(iss) +
|
||||||
KretaApiEndpoints.downloadHomeworkAttachments(uid, type);
|
KretaApiEndpoints.downloadHomeworkAttachments(uid, type);
|
||||||
|
static String subjects(String iss, String uid) =>
|
||||||
|
BaseKreta.kreta(iss) +
|
||||||
|
KretaApiEndpoints.subjects +
|
||||||
|
"?oktatasiNevelesiFeladatUid=" + uid;
|
||||||
|
// Structure:
|
||||||
|
// {
|
||||||
|
// "Uid": 000,
|
||||||
|
// "Tantargy": {
|
||||||
|
// "Uid": 000,
|
||||||
|
// "Nev": "Irodalom",
|
||||||
|
// "Kategoria": {
|
||||||
|
// "Uid": "000,magyar_nyelv_es_irodalom",
|
||||||
|
// "Nev": "magyar_nyelv_es_irodalom",
|
||||||
|
// "Leiras": "Magyar nyelv és irodalom"
|
||||||
|
// },
|
||||||
|
// "SortIndex": 0,
|
||||||
|
// },
|
||||||
|
// "Atlag": null, // float
|
||||||
|
// "AtlagAlakulasaIdoFuggvenyeben": Array[], // no idea what this is
|
||||||
|
// "SulyozottOsztalyzatOsszege": null, // int | float
|
||||||
|
// "SulyozottOsztalyzatSzama": null, // int | float
|
||||||
|
// "SortIndex": 0
|
||||||
|
// }
|
||||||
|
// refer to https://discord.com/channels/1111649116020285532/1111798771513303102/1148368925969612920
|
||||||
|
|
||||||
// ADMIN API
|
// ADMIN API
|
||||||
static const sendMessage =
|
static const sendMessage =
|
||||||
@@ -86,6 +111,7 @@ class BaseKreta {
|
|||||||
|
|
||||||
class KretaApiEndpoints {
|
class KretaApiEndpoints {
|
||||||
static const token = "/connect/token";
|
static const token = "/connect/token";
|
||||||
|
static const revoke = "/connect/revocation";
|
||||||
static const nonce = "/nonce";
|
static const nonce = "/nonce";
|
||||||
static const notes = "/ellenorzo/V3/Sajat/Feljegyzesek";
|
static const notes = "/ellenorzo/V3/Sajat/Feljegyzesek";
|
||||||
static const events = "/ellenorzo/V3/Sajat/FaliujsagElemek";
|
static const events = "/ellenorzo/V3/Sajat/FaliujsagElemek";
|
||||||
@@ -103,6 +129,7 @@ class KretaApiEndpoints {
|
|||||||
static const capabilities = "/ellenorzo/V3/Sajat/Intezmenyek";
|
static const capabilities = "/ellenorzo/V3/Sajat/Intezmenyek";
|
||||||
static String downloadHomeworkAttachments(String uid, String type) =>
|
static String downloadHomeworkAttachments(String uid, String type) =>
|
||||||
"/ellenorzo/V3/Sajat/Csatolmany/$uid";
|
"/ellenorzo/V3/Sajat/Csatolmany/$uid";
|
||||||
|
static const subjects = "/ellenorzo/V3/Sajat/Ertekelesek/Atlagok/TantargyiAtlagok";
|
||||||
}
|
}
|
||||||
|
|
||||||
class KretaAdminEndpoints {
|
class KretaAdminEndpoints {
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ class KretaClient {
|
|||||||
late final UserProvider _user;
|
late final UserProvider _user;
|
||||||
late final StatusProvider _status;
|
late final StatusProvider _status;
|
||||||
|
|
||||||
|
bool _loginRefreshing = false;
|
||||||
|
|
||||||
KretaClient({
|
KretaClient({
|
||||||
this.accessToken,
|
this.accessToken,
|
||||||
required SettingsProvider settings,
|
required SettingsProvider settings,
|
||||||
@@ -164,6 +166,9 @@ class KretaClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> refreshLogin() async {
|
Future<void> refreshLogin() async {
|
||||||
|
if (_loginRefreshing) return;
|
||||||
|
_loginRefreshing = true;
|
||||||
|
|
||||||
User? loginUser = _user.user;
|
User? loginUser = _user.user;
|
||||||
if (loginUser == null) return;
|
if (loginUser == null) return;
|
||||||
|
|
||||||
@@ -182,13 +187,15 @@ class KretaClient {
|
|||||||
print("DEBUG: refreshLogin: ${loginUser.id} ${loginUser.name}");
|
print("DEBUG: refreshLogin: ${loginUser.id} ${loginUser.name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
Map? loginRes = await postAPI(KretaAPI.login,
|
Map? loginRes = await postAPI(
|
||||||
headers: headers,
|
KretaAPI.login,
|
||||||
body: User.loginBody(
|
headers: headers,
|
||||||
username: loginUser.username,
|
body: User.loginBody(
|
||||||
password: loginUser.password,
|
username: loginUser.username,
|
||||||
instituteCode: loginUser.instituteCode,
|
password: loginUser.password,
|
||||||
));
|
instituteCode: loginUser.instituteCode,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
if (loginRes != null) {
|
if (loginRes != null) {
|
||||||
if (loginRes.containsKey("access_token")) {
|
if (loginRes.containsKey("access_token")) {
|
||||||
@@ -215,5 +222,25 @@ class KretaClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_loginRefreshing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> logout() async {
|
||||||
|
User? loginUser = _user.user;
|
||||||
|
if (loginUser == null) return;
|
||||||
|
|
||||||
|
Map<String, String> headers = {
|
||||||
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
|
};
|
||||||
|
|
||||||
|
await postAPI(
|
||||||
|
KretaAPI.logout,
|
||||||
|
headers: headers,
|
||||||
|
body: User.logoutBody(
|
||||||
|
refreshToken: refreshToken!,
|
||||||
|
),
|
||||||
|
json: false,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Absence {
|
|||||||
Category? justification;
|
Category? justification;
|
||||||
Category? type;
|
Category? type;
|
||||||
Category? mode;
|
Category? mode;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
DateTime lessonStart;
|
DateTime lessonStart;
|
||||||
DateTime lessonEnd;
|
DateTime lessonEnd;
|
||||||
int? lessonIndex;
|
int? lessonIndex;
|
||||||
@@ -83,7 +83,7 @@ class Absence {
|
|||||||
: null,
|
: null,
|
||||||
type: json["Tipus"] != null ? Category.fromJson(json["Tipus"]) : null,
|
type: json["Tipus"] != null ? Category.fromJson(json["Tipus"]) : null,
|
||||||
mode: json["Mod"] != null ? Category.fromJson(json["Mod"]) : null,
|
mode: json["Mod"] != null ? Category.fromJson(json["Mod"]) : null,
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
lessonStart: lessonStart,
|
lessonStart: lessonStart,
|
||||||
lessonEnd: lessonEnd,
|
lessonEnd: lessonEnd,
|
||||||
lessonIndex: lessonIndex,
|
lessonIndex: lessonIndex,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
||||||
|
|
||||||
import 'category.dart';
|
import 'category.dart';
|
||||||
import 'teacher.dart';
|
import 'teacher.dart';
|
||||||
|
|
||||||
@@ -6,8 +8,9 @@ class Exam {
|
|||||||
DateTime date;
|
DateTime date;
|
||||||
DateTime writeDate;
|
DateTime writeDate;
|
||||||
Category? mode;
|
Category? mode;
|
||||||
int? subjectIndex;
|
// int? subjectIndex;
|
||||||
String subjectName;
|
// String subjectName;
|
||||||
|
GradeSubject subject;
|
||||||
Teacher teacher;
|
Teacher teacher;
|
||||||
String description;
|
String description;
|
||||||
String group;
|
String group;
|
||||||
@@ -18,8 +21,9 @@ class Exam {
|
|||||||
required this.date,
|
required this.date,
|
||||||
required this.writeDate,
|
required this.writeDate,
|
||||||
this.mode,
|
this.mode,
|
||||||
this.subjectIndex,
|
// this.subjectIndex,
|
||||||
required this.subjectName,
|
// required this.subjectName,
|
||||||
|
required this.subject,
|
||||||
required this.teacher,
|
required this.teacher,
|
||||||
required this.description,
|
required this.description,
|
||||||
required this.group,
|
required this.group,
|
||||||
@@ -36,8 +40,9 @@ class Exam {
|
|||||||
? DateTime.parse(json["Datum"]).toLocal()
|
? DateTime.parse(json["Datum"]).toLocal()
|
||||||
: DateTime(0),
|
: DateTime(0),
|
||||||
mode: json["Modja"] != null ? Category.fromJson(json["Modja"]) : null,
|
mode: json["Modja"] != null ? Category.fromJson(json["Modja"]) : null,
|
||||||
subjectIndex: json["OrarendiOraOraszama"],
|
// subjectIndex: json["OrarendiOraOraszama"],
|
||||||
subjectName: json["TantargyNeve"] ?? "",
|
// subjectName: json["TantargyNeve"] ?? "",
|
||||||
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
||||||
description: (json["Temaja"] ?? "").trim(),
|
description: (json["Temaja"] ?? "").trim(),
|
||||||
group: json["OsztalyCsoport"] != null
|
group: json["OsztalyCsoport"] != null
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Grade {
|
|||||||
String description;
|
String description;
|
||||||
GradeType type;
|
GradeType type;
|
||||||
String groupId;
|
String groupId;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
Category? gradeType;
|
Category? gradeType;
|
||||||
Category mode;
|
Category mode;
|
||||||
DateTime writeDate;
|
DateTime writeDate;
|
||||||
@@ -57,7 +57,7 @@ class Grade {
|
|||||||
? Category.getGradeType(json["Tipus"]["Nev"])
|
? Category.getGradeType(json["Tipus"]["Nev"])
|
||||||
: GradeType.unknown,
|
: GradeType.unknown,
|
||||||
groupId: (json["OsztalyCsoport"] ?? {})["Uid"] ?? "",
|
groupId: (json["OsztalyCsoport"] ?? {})["Uid"] ?? "",
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
gradeType: json["ErtekFajta"] != null
|
gradeType: json["ErtekFajta"] != null
|
||||||
? Category.fromJson(json["ErtekFajta"])
|
? Category.fromJson(json["ErtekFajta"])
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:filcnaplo_kreta_api/models/subject.dart';
|
|||||||
class GroupAverage {
|
class GroupAverage {
|
||||||
String uid;
|
String uid;
|
||||||
double average;
|
double average;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
Map json;
|
Map json;
|
||||||
|
|
||||||
GroupAverage({required this.uid, required this.average, required this.subject, this.json = const {}});
|
GroupAverage({required this.uid, required this.average, required this.subject, this.json = const {}});
|
||||||
@@ -12,7 +12,7 @@ class GroupAverage {
|
|||||||
return GroupAverage(
|
return GroupAverage(
|
||||||
uid: json["Uid"] ?? "",
|
uid: json["Uid"] ?? "",
|
||||||
average: json["OsztalyCsoportAtlag"] ?? 0,
|
average: json["OsztalyCsoportAtlag"] ?? 0,
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
json: json,
|
json: json,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Homework {
|
|||||||
bool homeworkEnabled;
|
bool homeworkEnabled;
|
||||||
Teacher teacher;
|
Teacher teacher;
|
||||||
String content;
|
String content;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
String group;
|
String group;
|
||||||
List<HomeworkAttachment> attachments;
|
List<HomeworkAttachment> attachments;
|
||||||
String id;
|
String id;
|
||||||
@@ -48,7 +48,7 @@ class Homework {
|
|||||||
homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false,
|
homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false,
|
||||||
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
||||||
content: (json["Szoveg"] ?? "").trim(),
|
content: (json["Szoveg"] ?? "").trim(),
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
group: json["OsztalyCsoport"] != null
|
group: json["OsztalyCsoport"] != null
|
||||||
? json["OsztalyCsoport"]["Uid"] ?? ""
|
? json["OsztalyCsoport"]["Uid"] ?? ""
|
||||||
: "",
|
: "",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Lesson {
|
|||||||
Map? json;
|
Map? json;
|
||||||
Category? status;
|
Category? status;
|
||||||
DateTime date;
|
DateTime date;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
String lessonIndex;
|
String lessonIndex;
|
||||||
int? lessonYearIndex;
|
int? lessonYearIndex;
|
||||||
Teacher? substituteTeacher;
|
Teacher? substituteTeacher;
|
||||||
@@ -68,7 +68,7 @@ class Lesson {
|
|||||||
date: json["Datum"] != null
|
date: json["Datum"] != null
|
||||||
? DateTime.parse(json["Datum"]).toLocal()
|
? DateTime.parse(json["Datum"]).toLocal()
|
||||||
: DateTime(0),
|
: DateTime(0),
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+",
|
lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+",
|
||||||
lessonYearIndex: json["OraEvesSorszama"],
|
lessonYearIndex: json["OraEvesSorszama"],
|
||||||
substituteTeacher: json["HelyettesTanarNeve"] != null
|
substituteTeacher: json["HelyettesTanarNeve"] != null
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'category.dart';
|
import 'category.dart';
|
||||||
|
|
||||||
class Subject {
|
class GradeSubject {
|
||||||
String id;
|
String id;
|
||||||
Category category;
|
Category category;
|
||||||
String name;
|
String name;
|
||||||
@@ -8,11 +8,16 @@ class Subject {
|
|||||||
|
|
||||||
bool get isRenamed => renamedTo != null;
|
bool get isRenamed => renamedTo != null;
|
||||||
|
|
||||||
Subject({required this.id, required this.category, required this.name, this.renamedTo});
|
GradeSubject({
|
||||||
|
required this.id,
|
||||||
|
required this.category,
|
||||||
|
required this.name,
|
||||||
|
this.renamedTo,
|
||||||
|
});
|
||||||
|
|
||||||
factory Subject.fromJson(Map json) {
|
factory GradeSubject.fromJson(Map json) {
|
||||||
final id = json["Uid"] ?? "";
|
final id = json["Uid"] ?? "";
|
||||||
return Subject(
|
return GradeSubject(
|
||||||
id: id,
|
id: id,
|
||||||
category: Category.fromJson(json["Kategoria"] ?? {}),
|
category: Category.fromJson(json["Kategoria"] ?? {}),
|
||||||
name: (json["Nev"] ?? "").trim(),
|
name: (json["Nev"] ?? "").trim(),
|
||||||
@@ -21,7 +26,7 @@ class Subject {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(other) {
|
bool operator ==(other) {
|
||||||
if (other is! Subject) return false;
|
if (other is! GradeSubject) return false;
|
||||||
return id == other.id;
|
return id == other.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,19 +27,49 @@ class ExamProvider with ChangeNotifier {
|
|||||||
|
|
||||||
// Load exams from the database
|
// Load exams from the database
|
||||||
if (userId != null) {
|
if (userId != null) {
|
||||||
var dbExams = await Provider.of<DatabaseProvider>(_context, listen: false).userQuery.getExams(userId: userId);
|
var dbExams = await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userQuery
|
||||||
|
.getExams(userId: userId);
|
||||||
_exams = dbExams;
|
_exams = dbExams;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
await convertBySettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for renamed subjects
|
||||||
|
Future<void> convertBySettings() async {
|
||||||
|
final _database = Provider.of<DatabaseProvider>(_context, listen: false);
|
||||||
|
Map<String, String> renamedSubjects =
|
||||||
|
(await _database.query.getSettings(_database)).renamedSubjectsEnabled
|
||||||
|
? await _database.userQuery.renamedSubjects(
|
||||||
|
userId:
|
||||||
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
|
: {};
|
||||||
|
Map<String, String> renamedTeachers =
|
||||||
|
(await _database.query.getSettings(_database)).renamedTeachersEnabled
|
||||||
|
? await _database.userQuery.renamedTeachers(
|
||||||
|
userId:
|
||||||
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
|
: {};
|
||||||
|
|
||||||
|
for (Exam exam in _exams) {
|
||||||
|
exam.subject.renamedTo =
|
||||||
|
renamedSubjects.isNotEmpty ? renamedSubjects[exam.subject.id] : null;
|
||||||
|
exam.teacher.renamedTo =
|
||||||
|
renamedTeachers.isNotEmpty ? renamedTeachers[exam.teacher.id] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
// Fetches Exams from the Kreta API then stores them in the database
|
// Fetches Exams from the Kreta API then stores them in the database
|
||||||
Future<void> fetch() async {
|
Future<void> fetch() async {
|
||||||
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
||||||
if (user == null) throw "Cannot fetch Exams for User null";
|
if (user == null) throw "Cannot fetch Exams for User null";
|
||||||
String iss = user.instituteCode;
|
String iss = user.instituteCode;
|
||||||
|
|
||||||
List? examsJson = await Provider.of<KretaClient>(_context, listen: false).getAPI(KretaAPI.exams(iss));
|
List? examsJson = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.exams(iss));
|
||||||
if (examsJson == null) throw "Cannot fetch Exams for User ${user.id}";
|
if (examsJson == null) throw "Cannot fetch Exams for User ${user.id}";
|
||||||
List<Exam> exams = examsJson.map((e) => Exam.fromJson(e)).toList();
|
List<Exam> exams = examsJson.map((e) => Exam.fromJson(e)).toList();
|
||||||
|
|
||||||
@@ -52,8 +82,11 @@ class ExamProvider with ChangeNotifier {
|
|||||||
if (user == null) throw "Cannot store Exams for User null";
|
if (user == null) throw "Cannot store Exams for User null";
|
||||||
String userId = user.id;
|
String userId = user.id;
|
||||||
|
|
||||||
await Provider.of<DatabaseProvider>(_context, listen: false).userStore.storeExams(exams, userId: userId);
|
await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userStore
|
||||||
|
.storeExams(exams, userId: userId);
|
||||||
_exams = exams;
|
_exams = exams;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
await convertBySettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
// import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/models/user.dart';
|
import 'package:filcnaplo/models/user.dart';
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
import 'package:filcnaplo_kreta_api/client/api.dart';
|
||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
@@ -11,7 +11,7 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
class HomeworkProvider with ChangeNotifier {
|
class HomeworkProvider with ChangeNotifier {
|
||||||
// Private
|
// Private
|
||||||
late final SettingsProvider _settings;
|
// late final SettingsProvider _settings;
|
||||||
late final UserProvider _user;
|
late final UserProvider _user;
|
||||||
late final DatabaseProvider _database;
|
late final DatabaseProvider _database;
|
||||||
|
|
||||||
@@ -24,10 +24,12 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
List<Homework> initialHomework = const [],
|
List<Homework> initialHomework = const [],
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required DatabaseProvider database,
|
required DatabaseProvider database,
|
||||||
|
required UserProvider user,
|
||||||
}) {
|
}) {
|
||||||
_homework = List.castFrom(initialHomework);
|
_homework = List.castFrom(initialHomework);
|
||||||
_context = context;
|
_context = context;
|
||||||
_database = database;
|
_database = database;
|
||||||
|
_user = user;
|
||||||
|
|
||||||
if (_homework.isEmpty) restore();
|
if (_homework.isEmpty) restore();
|
||||||
}
|
}
|
||||||
@@ -78,9 +80,11 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
List? homeworkJson = [];
|
List? homeworkJson = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
homeworkJson = await Provider.of<KretaClient>(_context, listen: false)
|
Iterable hwjson = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
.getAPI(KretaAPI.homework(iss, start: from));
|
.getAPI(KretaAPI.homework(iss, start: from));
|
||||||
|
homeworkJson = List.from(hwjson.map((model) => model));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (kDebugMode) print(e);
|
||||||
// error fetcing homework (unknown error)
|
// error fetcing homework (unknown error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,15 +97,15 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
await Future.forEach(homeworkJson.cast<Map>(), (Map hw) async {
|
await Future.forEach(homeworkJson.cast<Map>(), (Map hw) async {
|
||||||
Map? e = await Provider.of<KretaClient>(_context, listen: false)
|
Map? e = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
.getAPI(KretaAPI.homework(iss, id: hw["Uid"]));
|
.getAPI(KretaAPI.homework(iss, id: hw["Uid"]));
|
||||||
Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled
|
// Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled
|
||||||
? await _database.userQuery.renamedSubjects(userId: _user.user!.id)
|
// ? await _database.userQuery.renamedSubjects(userId: _user.user!.id)
|
||||||
: {};
|
// : {};
|
||||||
|
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
Homework hw = Homework.fromJson(e);
|
Homework hmwrk = Homework.fromJson(e);
|
||||||
hw.subject.renamedTo =
|
// hw.subject.renamedTo =
|
||||||
renamedSubjects.isNotEmpty ? renamedSubjects[hw.subject.id] : null;
|
// renamedSubjects.isNotEmpty ? renamedSubjects[hw.subject.id] : null;
|
||||||
homework.add(hw);
|
homework.add(hmwrk);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -110,6 +114,7 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
if (db) await store(homework);
|
if (db) await store(homework);
|
||||||
_homework = homework;
|
_homework = homework;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
await convertBySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stores Homework in the database
|
// Stores Homework in the database
|
||||||
|
|||||||
165
filcnaplo_kreta_api/lib/providers/subject_provider.dart
Normal file
165
filcnaplo_kreta_api/lib/providers/subject_provider.dart
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
// import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
|
// import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
|
// import 'package:filcnaplo/models/settings.dart';
|
||||||
|
// import 'package:filcnaplo/models/user.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/client/api.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/models/grade.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/models/group_average.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/providers/grade_provider.i18n.dart';
|
||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// class SubjectProvider with ChangeNotifier {
|
||||||
|
// // Private
|
||||||
|
// late List<Grade> _grades;
|
||||||
|
// late DateTime _lastSeen;
|
||||||
|
// late String _groups;
|
||||||
|
// List<GroupAverage> _groupAvg = [];
|
||||||
|
// late final SettingsProvider _settings;
|
||||||
|
// late final UserProvider _user;
|
||||||
|
// late final DatabaseProvider _database;
|
||||||
|
// late final KretaClient _kreta;
|
||||||
|
|
||||||
|
// // Public
|
||||||
|
// List<Grade> get grades => _grades;
|
||||||
|
// DateTime get lastSeenDate =>
|
||||||
|
// _settings.gradeOpeningFun ? _lastSeen : DateTime(3000);
|
||||||
|
// String get groups => _groups;
|
||||||
|
// List<GroupAverage> get groupAverages => _groupAvg;
|
||||||
|
|
||||||
|
// SubjectProvider({
|
||||||
|
// List<Grade> initialGrades = const [],
|
||||||
|
// required SettingsProvider settings,
|
||||||
|
// required UserProvider user,
|
||||||
|
// required DatabaseProvider database,
|
||||||
|
// required KretaClient kreta,
|
||||||
|
// }) {
|
||||||
|
// _settings = settings;
|
||||||
|
// _user = user;
|
||||||
|
// _database = database;
|
||||||
|
// _kreta = kreta;
|
||||||
|
|
||||||
|
// _grades = List.castFrom(initialGrades);
|
||||||
|
// _lastSeen = DateTime.now();
|
||||||
|
|
||||||
|
// if (_grades.isEmpty) restore();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> seenAll() async {
|
||||||
|
// String? userId = _user.id;
|
||||||
|
// if (userId != null) {
|
||||||
|
// final userStore = _database.userStore;
|
||||||
|
// userStore.storeLastSeenGrade(DateTime.now(), userId: userId);
|
||||||
|
// _lastSeen = DateTime.now();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> restore() async {
|
||||||
|
// String? userId = _user.id;
|
||||||
|
|
||||||
|
// // Load grades from the database
|
||||||
|
// if (userId != null) {
|
||||||
|
// final userQuery = _database.userQuery;
|
||||||
|
|
||||||
|
// _grades = await userQuery.getGrades(userId: userId);
|
||||||
|
// await convertBySettings();
|
||||||
|
// _groupAvg = await userQuery.getGroupAverages(userId: userId);
|
||||||
|
// notifyListeners();
|
||||||
|
// DateTime lastSeenDB = await userQuery.lastSeenGrade(userId: userId);
|
||||||
|
// if (lastSeenDB.millisecondsSinceEpoch == 0 ||
|
||||||
|
// lastSeenDB.year == 0 ||
|
||||||
|
// !_settings.gradeOpeningFun) {
|
||||||
|
// _lastSeen = DateTime.now();
|
||||||
|
// await seenAll();
|
||||||
|
// } else {
|
||||||
|
// _lastSeen = lastSeenDB;
|
||||||
|
// }
|
||||||
|
// notifyListeners();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 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> renamedTeachers = _settings.renamedTeachersEnabled
|
||||||
|
// ? await _database.userQuery.renamedTeachers(userId: _user.user!.id)
|
||||||
|
// : {};
|
||||||
|
|
||||||
|
// for (Grade grade in _grades) {
|
||||||
|
// grade.subject.renamedTo =
|
||||||
|
// renamedSubjects.isNotEmpty ? renamedSubjects[grade.subject.id] : null;
|
||||||
|
// grade.teacher.renamedTo =
|
||||||
|
// renamedTeachers.isNotEmpty ? renamedTeachers[grade.teacher.id] : null;
|
||||||
|
|
||||||
|
// grade.value.value =
|
||||||
|
// _settings.goodStudent ? 5 : grade.json!["SzamErtek"] ?? 0;
|
||||||
|
// grade.value.valueName = _settings.goodStudent
|
||||||
|
// ? "Jeles".i18n
|
||||||
|
// : '${grade.json!["SzovegesErtek"]}'
|
||||||
|
// .replaceAll(RegExp(r'[(]+[12345]?[)]'), '')
|
||||||
|
// .i18n;
|
||||||
|
// grade.value.shortName = _settings.goodStudent
|
||||||
|
// ? "Jeles".i18n
|
||||||
|
// : '${grade.json!["SzovegesErtekelesRovidNev"]}' != "null" &&
|
||||||
|
// '${grade.json!["SzovegesErtekelesRovidNev"]}' != "-" &&
|
||||||
|
// '${grade.json!["SzovegesErtekelesRovidNev"]}'
|
||||||
|
// .replaceAll(RegExp(r'[0123456789]+[%]?'), '') !=
|
||||||
|
// ""
|
||||||
|
// ? '${grade.json!["SzovegesErtekelesRovidNev"]}'.i18n
|
||||||
|
// : grade.value.valueName;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// notifyListeners();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // fetch subjects from kreten then store them
|
||||||
|
// Future<void> fetch() async {
|
||||||
|
// User? user = _user.user;
|
||||||
|
// if (user == null) throw "Cannot fetch Subjects for User null";
|
||||||
|
// String iss = user.instituteCode;
|
||||||
|
|
||||||
|
// List? gradesJson = await _kreta.getAPI(KretaAPI.subjects(iss, ""));
|
||||||
|
// if (gradesJson == null) throw "Cannot fetch Subjects for User ${user.id}";
|
||||||
|
// List<Grade> grades = gradesJson.map((e) => Grade.fromJson(e)).toList();
|
||||||
|
|
||||||
|
// 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}";
|
||||||
|
// }
|
||||||
|
// _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();
|
||||||
|
// await storeGroupAvg(groupAvgs);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // store subjects in db
|
||||||
|
// Future<void> store(List<Grade> grades) async {
|
||||||
|
// User? user = _user.user;
|
||||||
|
// if (user == null) throw "Cannot store Grades for User null";
|
||||||
|
// String userId = user.id;
|
||||||
|
|
||||||
|
// await _database.userStore.storeGrades(grades, userId: userId);
|
||||||
|
// _grades = grades;
|
||||||
|
// await convertBySettings();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> storeGroupAvg(List<GroupAverage> groupAvgs) async {
|
||||||
|
// _groupAvg = groupAvgs;
|
||||||
|
|
||||||
|
// User? user = _user.user;
|
||||||
|
// if (user == null) throw "Cannot store Grades for User null";
|
||||||
|
// String userId = user.id;
|
||||||
|
// await _database.userStore.storeGroupAverages(groupAvgs, userId: userId);
|
||||||
|
// notifyListeners();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
@@ -5,7 +5,7 @@ import 'package:filcnaplo_kreta_api/client/api.dart';
|
|||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
import 'package:filcnaplo_kreta_api/models/week.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
class TimetableProvider with ChangeNotifier {
|
class TimetableProvider with ChangeNotifier {
|
||||||
Map<Week, List<Lesson>> lessons = {};
|
Map<Week, List<Lesson>> lessons = {};
|
||||||
@@ -69,14 +69,14 @@ class TimetableProvider with ChangeNotifier {
|
|||||||
.getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end));
|
.getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end));
|
||||||
|
|
||||||
if (lessonsJson == null) {
|
if (lessonsJson == null) {
|
||||||
|
if (kDebugMode) print('Cannot fetch Lessons for User ${user.id}');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
// throw "Cannot fetch Lessons for User ${user.id}";
|
// throw "Cannot fetch Lessons for User ${user.id}";
|
||||||
} else {
|
} else {
|
||||||
List<Lesson> lessonsList =
|
List<Lesson> lessonsList =
|
||||||
lessonsJson.map((e) => Lesson.fromJson(e)).toList();
|
lessonsJson.map((e) => Lesson.fromJson(e)).toList();
|
||||||
|
|
||||||
if (lessons.isEmpty) return;
|
|
||||||
|
|
||||||
lessons[week] = lessonsList;
|
lessons[week] = lessonsList;
|
||||||
|
|
||||||
await store();
|
await store();
|
||||||
|
|||||||
47
filcnaplo_mobile_ui/.gitignore
vendored
47
filcnaplo_mobile_ui/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
pubspec.lock
|
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class Panel extends StatelessWidget {
|
class Panel extends StatelessWidget {
|
||||||
const Panel({Key? key, this.child, this.title, this.padding, this.hasShadow = true}) : super(key: key);
|
const Panel(
|
||||||
|
{Key? key, this.child, this.title, this.padding, this.hasShadow = true})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final Widget? title;
|
final Widget? title;
|
||||||
@@ -25,7 +29,9 @@ class Panel extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
if (hasShadow)
|
if (hasShadow &&
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false)
|
||||||
|
.shadowEffect)
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
offset: const Offset(0, 21),
|
offset: const Offset(0, 21),
|
||||||
blurRadius: 23.0,
|
blurRadius: 23.0,
|
||||||
@@ -51,7 +57,9 @@ class PanelTitle extends StatelessWidget {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
||||||
child: DefaultTextStyle(
|
child: DefaultTextStyle(
|
||||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w600, color: AppColors.of(context).text.withOpacity(0.65)),
|
style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.of(context).text.withOpacity(0.65)),
|
||||||
child: title,
|
child: title,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -69,14 +77,17 @@ class PanelHeader extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
|
borderRadius: const BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -96,11 +107,13 @@ class PanelBody extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
padding: padding,
|
padding: padding,
|
||||||
@@ -120,14 +133,18 @@ class PanelFooter extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(16.0), bottomRight: Radius.circular(16.0)),
|
borderRadius: const BorderRadius.only(
|
||||||
|
bottomLeft: Radius.circular(16.0),
|
||||||
|
bottomRight: Radius.circular(16.0)),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:dotted_border/dotted_border.dart';
|
import 'package:dotted_border/dotted_border.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class EmptyCard extends StatefulWidget {
|
class EmptyCard extends StatefulWidget {
|
||||||
const EmptyCard({
|
const EmptyCard({
|
||||||
@@ -39,12 +41,14 @@ class _EmptyCardState extends State<EmptyCard> {
|
|||||||
color: const Color(0x280008FF),
|
color: const Color(0x280008FF),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
color: Colors.black.withOpacity(0.08),
|
.shadowEffect)
|
||||||
offset: const Offset(0, 5),
|
BoxShadow(
|
||||||
blurRadius: 20,
|
color: Colors.black.withOpacity(0.08),
|
||||||
spreadRadius: 10,
|
offset: const Offset(0, 5),
|
||||||
),
|
blurRadius: 20,
|
||||||
|
spreadRadius: 10,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: DottedBorder(
|
child: DottedBorder(
|
||||||
|
|||||||
@@ -35,12 +35,12 @@ class _PersonalityCardState extends State<PersonalityCard> {
|
|||||||
late SettingsProvider settings;
|
late SettingsProvider settings;
|
||||||
|
|
||||||
late List<int> subjectAvgsList = [];
|
late List<int> subjectAvgsList = [];
|
||||||
late Map<Subject, double> subjectAvgs = {};
|
late Map<GradeSubject, double> subjectAvgs = {};
|
||||||
late double subjectAvg;
|
late double subjectAvg;
|
||||||
late List<Grade> classWorkGrades;
|
late List<Grade> classWorkGrades;
|
||||||
late Map<int, int> mostCommonGrade;
|
late Map<int, int> mostCommonGrade;
|
||||||
late List<Absence> absences = [];
|
late List<Absence> absences = [];
|
||||||
final Map<Subject, Lesson> _lessonCount = {};
|
final Map<GradeSubject, Lesson> _lessonCount = {};
|
||||||
late int totalDelays;
|
late int totalDelays;
|
||||||
late int unexcusedAbsences;
|
late int unexcusedAbsences;
|
||||||
|
|
||||||
@@ -48,14 +48,15 @@ class _PersonalityCardState extends State<PersonalityCard> {
|
|||||||
|
|
||||||
bool hold = false;
|
bool hold = false;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject, {int days = 0}) => gradeProvider
|
List<Grade> getSubjectGrades(GradeSubject subject, {int days = 0}) =>
|
||||||
.grades
|
gradeProvider.grades
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.subject == subject &&
|
e.subject == subject &&
|
||||||
e.type == GradeType.midYear &&
|
e.type == GradeType.midYear &&
|
||||||
(days == 0 ||
|
(days == 0 ||
|
||||||
e.date.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
e.date
|
||||||
.toList();
|
.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
||||||
|
.toList();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -89,13 +90,13 @@ class _PersonalityCardState extends State<PersonalityCard> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void getGrades() {
|
void getGrades() {
|
||||||
List<Subject> subjects = gradeProvider.grades
|
List<GradeSubject> subjects = gradeProvider.grades
|
||||||
.map((e) => e.subject)
|
.map((e) => e.subject)
|
||||||
.toSet()
|
.toSet()
|
||||||
.toList()
|
.toList()
|
||||||
..sort((a, b) => a.name.compareTo(b.name));
|
..sort((a, b) => a.name.compareTo(b.name));
|
||||||
|
|
||||||
for (Subject subject in subjects) {
|
for (GradeSubject subject in subjects) {
|
||||||
List<Grade> subjectGrades = getSubjectGrades(subject);
|
List<Grade> subjectGrades = getSubjectGrades(subject);
|
||||||
|
|
||||||
double avg = AverageHelper.averageEvals(subjectGrades);
|
double avg = AverageHelper.averageEvals(subjectGrades);
|
||||||
|
|||||||
22
filcnaplo_mobile_ui/lib/common/soon_alert/soon_alert.dart
Normal file
22
filcnaplo_mobile_ui/lib/common/soon_alert/soon_alert.dart
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import 'package:filcnaplo_mobile_ui/common/action_button.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/common/soon_alert/soon_alert.i18n.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SoonAlert extends StatelessWidget {
|
||||||
|
const SoonAlert({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static show({required BuildContext context}) =>
|
||||||
|
showDialog(context: context, builder: (context) => const SoonAlert());
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
||||||
|
title: Text('soon'.i18n),
|
||||||
|
content: Text('soon_body'.i18n),
|
||||||
|
actions: [
|
||||||
|
ActionButton(label: "Ok", onTap: () => Navigator.of(context).pop())
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import 'package:i18n_extension/i18n_extension.dart';
|
||||||
|
|
||||||
|
extension Localization on String {
|
||||||
|
static final _t = Translations.byLocale("hu_hu") +
|
||||||
|
{
|
||||||
|
"en_en": {
|
||||||
|
"soon": "Soon...",
|
||||||
|
"soon_body": "This feature is currently not available yet!",
|
||||||
|
},
|
||||||
|
"hu_hu": {
|
||||||
|
"soon": "Hamarosan...",
|
||||||
|
"soon_body": "Ez a funkció jelenleg még nem elérhető!",
|
||||||
|
},
|
||||||
|
"de_de": {
|
||||||
|
"soon": "Bald...",
|
||||||
|
"soon_body": "Diese Funktion ist derzeit noch nicht verfügbar!",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
@@ -8,10 +8,16 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class AbsenceSubjectTile extends StatelessWidget {
|
class AbsenceSubjectTile extends StatelessWidget {
|
||||||
const AbsenceSubjectTile(this.subject, {Key? key, this.percentage = 0.0, this.excused = 0, this.unexcused = 0, this.pending = 0, this.onTap})
|
const AbsenceSubjectTile(this.subject,
|
||||||
|
{Key? key,
|
||||||
|
this.percentage = 0.0,
|
||||||
|
this.excused = 0,
|
||||||
|
this.unexcused = 0,
|
||||||
|
this.pending = 0,
|
||||||
|
this.onTap})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
final double percentage;
|
final double percentage;
|
||||||
|
|
||||||
@@ -31,12 +37,20 @@ class AbsenceSubjectTile extends StatelessWidget {
|
|||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)),
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
leading: Icon(SubjectIcon.resolveVariant(subject: subject, context: context), size: 32.0),
|
leading: Icon(
|
||||||
|
SubjectIcon.resolveVariant(subject: subject, context: context),
|
||||||
|
size: 32.0),
|
||||||
title: Text(
|
title: Text(
|
||||||
subject.renamedTo ?? subject.name.capital(),
|
subject.renamedTo ?? subject.name.capital(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.0, fontStyle: subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 15.0,
|
||||||
|
fontStyle:
|
||||||
|
subject.isRenamed && settingsProvider.renamedSubjectsItalics
|
||||||
|
? FontStyle.italic
|
||||||
|
: null),
|
||||||
),
|
),
|
||||||
subtitle: AbsenceDisplay(excused, unexcused, pending),
|
subtitle: AbsenceDisplay(excused, unexcused, pending),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
@@ -47,7 +61,10 @@ class AbsenceSubjectTile extends StatelessWidget {
|
|||||||
Stack(
|
Stack(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
children: [
|
children: [
|
||||||
const Opacity(child: Text("100%", style: TextStyle(fontFamily: "monospace")), opacity: 0),
|
const Opacity(
|
||||||
|
child: Text("100%",
|
||||||
|
style: TextStyle(fontFamily: "monospace")),
|
||||||
|
opacity: 0),
|
||||||
Text(
|
Text(
|
||||||
percentage.round().toString() + "%",
|
percentage.round().toString() + "%",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class AbsenceView extends StatelessWidget {
|
|||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () { // https://discord.com/channels/1111649116020285532/1149964760130002945
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
if (outsideContext != null) {
|
if (outsideContext != null) {
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ class AdTile extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
print('geic');
|
|
||||||
print(ad);
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: PanelButton(
|
child: PanelButton(
|
||||||
@@ -38,12 +35,15 @@ class AdTile extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
leading: ad.logoUrl != null
|
leading: ad.logoUrl != null
|
||||||
? Image.network(
|
? ClipRRect(
|
||||||
ad.logoUrl.toString(),
|
borderRadius: BorderRadius.circular(50.0),
|
||||||
errorBuilder: (context, error, stackTrace) {
|
child: Image.network(
|
||||||
ad.logoUrl = null;
|
ad.logoUrl.toString(),
|
||||||
return const SizedBox();
|
errorBuilder: (context, error, stackTrace) {
|
||||||
},
|
ad.logoUrl = null;
|
||||||
|
return const SizedBox();
|
||||||
|
},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
trailing: const Icon(FeatherIcons.externalLink),
|
trailing: const Icon(FeatherIcons.externalLink),
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import 'package:filcnaplo/utils/format.dart';
|
|||||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
|
|
||||||
class ExamTile extends StatelessWidget {
|
class ExamTile extends StatelessWidget {
|
||||||
const ExamTile(this.exam, {Key? key, this.onTap, this.padding}) : super(key: key);
|
const ExamTile(this.exam, {Key? key, this.onTap, this.padding})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
final Exam exam;
|
final Exam exam;
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
@@ -22,26 +23,32 @@ class ExamTile extends StatelessWidget {
|
|||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
contentPadding: const EdgeInsets.only(left: 8.0, right: 12.0),
|
contentPadding: const EdgeInsets.only(left: 8.0, right: 12.0),
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)),
|
shape:
|
||||||
|
RoundedRectangleBorder(borderRadius: BorderRadius.circular(14.0)),
|
||||||
leading: SizedBox(
|
leading: SizedBox(
|
||||||
width: 44,
|
width: 44,
|
||||||
height: 44,
|
height: 44,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 2.0),
|
padding: const EdgeInsets.only(top: 2.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
SubjectIcon.resolveVariant(subjectName: exam.subjectName, context: context),
|
SubjectIcon.resolveVariant(
|
||||||
|
subject: exam.subject, context: context),
|
||||||
size: 28.0,
|
size: 28.0,
|
||||||
color: AppColors.of(context).text.withOpacity(.75),
|
color: AppColors.of(context).text.withOpacity(.75),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
title: Text(
|
title: Text(
|
||||||
exam.description != "" ? exam.description : (exam.mode?.description ?? "Számonkérés"),
|
exam.description != ""
|
||||||
|
? exam.description
|
||||||
|
: (exam.mode?.description ?? "Számonkérés"),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
exam.subjectName.capital(),
|
exam.subject.isRenamed
|
||||||
|
? exam.subject.renamedTo!
|
||||||
|
: exam.subject.name.capital(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||||
|
|||||||
@@ -29,13 +29,15 @@ class ExamView extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(left: 6.0),
|
padding: const EdgeInsets.only(left: 6.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
SubjectIcon.resolveVariant(
|
SubjectIcon.resolveVariant(
|
||||||
subjectName: exam.subjectName, context: context),
|
subject: exam.subject, context: context),
|
||||||
size: 36.0,
|
size: 36.0,
|
||||||
color: AppColors.of(context).text.withOpacity(.75),
|
color: AppColors.of(context).text.withOpacity(.75),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
exam.subjectName.capital(),
|
exam.subject.isRenamed
|
||||||
|
? exam.subject.renamedTo!
|
||||||
|
: exam.subject.name.capital(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class GradeSubjectTile extends StatelessWidget {
|
|||||||
this.averageBefore = 0.0})
|
this.averageBefore = 0.0})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
final double average;
|
final double average;
|
||||||
final double groupAverage;
|
final double groupAverage;
|
||||||
@@ -56,7 +56,10 @@ class GradeSubjectTile extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: textColor,
|
color: textColor,
|
||||||
fontStyle: settingsProvider.renamedSubjectsItalics && subject.isRenamed ? FontStyle.italic : null),
|
fontStyle:
|
||||||
|
settingsProvider.renamedSubjectsItalics && subject.isRenamed
|
||||||
|
? FontStyle.italic
|
||||||
|
: null),
|
||||||
),
|
),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class HomeworkTile extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(top: 2.0),
|
padding: const EdgeInsets.only(top: 2.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
SubjectIcon.resolveVariant(
|
SubjectIcon.resolveVariant(
|
||||||
subjectName: homework.subject.name, context: context),
|
subject: homework.subject, context: context),
|
||||||
size: 28.0,
|
size: 28.0,
|
||||||
color: AppColors.of(context).text.withOpacity(.75),
|
color: AppColors.of(context).text.withOpacity(.75),
|
||||||
),
|
),
|
||||||
@@ -69,7 +69,12 @@ class HomeworkTile extends StatelessWidget {
|
|||||||
homework.subject.renamedTo ?? homework.subject.name.capital(),
|
homework.subject.renamedTo ?? homework.subject.name.capital(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: homework.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontStyle: homework.subject.isRenamed &&
|
||||||
|
settingsProvider.renamedSubjectsItalics
|
||||||
|
? FontStyle.italic
|
||||||
|
: null),
|
||||||
),
|
),
|
||||||
subtitle: censored
|
subtitle: censored
|
||||||
? Wrap(
|
? Wrap(
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class HomeworkView extends StatelessWidget {
|
|||||||
ListTile(
|
ListTile(
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
SubjectIcon.resolveVariant(
|
SubjectIcon.resolveVariant(
|
||||||
subjectName: homework.subject.name, context: context),
|
subject: homework.subject, context: context),
|
||||||
size: 36.0,
|
size: 36.0,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ class ChangedLessonTile extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
lesson.substituteTeacher?.name != ""
|
lesson.status?.name == "Elmaradt" && lesson.substituteTeacher?.name != ""
|
||||||
? "substituted".i18n
|
? "cancelled".i18n
|
||||||
: "cancelled".i18n,
|
: "substituted".i18n,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import 'package:auto_size_text/auto_size_text.dart';
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:i18n_extension/i18n_widget.dart';
|
import 'package:i18n_extension/i18n_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class StatisticsTile extends StatelessWidget {
|
class StatisticsTile extends StatelessWidget {
|
||||||
const StatisticsTile({
|
const StatisticsTile({
|
||||||
@@ -31,7 +33,9 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
valueText = value.toStringAsFixed(0);
|
valueText = value.toStringAsFixed(0);
|
||||||
}
|
}
|
||||||
if (I18n.of(context).locale.languageCode != "en") valueText = valueText.replaceAll(".", ",");
|
if (I18n.of(context).locale.languageCode != "en") {
|
||||||
|
valueText = valueText.replaceAll(".", ",");
|
||||||
|
}
|
||||||
|
|
||||||
if (value.isNaN) {
|
if (value.isNaN) {
|
||||||
valueText = "?";
|
valueText = "?";
|
||||||
@@ -44,11 +48,13 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
@@ -68,13 +74,19 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
if (title != null) const SizedBox(height: 4.0),
|
if (title != null) const SizedBox(height: 4.0),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(top: 4.0),
|
margin: const EdgeInsets.only(top: 4.0),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0),
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: fill ? (color ?? gradeColor(context: context, value: value)).withOpacity(.2) : null,
|
color: fill
|
||||||
|
? (color ?? gradeColor(context: context, value: value))
|
||||||
|
.withOpacity(.2)
|
||||||
|
: null,
|
||||||
border: outline || fill
|
border: outline || fill
|
||||||
? Border.all(
|
? Border.all(
|
||||||
color: (color ?? gradeColor(context: context, value: value)).withOpacity(outline ? 1.0 : 0.0),
|
color:
|
||||||
width: fill ? 2.0 : 5.0,
|
(color ?? gradeColor(context: context, value: value))
|
||||||
|
.withOpacity(outline ? 1.0 : 0.0),
|
||||||
|
width: fill ? 5.0 : 5.0,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
borderRadius: BorderRadius.circular(45.0),
|
borderRadius: BorderRadius.circular(45.0),
|
||||||
@@ -96,7 +108,7 @@ class StatisticsTile extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: color ?? gradeColor(context: context, value: value),
|
color: color ?? gradeColor(context: context, value: value),
|
||||||
fontWeight: FontWeight.w800,
|
fontWeight: FontWeight.w800,
|
||||||
fontSize: 32.0,
|
fontSize: 28.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ class AbsenceSubjectView extends StatelessWidget {
|
|||||||
const AbsenceSubjectView(this.subject, {Key? key, this.absences = const []})
|
const AbsenceSubjectView(this.subject, {Key? key, this.absences = const []})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
final List<Absence> absences;
|
final List<Absence> absences;
|
||||||
|
|
||||||
static void show(Subject subject, List<Absence> absences,
|
static void show(GradeSubject subject, List<Absence> absences,
|
||||||
{required BuildContext context}) {
|
{required BuildContext context}) {
|
||||||
Navigator.of(context, rootNavigator: true)
|
Navigator.of(context, rootNavigator: true)
|
||||||
.push<Absence>(CupertinoPageRoute(
|
.push<Absence>(CupertinoPageRoute(
|
||||||
@@ -40,7 +40,7 @@ class AbsenceSubjectView extends StatelessWidget {
|
|||||||
TimetablePage.jump(context, lesson: lesson);
|
TimetablePage.jump(context, lesson: lesson);
|
||||||
} else {
|
} else {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(CustomSnackBar(
|
||||||
content: Text("Cannot find lesson".i18n,
|
content: Text("lesson_not_found".i18n,
|
||||||
style: const TextStyle(color: Colors.white)),
|
style: const TextStyle(color: Colors.white)),
|
||||||
backgroundColor: AppColors.of(context).red,
|
backgroundColor: AppColors.of(context).red,
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import 'absences_page.i18n.dart';
|
|||||||
enum AbsenceFilter { absences, delays, misses }
|
enum AbsenceFilter { absences, delays, misses }
|
||||||
|
|
||||||
class SubjectAbsence {
|
class SubjectAbsence {
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
List<Absence> absences;
|
List<Absence> absences;
|
||||||
double percentage;
|
double percentage;
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
late String firstName;
|
late String firstName;
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
late List<SubjectAbsence> absences = [];
|
late List<SubjectAbsence> absences = [];
|
||||||
final Map<Subject, Lesson> _lessonCount = {};
|
final Map<GradeSubject, Lesson> _lessonCount = {};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -90,7 +90,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void buildSubjectAbsences() {
|
void buildSubjectAbsences() {
|
||||||
Map<Subject, SubjectAbsence> _absences = {};
|
Map<GradeSubject, SubjectAbsence> _absences = {};
|
||||||
|
|
||||||
for (final absence in absenceProvider.absences) {
|
for (final absence in absenceProvider.absences) {
|
||||||
if (absence.delay != 0) continue;
|
if (absence.delay != 0) continue;
|
||||||
@@ -285,8 +285,9 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
content: Text("attention_body".i18n),
|
content: Text("attention_body".i18n),
|
||||||
actions: [
|
actions: [
|
||||||
ActionButton(
|
ActionButton(
|
||||||
label: "Ok",
|
label: "Ok",
|
||||||
onTap: () => Navigator.of(context).pop())
|
onTap: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ extension ScreensLocalization on String {
|
|||||||
"Subjects": "Subjects",
|
"Subjects": "Subjects",
|
||||||
"attention": "Attention!",
|
"attention": "Attention!",
|
||||||
"attention_body": "Percentage calculations are only an approximation so they may not be accurate.",
|
"attention_body": "Percentage calculations are only an approximation so they may not be accurate.",
|
||||||
|
"lesson_not_found": "Cannot find lesson",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
"Absences": "Hiányzások",
|
"Absences": "Hiányzások",
|
||||||
@@ -32,6 +33,7 @@ extension ScreensLocalization on String {
|
|||||||
"Subjects": "Tantárgyak",
|
"Subjects": "Tantárgyak",
|
||||||
"attention": "Figyelem!",
|
"attention": "Figyelem!",
|
||||||
"attention_body": "A százalékos számítások csak közelítések, ezért előfordulhat, hogy nem pontosak.",
|
"attention_body": "A százalékos számítások csak közelítések, ezért előfordulhat, hogy nem pontosak.",
|
||||||
|
"lesson_not_found": "Nem található óra",
|
||||||
},
|
},
|
||||||
"de_de": {
|
"de_de": {
|
||||||
"Absences": "Fehlen",
|
"Absences": "Fehlen",
|
||||||
@@ -47,6 +49,7 @@ extension ScreensLocalization on String {
|
|||||||
"Subjects": "Fächer",
|
"Subjects": "Fächer",
|
||||||
"attention": "Achtung!",
|
"attention": "Achtung!",
|
||||||
"attention_body": "Prozentberechnungen sind nur eine Annäherung und können daher ungenau sein.",
|
"attention_body": "Prozentberechnungen sind nur eine Annäherung und können daher ungenau sein.",
|
||||||
|
"lesson_not_found": "Lektion kann nicht gefunden werden",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import 'grade_calculator.i18n.dart';
|
|||||||
class GradeCalculator extends StatefulWidget {
|
class GradeCalculator extends StatefulWidget {
|
||||||
const GradeCalculator(this.subject, {Key? key}) : super(key: key);
|
const GradeCalculator(this.subject, {Key? key}) : super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_GradeCalculatorState createState() => _GradeCalculatorState();
|
_GradeCalculatorState createState() => _GradeCalculatorState();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import 'grades_page.i18n.dart';
|
|||||||
class FailWarning extends StatelessWidget {
|
class FailWarning extends StatelessWidget {
|
||||||
const FailWarning({Key? key, required this.subjectAvgs}) : super(key: key);
|
const FailWarning({Key? key, required this.subjectAvgs}) : super(key: key);
|
||||||
|
|
||||||
final Map<Subject, double> subjectAvgs;
|
final Map<GradeSubject, double> subjectAvgs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class GradeSubjectView extends StatefulWidget {
|
|||||||
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
final double groupAverage;
|
final double groupAverage;
|
||||||
|
|
||||||
void push(BuildContext context, {bool root = false}) {
|
void push(BuildContext context, {bool root = false}) {
|
||||||
@@ -77,7 +77,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
|
|
||||||
String plan = '';
|
String plan = '';
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject) => !gradeCalcMode
|
List<Grade> getSubjectGrades(GradeSubject subject) => !gradeCalcMode
|
||||||
? gradeProvider.grades.where((e) => e.subject == subject).toList()
|
? gradeProvider.grades.where((e) => e.subject == subject).toList()
|
||||||
: calculatorProvider.grades.where((e) => e.subject == subject).toList();
|
: calculatorProvider.grades.where((e) => e.subject == subject).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -48,24 +48,25 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
|
|
||||||
int avgDropValue = 0;
|
int avgDropValue = 0;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject, {int days = 0}) => gradeProvider
|
List<Grade> getSubjectGrades(GradeSubject subject, {int days = 0}) =>
|
||||||
.grades
|
gradeProvider.grades
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.subject == subject &&
|
e.subject == subject &&
|
||||||
e.type == GradeType.midYear &&
|
e.type == GradeType.midYear &&
|
||||||
(days == 0 ||
|
(days == 0 ||
|
||||||
e.date.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
e.date
|
||||||
.toList();
|
.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
||||||
|
.toList();
|
||||||
|
|
||||||
void generateTiles() {
|
void generateTiles() {
|
||||||
List<Subject> subjects = gradeProvider.grades
|
List<GradeSubject> subjects = gradeProvider.grades
|
||||||
.map((e) => e.subject)
|
.map((e) => e.subject)
|
||||||
.toSet()
|
.toSet()
|
||||||
.toList()
|
.toList()
|
||||||
..sort((a, b) => a.name.compareTo(b.name));
|
..sort((a, b) => a.name.compareTo(b.name));
|
||||||
List<Widget> tiles = [];
|
List<Widget> tiles = [];
|
||||||
|
|
||||||
Map<Subject, double> subjectAvgs = {};
|
Map<GradeSubject, double> subjectAvgs = {};
|
||||||
|
|
||||||
tiles.addAll(subjects.map((subject) {
|
tiles.addAll(subjects.map((subject) {
|
||||||
List<Grade> subjectGrades = getSubjectGrades(subject);
|
List<Grade> subjectGrades = getSubjectGrades(subject);
|
||||||
@@ -154,7 +155,7 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
title: AutoSizeText(
|
title: AutoSizeText(
|
||||||
"subjectavg".i18n,
|
"subjectavg".i18n,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 2,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
value: subjectAvg,
|
value: subjectAvg,
|
||||||
@@ -167,7 +168,7 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
title: AutoSizeText(
|
title: AutoSizeText(
|
||||||
"classavg".i18n,
|
"classavg".i18n,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 2,
|
maxLines: 1,
|
||||||
wrapWords: false,
|
wrapWords: false,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ extension Localization on String {
|
|||||||
"7_days_average": "Weekly Average",
|
"7_days_average": "Weekly Average",
|
||||||
"subjectavg": "Subject Average",
|
"subjectavg": "Subject Average",
|
||||||
"classavg": "Class Average",
|
"classavg": "Class Average",
|
||||||
"fail_warning": "Faliure warning",
|
"fail_warning": "Failure warning",
|
||||||
"fail_warning_description": "You are failing %d subject(s)",
|
"fail_warning_description": "You are failing %d subject(s)",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'home_page.i18n.dart';
|
import 'home_page.i18n.dart';
|
||||||
import 'package:filcnaplo/ui/filter/widgets.dart';
|
import 'package:filcnaplo/ui/filter/widgets.dart';
|
||||||
import 'package:filcnaplo/ui/filter/sort.dart';
|
import 'package:filcnaplo/ui/filter/sort.dart';
|
||||||
|
import 'package:i18n_extension/i18n_extension.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
const HomePage({Key? key}) : super(key: key);
|
const HomePage({Key? key}) : super(key: key);
|
||||||
@@ -94,6 +95,15 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
|
|
||||||
void setGreeting() {
|
void setGreeting() {
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
|
List<String> nameParts = user.displayName?.split(" ") ?? ["?"];
|
||||||
|
if (!settings.presentationMode) {
|
||||||
|
firstName = nameParts.length > 1 ? nameParts[1] : nameParts[0];
|
||||||
|
} else {
|
||||||
|
firstName = "János";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool customWelcome = false;
|
||||||
|
|
||||||
if (now.isBefore(DateTime(now.year, DateTime.august, 31)) &&
|
if (now.isBefore(DateTime(now.year, DateTime.august, 31)) &&
|
||||||
now.isAfter(DateTime(now.year, DateTime.june, 14))) {
|
now.isAfter(DateTime(now.year, DateTime.june, 14))) {
|
||||||
greeting = "goodrest";
|
greeting = "goodrest";
|
||||||
@@ -130,6 +140,14 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
greeting = "merryxmas";
|
greeting = "merryxmas";
|
||||||
} else if (now.month == DateTime.january && now.day == 1) {
|
} else if (now.month == DateTime.january && now.day == 1) {
|
||||||
greeting = "happynewyear";
|
greeting = "happynewyear";
|
||||||
|
} else if (settings.welcomeMessage.replaceAll(' ', '') != '') {
|
||||||
|
greeting = settings.welcomeMessage;
|
||||||
|
greeting = localizeFill(
|
||||||
|
settings.welcomeMessage,
|
||||||
|
[firstName],
|
||||||
|
);
|
||||||
|
|
||||||
|
customWelcome = true;
|
||||||
} else if (now.hour >= 18) {
|
} else if (now.hour >= 18) {
|
||||||
greeting = "goodevening";
|
greeting = "goodevening";
|
||||||
} else if (now.hour >= 10) {
|
} else if (now.hour >= 10) {
|
||||||
@@ -139,6 +157,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
} else {
|
} else {
|
||||||
greeting = "goodevening";
|
greeting = "goodevening";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
greeting = customWelcome ? greeting : greeting.i18n.fill([firstName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -155,13 +175,6 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
|
|
||||||
setGreeting();
|
setGreeting();
|
||||||
|
|
||||||
List<String> nameParts = user.displayName?.split(" ") ?? ["?"];
|
|
||||||
if (!settings.presentationMode) {
|
|
||||||
firstName = nameParts.length > 1 ? nameParts[1] : nameParts[0];
|
|
||||||
} else {
|
|
||||||
firstName = "János";
|
|
||||||
}
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -184,7 +197,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
title: Padding(
|
title: Padding(
|
||||||
padding: const EdgeInsets.only(left: 24.0),
|
padding: const EdgeInsets.only(left: 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
greeting.i18n.fill([firstName]),
|
greeting,
|
||||||
overflow: TextOverflow.fade,
|
overflow: TextOverflow.fade,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ class _LiveCardState extends State<LiveCard> {
|
|||||||
: ""),
|
: ""),
|
||||||
title: liveCard.currentLesson!.subject.renamedTo ??
|
title: liveCard.currentLesson!.subject.renamedTo ??
|
||||||
liveCard.currentLesson!.subject.name.capital(),
|
liveCard.currentLesson!.subject.name.capital(),
|
||||||
titleItalic: liveCard.currentLesson!.subject.isRenamed,
|
titleItalic: liveCard.currentLesson!.subject.isRenamed &&
|
||||||
|
settingsProvider.renamedSubjectsEnabled,
|
||||||
subtitle: liveCard.currentLesson!.room,
|
subtitle: liveCard.currentLesson!.room,
|
||||||
icon: SubjectIcon.resolveVariant(
|
icon: SubjectIcon.resolveVariant(
|
||||||
subject: liveCard.currentLesson!.subject, context: context),
|
subject: liveCard.currentLesson!.subject, context: context),
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/progress_bar.dart';
|
import 'package:filcnaplo_mobile_ui/common/progress_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'live_card.i18n.dart';
|
import 'live_card.i18n.dart';
|
||||||
|
|
||||||
enum ProgressAccuracy { minutes, seconds }
|
enum ProgressAccuracy { minutes, seconds }
|
||||||
@@ -67,11 +69,13 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -180,12 +184,12 @@ class _LiveCardWidgetState extends State<LiveCardWidget> {
|
|||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets
|
margin: const EdgeInsets
|
||||||
.only(
|
.only(
|
||||||
left: 6.0,
|
left: 6.0,
|
||||||
bottom: 3.0),
|
bottom: 3.0),
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets
|
const EdgeInsets
|
||||||
.symmetric(
|
.symmetric(
|
||||||
horizontal: 4.0,
|
horizontal: 4.0,
|
||||||
vertical: 2.0),
|
vertical: 2.0),
|
||||||
decoration:
|
decoration:
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ import 'package:filcnaplo_mobile_ui/common/filter_bar.dart';
|
|||||||
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_button.dart';
|
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_button.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
|
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
|
||||||
import 'package:filcnaplo/ui/filter/sort.dart';
|
import 'package:filcnaplo/ui/filter/sort.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/common/soon_alert/soon_alert.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/message/message_viewable.dart';
|
import 'package:filcnaplo_mobile_ui/common/widgets/message/message_viewable.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'messages_page.i18n.dart';
|
import 'messages_page.i18n.dart';
|
||||||
|
|
||||||
@@ -61,6 +63,33 @@ class _MessagesPageState extends State<MessagesPage>
|
|||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
actions: [
|
actions: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8.0, vertical: 5.0),
|
||||||
|
child: IconButton(
|
||||||
|
splashRadius: 24.0,
|
||||||
|
onPressed: () {
|
||||||
|
// Navigator.of(context, rootNavigator: true)
|
||||||
|
// .push(PageRouteBuilder(
|
||||||
|
// pageBuilder: (context, animation, secondaryAnimation) =>
|
||||||
|
// PremiumFSTimetable(
|
||||||
|
// controller: controller,
|
||||||
|
// ),
|
||||||
|
// ))
|
||||||
|
// .then((_) {
|
||||||
|
// SystemChrome.setPreferredOrientations(
|
||||||
|
// [DeviceOrientation.portraitUp]);
|
||||||
|
// setSystemChrome(context);
|
||||||
|
// });
|
||||||
|
SoonAlert.show(context: context);
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
FeatherIcons.send,
|
||||||
|
color: AppColors.of(context).text,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// Profile Icon
|
// Profile Icon
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 24.0),
|
padding: const EdgeInsets.only(right: 24.0),
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ extension Localization on String {
|
|||||||
"welcome": "Welcome, %s!",
|
"welcome": "Welcome, %s!",
|
||||||
"missing_fields": "Missing Fields!",
|
"missing_fields": "Missing Fields!",
|
||||||
"invalid_grant":
|
"invalid_grant":
|
||||||
"Invalid Username/Password! (Try adding spaces after Username)",
|
// "Invalid Username/Password! (Try adding spaces after Username)",
|
||||||
|
"Invalid Username/Password!",
|
||||||
"error": "Failed to log in.",
|
"error": "Failed to log in.",
|
||||||
"schools_error": "Failed to get schools."
|
"schools_error": "Failed to get schools."
|
||||||
},
|
},
|
||||||
@@ -27,7 +28,8 @@ extension Localization on String {
|
|||||||
"welcome": "Üdv, %s!",
|
"welcome": "Üdv, %s!",
|
||||||
"missing_fields": "Hiányzó adatok!",
|
"missing_fields": "Hiányzó adatok!",
|
||||||
"invalid_grant":
|
"invalid_grant":
|
||||||
"Helytelen Felhasználónév/Jelszó! (Próbálj szóközöket írni a Felhasználónév után)",
|
// "Helytelen Felhasználónév/Jelszó! (Próbálj szóközöket írni a Felhasználónév után)",
|
||||||
|
"Helytelen Felhasználónév/Jelszó!",
|
||||||
"error": "Sikertelen bejelentkezés.",
|
"error": "Sikertelen bejelentkezés.",
|
||||||
"schools_error": "Nem sikerült lekérni az iskolákat."
|
"schools_error": "Nem sikerült lekérni az iskolákat."
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ List<School> searchSchools(List<School> all, String pattern) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (contains == pattern.split(" ").length) results.add(item);
|
if (contains == pattern.split(" ").length) results.add(item);
|
||||||
|
|
||||||
|
if (item.instituteCode.toLowerCase().specialChars().contains(pattern)) results.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
results.sort((a, b) => a.name.compareTo(b.name));
|
results.sort((a, b) => a.name.compareTo(b.name));
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ class SubjectIconGallery extends StatelessWidget {
|
|||||||
SubjectIconItem("Magatartás"),
|
SubjectIconItem("Magatartás"),
|
||||||
SubjectIconItem("Angol nyelv"),
|
SubjectIconItem("Angol nyelv"),
|
||||||
SubjectIconItem("Linux"),
|
SubjectIconItem("Linux"),
|
||||||
|
SubjectIconItem("Adatbázis"),
|
||||||
|
SubjectIconItem("Asztali alkalmazások"),
|
||||||
|
SubjectIconItem("Projekt"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ class LiveActivityColorSetting extends StatefulWidget {
|
|||||||
_LiveActivityColorSettingState();
|
_LiveActivityColorSettingState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LiveActivityColorSettingState extends State<LiveActivityColorSetting> {
|
class _LiveActivityColorSettingState extends State<LiveActivityColorSetting> {
|
||||||
late SettingsProvider settings;
|
late SettingsProvider settings;
|
||||||
Color currentColor = const Color(0x00000000);
|
Color currentColor = const Color(0x00000000);
|
||||||
|
|
||||||
@@ -648,8 +648,8 @@ class _LiveActivityColorSettingState extends State<LiveActivityColorSetting> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
currentColor = k as Color;
|
currentColor = k as Color;
|
||||||
settings.update(
|
settings.update(
|
||||||
liveActivityColor: currentColor.withAlpha(255));
|
liveActivityColor: currentColor.withAlpha(255));
|
||||||
Navigator.of(context).maybePop();
|
Navigator.of(context).maybePop();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu_i
|
|||||||
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
|
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/common/soon_alert/soon_alert.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/system_chrome.dart';
|
import 'package:filcnaplo_mobile_ui/common/system_chrome.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/update/updates_view.dart';
|
import 'package:filcnaplo_mobile_ui/common/widgets/update/updates_view.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/news/news_screen.dart';
|
import 'package:filcnaplo_mobile_ui/screens/news/news_screen.dart';
|
||||||
@@ -43,6 +44,7 @@ import 'package:filcnaplo_premium/ui/mobile/settings/profile_pic.dart';
|
|||||||
import 'package:filcnaplo_premium/ui/mobile/settings/icon_pack.dart';
|
import 'package:filcnaplo_premium/ui/mobile/settings/icon_pack.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/modify_subject_names.dart';
|
import 'package:filcnaplo_premium/ui/mobile/settings/modify_subject_names.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/modify_teacher_names.dart';
|
import 'package:filcnaplo_premium/ui/mobile/settings/modify_teacher_names.dart';
|
||||||
|
import 'package:filcnaplo_premium/ui/mobile/settings/welcome_message.dart';
|
||||||
|
|
||||||
class SettingsScreen extends StatefulWidget {
|
class SettingsScreen extends StatefulWidget {
|
||||||
const SettingsScreen({Key? key}) : super(key: key);
|
const SettingsScreen({Key? key}) : super(key: key);
|
||||||
@@ -86,7 +88,9 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
|
|
||||||
String _firstName;
|
String _firstName;
|
||||||
|
|
||||||
List<String> _nameParts = account.displayName.split(" ");
|
List<String> _nameParts =
|
||||||
|
(account.nickname != '' ? account.nickname : account.displayName)
|
||||||
|
.split(" ");
|
||||||
if (!settings.presentationMode) {
|
if (!settings.presentationMode) {
|
||||||
_firstName = _nameParts.length > 1 ? _nameParts[1] : _nameParts[0];
|
_firstName = _nameParts.length > 1 ? _nameParts[1] : _nameParts[0];
|
||||||
} else {
|
} else {
|
||||||
@@ -95,7 +99,10 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
|
|
||||||
accountTiles.add(
|
accountTiles.add(
|
||||||
AccountTile(
|
AccountTile(
|
||||||
name: Text(!settings.presentationMode ? account.name : "János",
|
name: Text(
|
||||||
|
!settings.presentationMode
|
||||||
|
? (account.nickname != '' ? account.nickname : account.name)
|
||||||
|
: "János",
|
||||||
style: const TextStyle(fontWeight: FontWeight.w500)),
|
style: const TextStyle(fontWeight: FontWeight.w500)),
|
||||||
username: Text(
|
username: Text(
|
||||||
!settings.presentationMode ? account.username : "01234567890"),
|
!settings.presentationMode ? account.username : "01234567890"),
|
||||||
@@ -206,7 +213,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
opacity: 1 - _hideContainersController.value,
|
opacity: 1 - _hideContainersController.value,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 45.0),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@@ -274,7 +281,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
child: Panel(
|
child: Panel(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// Account list
|
// account list
|
||||||
...accountTiles,
|
...accountTiles,
|
||||||
|
|
||||||
if (accountTiles.isNotEmpty)
|
if (accountTiles.isNotEmpty)
|
||||||
@@ -290,7 +297,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Account settings
|
// account settings
|
||||||
PanelButton(
|
PanelButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
@@ -333,7 +340,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Updates
|
// updates
|
||||||
if (updateProvider.available)
|
if (updateProvider.available)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -371,121 +378,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
// child: ActiveSponsorCard(),
|
// child: ActiveSponsorCard(),
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
// General Settings
|
// secret settings
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
|
||||||
child: Panel(
|
|
||||||
title: Text("general".i18n),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
PanelButton(
|
|
||||||
onPressed: () {
|
|
||||||
SettingsHelper.language(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: Text("language".i18n),
|
|
||||||
leading: const Icon(FeatherIcons.globe),
|
|
||||||
trailing: Text(
|
|
||||||
languageText,
|
|
||||||
style: const TextStyle(fontSize: 14.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PanelButton(
|
|
||||||
onPressed: () {
|
|
||||||
SettingsHelper.startPage(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: Text("startpage".i18n),
|
|
||||||
leading: const Icon(FeatherIcons.play),
|
|
||||||
trailing: Text(
|
|
||||||
startPageTitle.capital(),
|
|
||||||
style: const TextStyle(fontSize: 14.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PanelButton(
|
|
||||||
onPressed: () {
|
|
||||||
SettingsHelper.rounding(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: Text("rounding".i18n),
|
|
||||||
leading: const Icon(FeatherIcons.gitCommit),
|
|
||||||
trailing: Text(
|
|
||||||
(settings.rounding / 10).toStringAsFixed(1),
|
|
||||||
style: const TextStyle(fontSize: 14.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PanelButton(
|
|
||||||
onPressed: () {
|
|
||||||
SettingsHelper.vibrate(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: Text("vibrate".i18n),
|
|
||||||
leading: const Icon(FeatherIcons.radio),
|
|
||||||
trailing: Text(
|
|
||||||
vibrateTitle,
|
|
||||||
style: const TextStyle(fontSize: 14.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PanelButton(
|
|
||||||
padding: const EdgeInsets.only(left: 14.0),
|
|
||||||
onPressed: () {
|
|
||||||
SettingsHelper.bellDelay(context);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
title: Text(
|
|
||||||
"bell_delay".i18n,
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.of(context).text.withOpacity(
|
|
||||||
settings.bellDelayEnabled ? 1.0 : .5)),
|
|
||||||
),
|
|
||||||
leading: settings.bellDelayEnabled
|
|
||||||
? const Icon(FeatherIcons.bell)
|
|
||||||
: Icon(FeatherIcons.bellOff,
|
|
||||||
color:
|
|
||||||
AppColors.of(context).text.withOpacity(.25)),
|
|
||||||
trailingDivider: true,
|
|
||||||
trailing: Switch(
|
|
||||||
onChanged: (v) => settings.update(bellDelayEnabled: v),
|
|
||||||
value: settings.bellDelayEnabled,
|
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Material(
|
|
||||||
type: MaterialType.transparency,
|
|
||||||
child: MenuNotifications(settings: settings)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
if (kDebugMode)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 12.0, horizontal: 24.0),
|
|
||||||
child: Panel(
|
|
||||||
title: const Text("Debug"),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
PanelButton(
|
|
||||||
title: const Text("Subject Icon Gallery"),
|
|
||||||
leading:
|
|
||||||
const Icon(CupertinoIcons.rectangle_3_offgrid_fill),
|
|
||||||
trailing: const Icon(Icons.arrow_forward),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context, rootNavigator: true).push(
|
|
||||||
CupertinoPageRoute(
|
|
||||||
builder: (context) =>
|
|
||||||
const SubjectIconGallery()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
// Secret Settings
|
|
||||||
if (__ss)
|
if (__ss)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@@ -582,7 +475,123 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Theme Settings
|
// general things
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
||||||
|
child: Panel(
|
||||||
|
title: Text("general".i18n),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
PanelButton(
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.language(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text("language".i18n),
|
||||||
|
leading: const Icon(FeatherIcons.globe),
|
||||||
|
trailing: Text(
|
||||||
|
languageText,
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PanelButton(
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.startPage(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text("startpage".i18n),
|
||||||
|
leading: const Icon(FeatherIcons.play),
|
||||||
|
trailing: Text(
|
||||||
|
startPageTitle.capital(),
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PanelButton(
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.rounding(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text("rounding".i18n),
|
||||||
|
leading: const Icon(FeatherIcons.gitCommit),
|
||||||
|
trailing: Text(
|
||||||
|
(settings.rounding / 10).toStringAsFixed(1),
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PanelButton(
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.vibrate(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text("vibrate".i18n),
|
||||||
|
leading: const Icon(FeatherIcons.radio),
|
||||||
|
trailing: Text(
|
||||||
|
vibrateTitle,
|
||||||
|
style: const TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PanelButton(
|
||||||
|
padding: const EdgeInsets.only(left: 14.0),
|
||||||
|
onPressed: () {
|
||||||
|
SettingsHelper.bellDelay(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: Text(
|
||||||
|
"bell_delay".i18n,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.of(context).text.withOpacity(
|
||||||
|
settings.bellDelayEnabled ? 1.0 : .5)),
|
||||||
|
),
|
||||||
|
leading: settings.bellDelayEnabled
|
||||||
|
? const Icon(FeatherIcons.bell)
|
||||||
|
: Icon(FeatherIcons.bellOff,
|
||||||
|
color:
|
||||||
|
AppColors.of(context).text.withOpacity(.25)),
|
||||||
|
trailingDivider: true,
|
||||||
|
trailing: Switch(
|
||||||
|
onChanged: (v) => settings.update(bellDelayEnabled: v),
|
||||||
|
value: settings.bellDelayEnabled,
|
||||||
|
activeColor: Theme.of(context).colorScheme.secondary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: MenuNotifications(settings: settings)),
|
||||||
|
WelcomeMessagePanelButton(settings, user),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// icon gallery (debug mode)
|
||||||
|
if (kDebugMode)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 12.0, horizontal: 24.0),
|
||||||
|
child: Panel(
|
||||||
|
title: const Text("Debug"),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
PanelButton(
|
||||||
|
title: const Text("Subject Icon Gallery"),
|
||||||
|
leading:
|
||||||
|
const Icon(CupertinoIcons.rectangle_3_offgrid_fill),
|
||||||
|
trailing: const Icon(Icons.arrow_forward),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context, rootNavigator: true).push(
|
||||||
|
CupertinoPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
const SubjectIconGallery()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// appearance things
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
||||||
@@ -677,8 +686,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const PremiumIconPackSelector(),
|
const PremiumIconPackSelector(),
|
||||||
// If iOS, show the iOS specific settings
|
|
||||||
|
|
||||||
|
// if ios show live activity color option
|
||||||
if (defaultTargetPlatform == TargetPlatform.iOS)
|
if (defaultTargetPlatform == TargetPlatform.iOS)
|
||||||
PanelButton(
|
PanelButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -696,12 +705,46 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: SwitchListTile(
|
||||||
|
contentPadding: const EdgeInsets.only(left: 14.0),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12.0)),
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
FeatherIcons.moon,
|
||||||
|
color: settings.shadowEffect
|
||||||
|
? Theme.of(context).colorScheme.secondary
|
||||||
|
: AppColors.of(context).text.withOpacity(.25),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 14.0),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"shadow_effect".i18n,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16.0,
|
||||||
|
color: AppColors.of(context).text.withOpacity(
|
||||||
|
settings.shadowEffect ? 1.0 : .5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onChanged: (v) => settings.update(shadowEffect: v),
|
||||||
|
value: settings.shadowEffect,
|
||||||
|
activeColor: Theme.of(context).colorScheme.secondary,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Notifications
|
// popup alerts
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
||||||
@@ -744,7 +787,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Extras
|
// extra settings
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
||||||
@@ -791,12 +834,23 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
MenuRenamedTeachers(
|
MenuRenamedTeachers(
|
||||||
settings: settings,
|
settings: settings,
|
||||||
),
|
),
|
||||||
|
PanelButton(
|
||||||
|
onPressed: () {
|
||||||
|
SoonAlert.show(context: context);
|
||||||
|
},
|
||||||
|
title: Text('app_icon'.i18n),
|
||||||
|
leading: const Icon(FeatherIcons.edit),
|
||||||
|
// trailing: Text(
|
||||||
|
// 'default'.i18n,
|
||||||
|
// style: const TextStyle(fontSize: 14.0),
|
||||||
|
// ),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// About
|
// about sweetie
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
|
||||||
@@ -947,6 +1001,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// version info
|
||||||
SafeArea(
|
SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
child: Center(
|
child: Center(
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ extension SettingsLocalization on String {
|
|||||||
"devsettings": "Developer Settings",
|
"devsettings": "Developer Settings",
|
||||||
"devmode": "Developer Mode",
|
"devmode": "Developer Mode",
|
||||||
"copy_jwt": "Copy JWT",
|
"copy_jwt": "Copy JWT",
|
||||||
|
"welcome_msg": "Welcome Message",
|
||||||
|
"default": "Dynamic",
|
||||||
|
"edit_welcome_msg": "Edit welcome message",
|
||||||
|
"shadow_effect": "Shadow Effect",
|
||||||
|
"app_icon": "App Icon",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
"personal_details": "Személyes információk",
|
"personal_details": "Személyes információk",
|
||||||
@@ -144,6 +149,11 @@ extension SettingsLocalization on String {
|
|||||||
"devsettings": "Fejlesztői Beállítások",
|
"devsettings": "Fejlesztői Beállítások",
|
||||||
"devmode": "Fejlesztői mód",
|
"devmode": "Fejlesztői mód",
|
||||||
"copy_jwt": "JWT másolása",
|
"copy_jwt": "JWT másolása",
|
||||||
|
"welcome_msg": "Üdvözlő üzenet",
|
||||||
|
"default": "Dinamikus",
|
||||||
|
"edit_welcome_msg": "Üdvözlő üzenet szerkesztése",
|
||||||
|
"shadow_effect": "Árnyékhatás",
|
||||||
|
"app_icon": "Alkalmazásikon",
|
||||||
},
|
},
|
||||||
"de_de": {
|
"de_de": {
|
||||||
"personal_details": "Persönliche Angaben",
|
"personal_details": "Persönliche Angaben",
|
||||||
@@ -192,7 +202,8 @@ extension SettingsLocalization on String {
|
|||||||
"graph_class_avg": "Klassendurchschnitt in der Grafik",
|
"graph_class_avg": "Klassendurchschnitt in der Grafik",
|
||||||
"goodstudent": "Guter Student Modus",
|
"goodstudent": "Guter Student Modus",
|
||||||
"attention": "Achtung!",
|
"attention": "Achtung!",
|
||||||
"goodstudent_disclaimer": "Same in English.",
|
"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)",
|
||||||
"understand": "Ich verstehe",
|
"understand": "Ich verstehe",
|
||||||
"secret": "Geheime Einstellungen",
|
"secret": "Geheime Einstellungen",
|
||||||
"bell_delay": "Klingelverzögerung",
|
"bell_delay": "Klingelverzögerung",
|
||||||
@@ -214,6 +225,11 @@ extension SettingsLocalization on String {
|
|||||||
"devsettings": "Entwickleroptionen",
|
"devsettings": "Entwickleroptionen",
|
||||||
"devmode": "Entwicklermodus",
|
"devmode": "Entwicklermodus",
|
||||||
"copy_jwt": "JWT kopieren",
|
"copy_jwt": "JWT kopieren",
|
||||||
|
"welcome_msg": "Willkommensnachricht",
|
||||||
|
"default": "Dynamisch",
|
||||||
|
"edit_welcome_msg": "Begrüßungsnachricht bearbeiten",
|
||||||
|
"shadow_effect": "Schatteneffekt",
|
||||||
|
"app_icon": "App-Symbol",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class _AllSumBodyState extends State<AllSumBody> {
|
|||||||
int avgDropValue = 0;
|
int avgDropValue = 0;
|
||||||
bool animation = false;
|
bool animation = false;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject, {int days = 0}) => gradeProvider
|
List<Grade> getSubjectGrades(GradeSubject subject, {int days = 0}) => gradeProvider
|
||||||
.grades
|
.grades
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.subject == subject &&
|
e.subject == subject &&
|
||||||
|
|||||||
@@ -50,14 +50,15 @@ class _GradesBodyState extends State<GradesBody> {
|
|||||||
int avgDropValue = 0;
|
int avgDropValue = 0;
|
||||||
bool animation = false;
|
bool animation = false;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject, {int days = 0}) => gradeProvider
|
List<Grade> getSubjectGrades(GradeSubject subject, {int days = 0}) =>
|
||||||
.grades
|
gradeProvider.grades
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.subject == subject &&
|
e.subject == subject &&
|
||||||
e.type == GradeType.midYear &&
|
e.type == GradeType.midYear &&
|
||||||
(days == 0 ||
|
(days == 0 ||
|
||||||
e.date.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
e.date
|
||||||
.toList();
|
.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
||||||
|
.toList();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -74,18 +75,18 @@ class _GradesBodyState extends State<GradesBody> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void generateTiles({required int filter}) {
|
void generateTiles({required int filter}) {
|
||||||
List<Subject> subjects = gradeProvider.grades
|
List<GradeSubject> subjects = gradeProvider.grades
|
||||||
.map((e) => e.subject)
|
.map((e) => e.subject)
|
||||||
.toSet()
|
.toSet()
|
||||||
.toList()
|
.toList()
|
||||||
..sort((a, b) => a.name.compareTo(b.name));
|
..sort((a, b) => a.name.compareTo(b.name));
|
||||||
List<Widget> tiles = [];
|
List<Widget> tiles = [];
|
||||||
|
|
||||||
Map<Subject, double> subjectAvgs = {};
|
Map<GradeSubject, double> subjectAvgs = {};
|
||||||
|
|
||||||
var count = 1;
|
var count = 1;
|
||||||
|
|
||||||
for (Subject subject in subjects) {
|
for (GradeSubject subject in subjects) {
|
||||||
List<Grade> subjectGrades = getSubjectGrades(subject);
|
List<Grade> subjectGrades = getSubjectGrades(subject);
|
||||||
|
|
||||||
double avg = AverageHelper.averageEvals(subjectGrades);
|
double avg = AverageHelper.averageEvals(subjectGrades);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user