Compare commits
239 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88717d5925 | ||
|
|
6cb86245cb | ||
|
|
8f393cd9c5 | ||
|
|
38d892d9a1 | ||
|
|
fb70b2be38 | ||
|
|
a5e368d983 | ||
|
|
de3fa0c71d | ||
|
|
cbece0e841 | ||
|
|
ac77f26eb2 | ||
|
|
52b4a9429b | ||
|
|
588bc2567e | ||
|
|
d2d36c3d0f | ||
|
|
8ef2bee62e | ||
|
|
30bde8b040 | ||
|
|
042522dc5a | ||
|
|
fdc9276170 | ||
|
|
413494a9ac | ||
|
|
8e3996e2f0 | ||
|
|
f46610314d | ||
|
|
fdc6209656 | ||
|
|
6def864b1f | ||
|
|
fc40793534 | ||
|
|
f533c5d4f5 | ||
|
|
3a44a2f9bc | ||
|
|
1bf512991b | ||
|
|
fb8b3ae73f | ||
|
|
50d2d44ac2 | ||
|
|
b929766b14 | ||
|
|
d34371bfff | ||
|
|
6bac82f7d6 | ||
|
|
fc3f538e6b | ||
|
|
939e33feeb | ||
|
|
a175a9ea1c | ||
|
|
969aec0f11 | ||
|
|
871c93050c | ||
|
|
7f9c22bdcd | ||
|
|
c06e9bc807 | ||
|
|
7b7f603d9c | ||
|
|
f4a6a0ceb0 | ||
|
|
adc8deffa9 | ||
|
|
3484230ced | ||
|
|
40740b80d0 | ||
|
|
20f20218e0 | ||
|
|
68c9745ce0 | ||
|
|
70c8ac1876 | ||
|
|
bdfec4230b | ||
|
|
093063b438 | ||
|
|
bcab128332 | ||
|
|
56500406e5 | ||
|
|
9f5e57eec6 | ||
|
|
5079e0cb29 | ||
|
|
646948012d | ||
|
|
399069537f | ||
|
|
1c49ffd57f | ||
|
|
8df3623d91 | ||
|
|
61ad26e047 | ||
|
|
51a6492477 | ||
|
|
7d26a8bc33 | ||
|
|
e243b5c186 | ||
|
|
043785fe35 | ||
|
|
72332b5000 | ||
|
|
e73aa6c1b0 | ||
|
|
3410e410d2 | ||
|
|
aba39505d9 | ||
|
|
ebf9c8526d | ||
|
|
f5ab4bbc98 | ||
|
|
1764bb0f01 | ||
|
|
271e47619e | ||
|
|
cd0c821bae | ||
|
|
6a1cb9f3eb | ||
|
|
c6c5759a2c | ||
|
|
b94ed46c8a | ||
|
|
b0eb78218a | ||
|
|
1ac618c29f | ||
|
|
7840a07c95 | ||
|
|
3f5b8ab607 | ||
|
|
41fe5a3d05 | ||
|
|
af87e5ed36 | ||
|
|
797963e63d | ||
|
|
6a1eafe980 | ||
|
|
5e7414ada8 | ||
|
|
8e391c9c7f | ||
|
|
316039463f | ||
|
|
8e320b235c | ||
|
|
be28c50ffc | ||
|
|
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 | ||
|
|
7b517b333a | ||
|
|
d1a9625d93 | ||
|
|
056bf7ab58 | ||
|
|
c4dc03f41d | ||
|
|
6d7a21dc02 | ||
|
|
9406efee8d | ||
|
|
151e97b243 | ||
|
|
1ba0f4d8d3 | ||
|
|
4b8dbf0691 | ||
|
|
98d7468f24 | ||
|
|
fa46d6cbd3 | ||
|
|
a0c68a4e5a | ||
|
|
f2f35b2fbd | ||
|
|
a782dbd22f | ||
|
|
c9da66d38f | ||
|
|
dc93985834 | ||
|
|
3e487ba22a | ||
|
|
6293bb4017 | ||
|
|
03a5057269 | ||
|
|
4a15514ba0 | ||
|
|
bb2853d857 | ||
|
|
be84935ac3 | ||
|
|
19691a1dc0 | ||
|
|
5c6e54864d | ||
|
|
dda1ae23c9 | ||
|
|
f08c691b25 | ||
|
|
0340406bd8 | ||
|
|
32fb702872 | ||
|
|
b510dbd0ec | ||
|
|
e7f8dd6d80 | ||
|
|
f985889811 | ||
|
|
eb20fc1457 | ||
|
|
67721112cc | ||
|
|
070e3cf18c | ||
|
|
991097fa34 | ||
|
|
c4e87f66e6 | ||
|
|
8d01653714 | ||
|
|
db7b126bda | ||
|
|
023329f021 | ||
|
|
e66fdbaeac | ||
|
|
bbbaea9224 | ||
|
|
c7c18cf684 | ||
|
|
4d501fed3e | ||
|
|
8168ef5329 | ||
|
|
608bc58771 | ||
|
|
2cba1ec286 | ||
|
|
b6eb65814f | ||
|
|
a5a43ea0b9 | ||
|
|
da356bb212 | ||
|
|
c29ab3de29 | ||
|
|
fceb4e050f | ||
|
|
8feea02f68 | ||
|
|
939e4f4d48 | ||
|
|
a401ff32d9 |
84
.gitignore
vendored
@@ -1,51 +1,39 @@
|
|||||||
# 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
|
||||||
|
filcnaplo_desktop_ui/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_desktop_ui/pubspec.lock
|
||||||
|
filcnaplo_desktop_ui/.dart_tool/
|
||||||
|
|
||||||
|
filcnaplo_kreta_api/.flutter-plugins
|
||||||
|
filcnaplo_kreta_api/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_kreta_api/pubspec.lock
|
||||||
|
filcnaplo_kreta_api/.dart_tool/
|
||||||
|
|
||||||
|
filcnaplo_mobile_ui/.flutter-plugins
|
||||||
|
filcnaplo_mobile_ui/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_mobile_ui/pubspec.lock
|
||||||
|
filcnaplo_mobile_ui/.dart_tool/
|
||||||
|
|
||||||
|
filcnaplo_premium/.flutter-plugins
|
||||||
|
filcnaplo_premium/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_premium/pubspec.lock
|
||||||
|
filcnaplo_premium/.dart_tool/
|
||||||
|
|
||||||
|
.vscode
|
||||||
|
.github
|
||||||
|
.idea
|
||||||
|
.gitmodules
|
||||||
|
|
||||||
|
filcnaplo/.DS_Store
|
||||||
.DS_Store
|
.DS_Store
|
||||||
filc3.properties
|
|
||||||
local.properties
|
|
||||||
# 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
|
|
||||||
# If you don't generate documentation locally you can remove this line.
|
|
||||||
doc/api/
|
|
||||||
|
|
||||||
# Avoid committing generated Javascript files:
|
|
||||||
*.dart.js
|
|
||||||
*.info.json # Produced by the --dump-info flag.
|
|
||||||
*.js # When generated by dart2js. Don't specify *.js if your
|
|
||||||
# project includes source files written in JavaScript.
|
|
||||||
*.js_
|
|
||||||
*.js.deps
|
|
||||||
*.js.map
|
|
||||||
|
|
||||||
*.txt
|
|
||||||
filcnaplo/macos/Flutter/GeneratedPluginRegistrant.swift
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/connectivity_plus
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/dynamic_color
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/flutter_acrylic
|
|
||||||
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*
|
|
||||||
filcnaplo/ios/Flutter/flutter_export_environment 4.sh
|
|
||||||
|
|||||||
3
.gitmodules
vendored
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "naplo-plus"]
|
||||||
|
path = filcnaplo_premium
|
||||||
|
url = git@github.com:refilc/naplo-plus.git
|
||||||
|
|||||||
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
33
.vscode/launch.json
vendored
@@ -1,33 +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",
|
|
||||||
"flutterMode": "release",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
678
LICENSE
@@ -1,29 +1,661 @@
|
|||||||
BSD 3-Clause License
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
Copyright (c) 2023, reFilc
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
All rights reserved.
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Preamble
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
list of conditions and the following disclaimer.
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
The licenses for most software and other practical works are designed
|
||||||
this list of conditions and the following disclaimer in the documentation
|
to take away your freedom to share and change the works. By contrast,
|
||||||
and/or other materials provided with the distribution.
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its
|
When we speak of free software, we are referring to freedom, not
|
||||||
contributors may be used to endorse or promote products derived from
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
this software without specific prior written permission.
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
Developers that use our General Public Licenses protect your rights
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
you this License which gives you legal permission to copy, distribute
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
and/or modify the software.
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
A secondary benefit of defending all users' freedom is that
|
||||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
improvements made in alternate versions of the program, if they
|
||||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
receive widespread use, become available for other developers to
|
||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
incorporate. Many developers of free software are heartened and
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -39,12 +39,14 @@ Az összes (ugyan azon verzióhoz tartozó) contribution meg fog jelenni a relea
|
|||||||
|
|
||||||
**kima:** head developer / project manager
|
**kima:** head developer / project manager
|
||||||
|
|
||||||
**Reiner, pdf, Pearoo:** community- and project manager / developer
|
**Reiner, pdf, Pearoo, Zizi:** community- and project manager / developer
|
||||||
|
|
||||||
**vrolandd, TMarccci:** head developer
|
**vrolandd, TMarccci:** head developer
|
||||||
|
|
||||||
**dwe., xou:** designer
|
**dwe., xou:** designer
|
||||||
|
|
||||||
**Péter:** social media manager / video editor
|
**Péter:** video editor
|
||||||
|
|
||||||
**annon:** a régi Filc Napló fejlesztője (ez az app, ha bár sokban változott, alapjaiban a Filc-re épül)
|
**annon:** a régi Filc Napló fejlesztője (ez az app, ha bár sokban változott, alapjaiban a Filc-re épül)
|
||||||
|
|
||||||
|
<sup>Ez a projekt egy fork; az eredeti projektet megtaláljátok itt: [filc/naplo-archive](https://github.com/filc/naplo-archive) (köszi, annon)</sup>
|
||||||
|
|||||||
5
filcnaplo/.gitignore
vendored
@@ -8,6 +8,7 @@
|
|||||||
.buildlog/
|
.buildlog/
|
||||||
.history
|
.history
|
||||||
.svn/
|
.svn/
|
||||||
|
migrate_working_dir/
|
||||||
|
|
||||||
# IntelliJ related
|
# IntelliJ related
|
||||||
*.iml
|
*.iml
|
||||||
@@ -31,9 +32,6 @@
|
|||||||
.pub/
|
.pub/
|
||||||
/build/
|
/build/
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
# Symbolication related
|
||||||
app.*.symbols
|
app.*.symbols
|
||||||
|
|
||||||
@@ -44,4 +42,3 @@ app.*.map.json
|
|||||||
/android/app/debug
|
/android/app/debug
|
||||||
/android/app/profile
|
/android/app/profile
|
||||||
/android/app/release
|
/android/app/release
|
||||||
key.properties
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# This file tracks properties of this Flutter project.
|
# This file tracks properties of this Flutter project.
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
#
|
#
|
||||||
# This file should be version controlled.
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
version:
|
version:
|
||||||
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
revision: "b0366e0a3f089e15fd89c97604ab402fe26b724c"
|
||||||
channel: stable
|
channel: "stable"
|
||||||
|
|
||||||
project_type: app
|
project_type: app
|
||||||
|
|
||||||
@@ -13,11 +13,17 @@ project_type: app
|
|||||||
migration:
|
migration:
|
||||||
platforms:
|
platforms:
|
||||||
- platform: root
|
- platform: root
|
||||||
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
- platform: web
|
- platform: linux
|
||||||
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
- platform: macos
|
||||||
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
- platform: windows
|
||||||
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
|
||||||
# User provided section
|
# User provided section
|
||||||
|
|
||||||
|
|||||||
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
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo">
|
xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo">
|
||||||
<application android:name="${applicationName}" android:label="reFilc" tools:replace="android:label" android:icon="@mipmap/ic_launcher"
|
<application android:name="${applicationName}" android:label="reFilc" tools:replace="android:label" android:icon="@mipmap/ic_launcher"
|
||||||
android:requestLegacyExternalStorage="true">
|
android:requestLegacyExternalStorage="true" android:enableOnBackInvokedCallback="false">
|
||||||
<activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
|
<activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
|
||||||
android:launchMode="singleTop" android:theme="@style/LaunchTheme"
|
android:launchMode="singleTop" android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
<meta-data android:name="io.flutter.embedding.android.NormalTheme"
|
<meta-data android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme" />
|
android:resource="@style/NormalTheme" />
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
<!-- commented bc of dynamic app icons -->
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -39,6 +40,69 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
<meta-data android:name="flutterEmbedding" android:value="2" />
|
||||||
|
|
||||||
|
<!-- custom app icon thingies from here -->
|
||||||
|
<!-- <activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_default"
|
||||||
|
android:name=".MainActivityAlias"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_default"
|
||||||
|
android:name=".MainActivityAliasrefilc_default"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_overcomplicated"
|
||||||
|
android:name=".MainActivityAliasrefilc_overcomplicated"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_concept"
|
||||||
|
android:name=".MainActivityAliasrefilc_concept"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_pride"
|
||||||
|
android:name=".MainActivityAliasrefilc_pride"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias> -->
|
||||||
|
<!-- end of custom app icon thingies -->
|
||||||
|
|
||||||
<receiver android:name="hu.refilc.naplo.widget_timetable.WidgetTimetable"
|
<receiver android:name="hu.refilc.naplo.widget_timetable.WidgetTimetable"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ import java.util.Collections;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import hu.refilc.naplo.database.DBManager;
|
import hu.refilc.naplo.database.DBManager;
|
||||||
import hu.refilc.naplo.MainActivity;
|
import hu.refilc.naplo.MainActivity;
|
||||||
@@ -247,71 +252,61 @@ public class WidgetTimetable extends HomeWidgetProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<JSONArray> genJsonDays(Context context) {
|
public static List<JSONArray> genJsonDays(Context context) {
|
||||||
List<JSONArray> gen_days = new ArrayList<>();
|
List<JSONArray> genDays = new ArrayList<>();
|
||||||
|
Map<String, JSONArray> dayMap = new HashMap<>();
|
||||||
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
DBManager dbManager = new DBManager(context.getApplicationContext());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dbManager.open();
|
dbManager.open();
|
||||||
Cursor ct = dbManager.fetchTimetable();
|
Cursor ct = dbManager.fetchTimetable();
|
||||||
dbManager.close();
|
|
||||||
|
|
||||||
if(ct.getCount() == 0) {
|
if (ct.getCount() == 0) {
|
||||||
return gen_days;
|
return genDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject fecthtt = new JSONObject(ct.getString(0));
|
JSONObject fetchedTimetable = new JSONObject(ct.getString(0));
|
||||||
|
String currentWeek = String.valueOf(Week.current().id());
|
||||||
|
JSONArray week = fetchedTimetable.getJSONArray(currentWeek);
|
||||||
|
|
||||||
JSONArray dayArray = new JSONArray();
|
// Organize lessons into dates
|
||||||
String currday = "";
|
for (int i = 0; i < week.length(); i++) {
|
||||||
|
|
||||||
String currweek = String.valueOf(Week.current().id());
|
|
||||||
|
|
||||||
JSONArray week = fecthtt.getJSONArray(currweek);
|
|
||||||
|
|
||||||
for (int i=0; i < week.length(); i++)
|
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
if(i == 0) currday = week.getJSONObject(0).getString("Datum");
|
JSONObject entry = week.getJSONObject(i);
|
||||||
JSONObject oraObj = week.getJSONObject(i);
|
String date = entry.getString("Datum");
|
||||||
|
dayMap.computeIfAbsent(date, k -> new JSONArray()).put(entry);
|
||||||
if(!currday.equals(oraObj.getString("Datum"))) {
|
} catch (JSONException e) {
|
||||||
gen_days.add(dayArray);
|
|
||||||
currday = week.getJSONObject(i).getString("Datum");
|
|
||||||
dayArray = new JSONArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
dayArray.put(oraObj);
|
|
||||||
if(i == week.length() - 1) {
|
|
||||||
gen_days.add(dayArray);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(gen_days, new Comparator<JSONArray>() {
|
genDays.addAll(dayMap.values());
|
||||||
|
|
||||||
public int compare(JSONArray a, JSONArray b) {
|
|
||||||
long valA = 0;
|
|
||||||
long valB = 0;
|
|
||||||
|
|
||||||
|
// Sort the 'genDays' list of JSON based on the start time of the first entry
|
||||||
|
genDays.sort((day1, day2) -> {
|
||||||
try {
|
try {
|
||||||
valA = (long) new DateTime( a.getJSONObject(0).getString("Datum")).getMillis();
|
// Extract the start time of the first entry in each day's JSON
|
||||||
valB = (long) new DateTime( b.getJSONObject(0).getString("Datum")).getMillis();
|
String startTime1 = day1.getJSONObject(0).getString("KezdetIdopont");
|
||||||
}
|
String startTime2 = day2.getJSONObject(0).getString("KezdetIdopont");
|
||||||
catch (JSONException ignored) {
|
// Compare the start times and return the result for sorting
|
||||||
}
|
return startTime1.compareTo(startTime2);
|
||||||
|
} catch (JSONException e) {
|
||||||
return (int) (valA - valB);
|
e.printStackTrace();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return gen_days;
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
dbManager.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return genDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String zeroPad(int value, int padding){
|
public static String zeroPad(int value, int padding){
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
b.append(value);
|
b.append(value);
|
||||||
|
|||||||
@@ -335,10 +335,12 @@ public class WidgetTimetableDataProvider implements RemoteViewsService.RemoteVie
|
|||||||
|
|
||||||
public Lesson jsonToLesson(JSONObject json) {
|
public Lesson jsonToLesson(JSONObject json) {
|
||||||
try {
|
try {
|
||||||
|
String name = json.getString("Nev");
|
||||||
|
name = name.substring(0, 1).toUpperCase() + name.substring(1); // Capitalize name
|
||||||
return new Lesson(
|
return new Lesson(
|
||||||
json.getJSONObject("Allapot").getString("Nev"),
|
json.getJSONObject("Allapot").getString("Nev"),
|
||||||
!json.getString("Oraszam").equals("null") ? json.getString("Oraszam") : "+",
|
!json.getString("Oraszam").equals("null") ? json.getString("Oraszam") : "+",
|
||||||
json.getString("Nev"),
|
name,
|
||||||
json.getString("Tema"),
|
json.getString("Tema"),
|
||||||
json.getString("TeremNeve"),
|
json.getString("TeremNeve"),
|
||||||
new DateTime(json.getString("KezdetIdopont")).getMillis(),
|
new DateTime(json.getString("KezdetIdopont")).getMillis(),
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 13 KiB |
@@ -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"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 13 KiB |
@@ -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.
|
|
||||||
BIN
filcnaplo/assets/launch_icons/refilc_concept.png
Normal file
|
After Width: | Height: | Size: 145 KiB |
BIN
filcnaplo/assets/launch_icons/refilc_default.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
filcnaplo/assets/launch_icons/refilc_overcomplicated.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
filcnaplo/assets/launch_icons/refilc_pride.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
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,15 +0,0 @@
|
|||||||
// This is a generated file; do not edit or check into version control.
|
|
||||||
FLUTTER_ROOT=/Users/kima/development/flutter
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_TARGET=/Users/kima/Documents/refilc/app/naplo/filcnaplo/lib/main.dart
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=3.5.1
|
|
||||||
FLUTTER_BUILD_NUMBER=197
|
|
||||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
|
||||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
|
||||||
DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9iNGZiMTEyMTRkZDJkZGE2Y2UwMTJkZDk4ZWE0OThlOWU4YjkxMjYyLw==
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=/Users/kima/Documents/refilc/app/naplo/filcnaplo/.dart_tool/package_config.json
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
// This is a generated file; do not edit or check into version control.
|
|
||||||
FLUTTER_ROOT=/Users/kima/development/flutter
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_TARGET=/Users/kima/Documents/refilc/app/naplo/filcnaplo/lib/main.dart
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=4.1.0
|
|
||||||
FLUTTER_BUILD_NUMBER=213
|
|
||||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
|
||||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
|
||||||
DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC8yYTM0MDFjOWJiYjVhOWE5YWVjNzRkNGY3MzVkMThhOWRkM2ViZjJkLw==
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=/Users/kima/Documents/refilc/app/naplo/filcnaplo/.dart_tool/package_config.json
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
// This is a generated file; do not edit or check into version control.
|
|
||||||
FLUTTER_ROOT=/Users/kima/src/flutter
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_TARGET=/Users/kima/Documents/refilc/app/naplo/filcnaplo/lib/main.dart
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=4.1.1
|
|
||||||
FLUTTER_BUILD_NUMBER=216
|
|
||||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
|
||||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
|
||||||
DART_DEFINES=QVBQVkVSPTQuMS4x,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9jZGJlZGE3ODhhMjkzZmEyOTY2NWRjM2ZhM2Q2ZTYzYmQyMjFjYjBkLw==
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=/Users/kima/Documents/refilc/app/naplo/filcnaplo/.dart_tool/package_config.json
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
// This is a generated file; do not edit or check into version control.
|
|
||||||
FLUTTER_ROOT=/Users/kima/src/flutter
|
|
||||||
FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo
|
|
||||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
|
||||||
FLUTTER_TARGET=lib/main.dart
|
|
||||||
FLUTTER_BUILD_DIR=build
|
|
||||||
FLUTTER_BUILD_NAME=4.2.0
|
|
||||||
FLUTTER_BUILD_NUMBER=220
|
|
||||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
|
||||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
|
||||||
DART_OBFUSCATION=false
|
|
||||||
TRACK_WIDGET_CREATION=true
|
|
||||||
TREE_SHAKE_ICONS=false
|
|
||||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# This is a generated file; do not edit or check into version control.
|
|
||||||
export "FLUTTER_ROOT=/Users/kima/development/flutter"
|
|
||||||
export "FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo"
|
|
||||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
|
||||||
export "FLUTTER_TARGET=/Users/kima/Documents/refilc/app/naplo/filcnaplo/lib/main.dart"
|
|
||||||
export "FLUTTER_BUILD_DIR=build"
|
|
||||||
export "FLUTTER_BUILD_NAME=4.1.0"
|
|
||||||
export "FLUTTER_BUILD_NUMBER=213"
|
|
||||||
export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC8yYTM0MDFjOWJiYjVhOWE5YWVjNzRkNGY3MzVkMThhOWRkM2ViZjJkLw=="
|
|
||||||
export "DART_OBFUSCATION=false"
|
|
||||||
export "TRACK_WIDGET_CREATION=true"
|
|
||||||
export "TREE_SHAKE_ICONS=false"
|
|
||||||
export "PACKAGE_CONFIG=/Users/kima/Documents/refilc/app/naplo/filcnaplo/.dart_tool/package_config.json"
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# This is a generated file; do not edit or check into version control.
|
|
||||||
export "FLUTTER_ROOT=/Users/kima/src/flutter"
|
|
||||||
export "FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo"
|
|
||||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
|
||||||
export "FLUTTER_TARGET=lib/main.dart"
|
|
||||||
export "FLUTTER_BUILD_DIR=build"
|
|
||||||
export "FLUTTER_BUILD_NAME=4.2.0"
|
|
||||||
export "FLUTTER_BUILD_NUMBER=220"
|
|
||||||
export "DART_OBFUSCATION=false"
|
|
||||||
export "TRACK_WIDGET_CREATION=true"
|
|
||||||
export "TREE_SHAKE_ICONS=false"
|
|
||||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# This is a generated file; do not edit or check into version control.
|
|
||||||
export "FLUTTER_ROOT=/Users/kima/src/flutter"
|
|
||||||
export "FLUTTER_APPLICATION_PATH=/Users/kima/Documents/refilc/app/naplo/filcnaplo"
|
|
||||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
|
||||||
export "FLUTTER_TARGET=lib/main.dart"
|
|
||||||
export "FLUTTER_BUILD_DIR=build"
|
|
||||||
export "FLUTTER_BUILD_NAME=4.2.0"
|
|
||||||
export "FLUTTER_BUILD_NUMBER=220"
|
|
||||||
export "DART_OBFUSCATION=false"
|
|
||||||
export "TRACK_WIDGET_CREATION=true"
|
|
||||||
export "TREE_SHAKE_ICONS=false"
|
|
||||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -17,6 +17,14 @@
|
|||||||
3127F7A828EAEE8500C2EFB3 /* lesson_model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */; };
|
3127F7A828EAEE8500C2EFB3 /* lesson_model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */; };
|
||||||
373A6ECB5FC71FE9D8AF2EDB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F0ADD56276103500A3016C8 /* Pods_Runner.framework */; };
|
373A6ECB5FC71FE9D8AF2EDB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F0ADD56276103500A3016C8 /* Pods_Runner.framework */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
3B4461282AE6E0FF00AAE6FD /* refilc_default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461202AE6E0FF00AAE6FD /* refilc_default@2x.png */; };
|
||||||
|
3B4461292AE6E0FF00AAE6FD /* refilc_concept@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461212AE6E0FF00AAE6FD /* refilc_concept@2x.png */; };
|
||||||
|
3B44612A2AE6E0FF00AAE6FD /* refilc_concept@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461222AE6E0FF00AAE6FD /* refilc_concept@3x.png */; };
|
||||||
|
3B44612B2AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461232AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png */; };
|
||||||
|
3B44612C2AE6E0FF00AAE6FD /* refilc_default@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461242AE6E0FF00AAE6FD /* refilc_default@3x.png */; };
|
||||||
|
3B44612D2AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461252AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png */; };
|
||||||
|
3B44612E2AE6E0FF00AAE6FD /* refilc_pride@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461262AE6E0FF00AAE6FD /* refilc_pride@2x.png */; };
|
||||||
|
3B44612F2AE6E0FF00AAE6FD /* refilc_pride@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461272AE6E0FF00AAE6FD /* refilc_pride@3x.png */; };
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
@@ -73,6 +81,14 @@
|
|||||||
3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = lesson_model.swift; sourceTree = "<group>"; };
|
3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = lesson_model.swift; sourceTree = "<group>"; };
|
||||||
317DE77A294F6FFB002E323E /* livecard.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = livecard.entitlements; sourceTree = "<group>"; };
|
317DE77A294F6FFB002E323E /* livecard.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = livecard.entitlements; sourceTree = "<group>"; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
3B4461202AE6E0FF00AAE6FD /* refilc_default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_default@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_default@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461212AE6E0FF00AAE6FD /* refilc_concept@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_concept@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_concept@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461222AE6E0FF00AAE6FD /* refilc_concept@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_concept@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_concept@3x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461232AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_overcomplicated@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_overcomplicated@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461242AE6E0FF00AAE6FD /* refilc_default@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_default@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_default@3x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461252AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_overcomplicated@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_overcomplicated@3x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461262AE6E0FF00AAE6FD /* refilc_pride@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_pride@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_pride@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461272AE6E0FF00AAE6FD /* refilc_pride@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_pride@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_pride@3x.png"; sourceTree = "<group>"; };
|
||||||
707F8089D970F81C480F73C4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
707F8089D970F81C480F73C4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
@@ -122,6 +138,21 @@
|
|||||||
path = livecard;
|
path = livecard;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
3B44611F2AE6DF7200AAE6FD /* App Icons */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3B4461212AE6E0FF00AAE6FD /* refilc_concept@2x.png */,
|
||||||
|
3B4461222AE6E0FF00AAE6FD /* refilc_concept@3x.png */,
|
||||||
|
3B4461202AE6E0FF00AAE6FD /* refilc_default@2x.png */,
|
||||||
|
3B4461242AE6E0FF00AAE6FD /* refilc_default@3x.png */,
|
||||||
|
3B4461232AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png */,
|
||||||
|
3B4461252AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png */,
|
||||||
|
3B4461262AE6E0FF00AAE6FD /* refilc_pride@2x.png */,
|
||||||
|
3B4461272AE6E0FF00AAE6FD /* refilc_pride@3x.png */,
|
||||||
|
);
|
||||||
|
path = "App Icons";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
6640A963014A9D4F31026053 /* Frameworks */ = {
|
6640A963014A9D4F31026053 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -178,6 +209,7 @@
|
|||||||
97C146F01CF9000F007C117D /* Runner */ = {
|
97C146F01CF9000F007C117D /* Runner */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
3B44611F2AE6DF7200AAE6FD /* App Icons */,
|
||||||
3127F73928EAEC3200C2EFB3 /* Runner.entitlements */,
|
3127F73928EAEC3200C2EFB3 /* Runner.entitlements */,
|
||||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||||
@@ -221,9 +253,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 = (
|
||||||
);
|
);
|
||||||
@@ -286,10 +318,18 @@
|
|||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
3B44612A2AE6E0FF00AAE6FD /* refilc_concept@3x.png in Resources */,
|
||||||
|
3B44612F2AE6E0FF00AAE6FD /* refilc_pride@3x.png in Resources */,
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
|
3B44612E2AE6E0FF00AAE6FD /* refilc_pride@2x.png in Resources */,
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
|
3B44612C2AE6E0FF00AAE6FD /* refilc_default@3x.png in Resources */,
|
||||||
|
3B4461292AE6E0FF00AAE6FD /* refilc_concept@2x.png in Resources */,
|
||||||
|
3B4461282AE6E0FF00AAE6FD /* refilc_default@2x.png in Resources */,
|
||||||
|
3B44612D2AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png in Resources */,
|
||||||
|
3B44612B2AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -478,7 +518,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 +528,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 +550,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 +566,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 +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;
|
||||||
@@ -567,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;
|
||||||
@@ -592,7 +632,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 +647,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 +776,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 +786,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 +804,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 +814,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;
|
||||||
|
|||||||
@@ -2,6 +2,59 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>CFBundleAlternateIcons</key>
|
||||||
|
<dict>
|
||||||
|
<key>refilc_pride</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_pride</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<key>refilc_overcomplicated</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_overcomplicated</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<key>refilc_concept</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_concept</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<key>refilc_default</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_default</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>CFBundleIcons</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundlePrimaryIcon</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconName</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string></string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||||
<array>
|
<array>
|
||||||
<string>com.transistorsoft.fetch</string>
|
<string>com.transistorsoft.fetch</string>
|
||||||
|
|||||||
@@ -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()
|
||||||
|
ProgressView(
|
||||||
|
timerInterval: lesson!.date,
|
||||||
|
countsDown: true,
|
||||||
|
label: {
|
||||||
Image(systemName: lesson!.icon)
|
Image(systemName: lesson!.icon)
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fit)
|
.aspectRatio(contentMode: .fit)
|
||||||
.frame(width: CGFloat(30), height: CGFloat(30))
|
.frame(width: CGFloat(32), height: CGFloat(32))
|
||||||
.padding(.leading, CGFloat(6))
|
},
|
||||||
.padding(.bottom, CGFloat(6))
|
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: {
|
||||||
|
ProgressView(
|
||||||
|
timerInterval: lesson!.date,
|
||||||
|
countsDown: true,
|
||||||
|
label: {
|
||||||
|
Image(systemName: lesson!.icon)
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fit)
|
||||||
|
.frame(width: CGFloat(12), height: CGFloat(12))
|
||||||
|
},
|
||||||
|
currentValueLabel: {
|
||||||
Image(systemName: lesson!.icon)
|
Image(systemName: lesson!.icon)
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fit)
|
.aspectRatio(contentMode: .fit)
|
||||||
.frame(width: CGFloat(12), height: CGFloat(12))
|
.frame(width: CGFloat(12), height: CGFloat(12))
|
||||||
|
|
||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.monospacedDigit()
|
|
||||||
.font(.system(size: CGFloat(10)))
|
|
||||||
}
|
}
|
||||||
|
).progressViewStyle(.circular)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
.keylineTint(
|
.keylineTint(
|
||||||
lesson!.color == "#676767"
|
lesson!.color != "#676767"
|
||||||
? nil
|
? Color(hex: lesson!.color)
|
||||||
: Color(hex: lesson!.color)
|
: Color.clear
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:filcnaplo/models/ad.dart';
|
||||||
import 'package:filcnaplo/models/config.dart';
|
import 'package:filcnaplo/models/config.dart';
|
||||||
import 'package:filcnaplo/models/news.dart';
|
import 'package:filcnaplo/models/news.dart';
|
||||||
import 'package:filcnaplo/models/release.dart';
|
import 'package:filcnaplo/models/release.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
|
import 'package:filcnaplo/models/shared_theme.dart';
|
||||||
import 'package:filcnaplo/models/supporter.dart';
|
import 'package:filcnaplo/models/supporter.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/school.dart';
|
import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -12,14 +15,18 @@ import 'package:http/http.dart' as http;
|
|||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
|
||||||
class FilcAPI {
|
class FilcAPI {
|
||||||
|
// API base
|
||||||
|
static const baseUrl = "https://api.refilc.hu";
|
||||||
|
|
||||||
// Public API
|
// Public API
|
||||||
static const schoolList = "https://api.refilc.hu/v1/public/school-list";
|
static const schoolList = "$baseUrl/v1/public/school-list";
|
||||||
static const news = "https://api.refilc.hu/v1/public/news";
|
static const news = "$baseUrl/v1/public/news";
|
||||||
static const supporters = "https://api.refilc.hu/v1/public/supporters";
|
static const supporters = "$baseUrl/v1/public/supporters";
|
||||||
|
|
||||||
// Private API
|
// Private API
|
||||||
static const config = "https://api.refilc.hu/v1/private/config";
|
static const ads = "$baseUrl/v1/private/ads";
|
||||||
static const reportApi = "https://api.refilc.hu/v1/private/crash-report";
|
static const config = "$baseUrl/v1/private/config";
|
||||||
|
static const reportApi = "$baseUrl/v1/private/crash-report";
|
||||||
static const premiumApi = "https://api.filcnaplo.hu/premium/activate";
|
static const premiumApi = "https://api.filcnaplo.hu/premium/activate";
|
||||||
// static const premiumScopesApi = "https://api.filcnaplo.hu/premium/scopes";
|
// static const premiumScopesApi = "https://api.filcnaplo.hu/premium/scopes";
|
||||||
|
|
||||||
@@ -27,6 +34,17 @@ class FilcAPI {
|
|||||||
static const repo = "refilc/naplo";
|
static const repo = "refilc/naplo";
|
||||||
static const releases = "https://api.github.com/repos/$repo/releases";
|
static const releases = "https://api.github.com/repos/$repo/releases";
|
||||||
|
|
||||||
|
// Share API
|
||||||
|
static const themeShare = "$baseUrl/v2/shared/theme/add";
|
||||||
|
static const themeGet = "$baseUrl/v2/shared/theme/get";
|
||||||
|
static const allThemes = "$themeGet/all";
|
||||||
|
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;
|
||||||
|
|
||||||
@@ -40,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 {
|
||||||
@@ -117,6 +140,24 @@ class FilcAPI {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<List<Ad>?> getAds() async {
|
||||||
|
try {
|
||||||
|
http.Response res = await http.get(Uri.parse(ads));
|
||||||
|
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
return (jsonDecode(res.body) as List)
|
||||||
|
.cast<Map>()
|
||||||
|
.map((e) => Ad.fromJson(e))
|
||||||
|
.toList();
|
||||||
|
} else {
|
||||||
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
|
}
|
||||||
|
} on Exception catch (error, stacktrace) {
|
||||||
|
log("ERROR: FilcAPI.getAds: $error $stacktrace");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
static Future<List<Release>?> getReleases() async {
|
static Future<List<Release>?> getReleases() async {
|
||||||
try {
|
try {
|
||||||
http.Response res = await http.get(Uri.parse(releases));
|
http.Response res = await http.get(Uri.parse(releases));
|
||||||
@@ -149,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}";
|
||||||
@@ -163,6 +214,93 @@ class FilcAPI {
|
|||||||
log("ERROR: FilcAPI.sendReport: $error $stacktrace");
|
log("ERROR: FilcAPI.sendReport: $error $stacktrace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sharing
|
||||||
|
static Future<void> addSharedTheme(SharedTheme theme) async {
|
||||||
|
try {
|
||||||
|
theme.json.remove('json');
|
||||||
|
theme.json['is_public'] = theme.isPublic.toString();
|
||||||
|
theme.json['background_color'] = theme.backgroundColor.value.toString();
|
||||||
|
theme.json['panels_color'] = theme.panelsColor.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(
|
||||||
|
Uri.parse(themeShare),
|
||||||
|
body: theme.json,
|
||||||
|
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (res.statusCode != 201) {
|
||||||
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
|
}
|
||||||
|
|
||||||
|
log('Shared theme successfully with ID: ${theme.id}');
|
||||||
|
} on Exception catch (error, stacktrace) {
|
||||||
|
log("ERROR: FilcAPI.addSharedTheme: $error $stacktrace");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map?> getSharedTheme(String id) async {
|
||||||
|
try {
|
||||||
|
http.Response res = await http.get(Uri.parse(themeByID + 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.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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ErrorReport {
|
class ErrorReport {
|
||||||
|
|||||||
@@ -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,6 +49,58 @@ Future loginAPI({
|
|||||||
void Function(User)? onLogin,
|
void Function(User)? onLogin,
|
||||||
void Function()? onSuccess,
|
void Function()? onSuccess,
|
||||||
}) async {
|
}) async {
|
||||||
|
Future testLogin(School school) async {
|
||||||
|
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,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (onLogin != null) onLogin(user);
|
||||||
|
|
||||||
|
// store test user in db
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (onSuccess != null) onSuccess();
|
||||||
|
|
||||||
|
return LoginState.success;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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",
|
||||||
|
);
|
||||||
|
|
||||||
|
await testLogin(school);
|
||||||
|
} else if (instituteCode == 'refilc-test-spain') {
|
||||||
|
School school = School(
|
||||||
|
city: "Madrid",
|
||||||
|
instituteCode: "refilc-test-spain",
|
||||||
|
name: "reFilc Test ES - Emilio Obrero University",
|
||||||
|
);
|
||||||
|
|
||||||
|
await testLogin(school);
|
||||||
|
} else {
|
||||||
|
// normal login from here
|
||||||
Provider.of<KretaClient>(context, listen: false).userAgent =
|
Provider.of<KretaClient>(context, listen: false).userAgent =
|
||||||
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
||||||
|
|
||||||
@@ -101,7 +155,7 @@ Future loginAPI({
|
|||||||
Provider.of<UserProvider>(context, listen: false).setUser(user.id);
|
Provider.of<UserProvider>(context, listen: false).setUser(user.id);
|
||||||
|
|
||||||
// Get user data
|
// Get user data
|
||||||
// try {
|
try {
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
Provider.of<GradeProvider>(context, listen: false).fetch(),
|
Provider.of<GradeProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<TimetableProvider>(context, listen: false)
|
Provider.of<TimetableProvider>(context, listen: false)
|
||||||
@@ -109,13 +163,15 @@ Future loginAPI({
|
|||||||
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false)
|
||||||
|
.fetchAllRecipients(),
|
||||||
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<EventProvider>(context, listen: false).fetch(),
|
Provider.of<EventProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
||||||
]);
|
]);
|
||||||
// } catch (error) {
|
} catch (error) {
|
||||||
// print("WARNING: failed to fetch user data: $error");
|
print("WARNING: failed to fetch user data: $error");
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (onSuccess != null) onSuccess();
|
if (onSuccess != null) onSuccess();
|
||||||
|
|
||||||
@@ -129,5 +185,7 @@ Future loginAPI({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return LoginState.failed;
|
return LoginState.failed;
|
||||||
}
|
}
|
||||||
|
|||||||
29
filcnaplo/lib/api/providers/ad_provider.dart
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import 'package:filcnaplo/api/client.dart';
|
||||||
|
import 'package:filcnaplo/models/ad.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AdProvider extends ChangeNotifier {
|
||||||
|
// private
|
||||||
|
late List<Ad> _ads;
|
||||||
|
bool get available => _ads.isNotEmpty;
|
||||||
|
|
||||||
|
// public
|
||||||
|
List<Ad> get ads => _ads;
|
||||||
|
|
||||||
|
AdProvider({
|
||||||
|
List<Ad> initialAds = const [],
|
||||||
|
required BuildContext context,
|
||||||
|
}) {
|
||||||
|
_ads = List.castFrom(initialAds);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> fetch() async {
|
||||||
|
_ads = await FilcAPI.getAds() ?? [];
|
||||||
|
_ads.sort((a, b) => -a.date.compareTo(b.date));
|
||||||
|
|
||||||
|
// check for new ads
|
||||||
|
if (_ads.isNotEmpty) {
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,17 +51,18 @@ 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());
|
_timer = Timer.periodic(const Duration(seconds: 1), (timer) => update());
|
||||||
_delay = settings.bellDelayEnabled
|
_delay = settings.bellDelayEnabled
|
||||||
@@ -69,7 +70,6 @@ class LiveCardProvider extends ChangeNotifier {
|
|||||||
: Duration.zero;
|
: Duration.zero;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
@@ -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,8 +1,10 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
enum Status { network, maintenance, syncing }
|
enum Status { network, maintenance, syncing, apiError }
|
||||||
|
|
||||||
class StatusProvider extends ChangeNotifier {
|
class StatusProvider extends ChangeNotifier {
|
||||||
final List<Status> _stack = [];
|
final List<Status> _stack = [];
|
||||||
@@ -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,8 +40,34 @@ 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") || res.statusCode == 503) {
|
if (res.headers.containsKey("x-maintenance-mode") ||
|
||||||
|
res.statusCode == 503) {
|
||||||
if (!_stack.contains(Status.maintenance)) {
|
if (!_stack.contains(Status.maintenance)) {
|
||||||
_stack.insert(0, Status.maintenance);
|
_stack.insert(0, Status.maintenance);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
@@ -48,6 +78,23 @@ class StatusProvider extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.body == 'invalid_grant' ||
|
||||||
|
res.body.replaceAll(' ', '') == '' ||
|
||||||
|
res.statusCode == 400) {
|
||||||
|
if (!_stack.contains(Status.apiError) &&
|
||||||
|
!_stack.contains(Status.network)) {
|
||||||
|
if (res.statusCode == 401) return;
|
||||||
|
_stack.insert(0, Status.apiError);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (_stack.contains(Status.apiError) &&
|
||||||
|
res.request?.url.path != '/nonce') {
|
||||||
|
_stack.remove(Status.apiError);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void triggerSync({required int current, required int max}) {
|
void triggerSync({required int current, required int max}) {
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ Future<void> syncAll(BuildContext context) {
|
|||||||
print("INFO Syncing all");
|
print("INFO Syncing all");
|
||||||
|
|
||||||
UserProvider user = Provider.of<UserProvider>(context, listen: false);
|
UserProvider user = Provider.of<UserProvider>(context, listen: false);
|
||||||
StatusProvider statusProvider = Provider.of<StatusProvider>(context, listen: false);
|
StatusProvider statusProvider =
|
||||||
|
Provider.of<StatusProvider>(context, listen: false);
|
||||||
|
|
||||||
List<Future<void>> tasks = [];
|
List<Future<void>> tasks = [];
|
||||||
int taski = 0;
|
int taski = 0;
|
||||||
@@ -47,10 +48,14 @@ Future<void> syncAll(BuildContext context) {
|
|||||||
|
|
||||||
tasks = [
|
tasks = [
|
||||||
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<TimetableProvider>(context, listen: false).fetch(week: Week.current())),
|
syncStatus(Provider.of<TimetableProvider>(context, listen: false)
|
||||||
|
.fetch(week: Week.current())),
|
||||||
syncStatus(Provider.of<ExamProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<ExamProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<HomeworkProvider>(context, listen: false).fetch(from: DateTime.now().subtract(const Duration(days: 30)))),
|
syncStatus(Provider.of<HomeworkProvider>(context, listen: false)
|
||||||
|
.fetch(from: DateTime.now().subtract(const Duration(days: 30)))),
|
||||||
syncStatus(Provider.of<MessageProvider>(context, listen: false).fetchAll()),
|
syncStatus(Provider.of<MessageProvider>(context, listen: false).fetchAll()),
|
||||||
|
syncStatus(
|
||||||
|
Provider.of<MessageProvider>(context, listen: false).fetchAllRecipients()),
|
||||||
syncStatus(Provider.of<NoteProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<NoteProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<EventProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<EventProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<AbsenceProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<AbsenceProvider>(context, listen: false).fetch()),
|
||||||
@@ -58,14 +63,17 @@ Future<void> syncAll(BuildContext context) {
|
|||||||
// Sync student
|
// Sync student
|
||||||
syncStatus(() async {
|
syncStatus(() async {
|
||||||
if (user.user == null) return;
|
if (user.user == null) return;
|
||||||
Map? studentJson = await Provider.of<KretaClient>(context, listen: false).getAPI(KretaAPI.student(user.instituteCode!));
|
Map? studentJson = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(KretaAPI.student(user.instituteCode!));
|
||||||
if (studentJson == null) return;
|
if (studentJson == null) return;
|
||||||
Student student = Student.fromJson(studentJson);
|
Student student = Student.fromJson(studentJson);
|
||||||
|
|
||||||
user.user?.name = student.name;
|
user.user?.name = student.name;
|
||||||
|
|
||||||
// Store user
|
// Store user
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false).store.storeUser(user.user!);
|
await Provider.of<DatabaseProvider>(context, listen: false)
|
||||||
|
.store
|
||||||
|
.storeUser(user.user!);
|
||||||
}()),
|
}()),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,12 @@ class UpdateProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
// Check for new releases
|
// Check for new releases
|
||||||
if (_releases.isNotEmpty) {
|
if (_releases.isNotEmpty) {
|
||||||
|
if (!_releases.first.prerelease) {
|
||||||
_available = _releases.first.version
|
_available = _releases.first.version
|
||||||
.compareTo(Version.fromString(currentVersion)) ==
|
.compareTo(Version.fromString(currentVersion)) ==
|
||||||
1;
|
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();
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
// ignore_for_file: deprecated_member_use
|
||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
import 'package:filcnaplo/api/client.dart';
|
import 'package:filcnaplo/api/client.dart';
|
||||||
|
import 'package:filcnaplo/api/providers/ad_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/live_card_provider.dart';
|
import 'package:filcnaplo/api/providers/live_card_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/news_provider.dart';
|
import 'package:filcnaplo/api/providers/news_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
@@ -13,6 +16,7 @@ import 'package:filcnaplo/theme/theme.dart';
|
|||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
||||||
import 'package:filcnaplo_premium/providers/goal_provider.dart';
|
import 'package:filcnaplo_premium/providers/goal_provider.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/providers/share_provider.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -60,11 +64,10 @@ class App extends StatelessWidget {
|
|||||||
final DatabaseProvider database;
|
final DatabaseProvider database;
|
||||||
|
|
||||||
const App(
|
const App(
|
||||||
{Key? key,
|
{super.key,
|
||||||
required this.database,
|
required this.database,
|
||||||
required this.settings,
|
required this.settings,
|
||||||
required this.user})
|
required this.user});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -98,12 +101,19 @@ class App extends StatelessWidget {
|
|||||||
Provider<KretaClient>(create: (_) => kreta),
|
Provider<KretaClient>(create: (_) => kreta),
|
||||||
Provider<DatabaseProvider>(create: (context) => database),
|
Provider<DatabaseProvider>(create: (context) => database),
|
||||||
ChangeNotifierProvider<ThemeModeObserver>(
|
ChangeNotifierProvider<ThemeModeObserver>(
|
||||||
create: (context) =>
|
create: (context) => ThemeModeObserver(
|
||||||
ThemeModeObserver(initialTheme: settings.theme)),
|
initialTheme: settings.theme,
|
||||||
|
),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<NewsProvider>(
|
ChangeNotifierProvider<NewsProvider>(
|
||||||
create: (context) => NewsProvider(context: context)),
|
create: (context) => NewsProvider(context: context),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<UpdateProvider>(
|
ChangeNotifierProvider<UpdateProvider>(
|
||||||
create: (context) => UpdateProvider(context: context)),
|
create: (context) => UpdateProvider(context: context),
|
||||||
|
),
|
||||||
|
ChangeNotifierProvider<AdProvider>(
|
||||||
|
create: (context) => AdProvider(context: context),
|
||||||
|
),
|
||||||
|
|
||||||
// user data (kreten) providers
|
// user data (kreten) providers
|
||||||
ChangeNotifierProvider<GradeProvider>(
|
ChangeNotifierProvider<GradeProvider>(
|
||||||
@@ -111,21 +121,32 @@ class App extends StatelessWidget {
|
|||||||
settings: settings,
|
settings: settings,
|
||||||
user: user,
|
user: user,
|
||||||
database: database,
|
database: database,
|
||||||
kreta: kreta)),
|
kreta: kreta,
|
||||||
|
),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<TimetableProvider>(create: (_) => timetable),
|
ChangeNotifierProvider<TimetableProvider>(create: (_) => timetable),
|
||||||
ChangeNotifierProvider<ExamProvider>(
|
ChangeNotifierProvider<ExamProvider>(
|
||||||
create: (context) => ExamProvider(context: context)),
|
create: (context) => ExamProvider(context: context),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<HomeworkProvider>(
|
ChangeNotifierProvider<HomeworkProvider>(
|
||||||
create: (context) =>
|
create: (context) => HomeworkProvider(
|
||||||
HomeworkProvider(context: context, database: database)),
|
context: context,
|
||||||
|
database: database,
|
||||||
|
user: user,
|
||||||
|
),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<MessageProvider>(
|
ChangeNotifierProvider<MessageProvider>(
|
||||||
create: (context) => MessageProvider(context: context)),
|
create: (context) => MessageProvider(context: context),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<NoteProvider>(
|
ChangeNotifierProvider<NoteProvider>(
|
||||||
create: (context) => NoteProvider(context: context)),
|
create: (context) => NoteProvider(context: context),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<EventProvider>(
|
ChangeNotifierProvider<EventProvider>(
|
||||||
create: (context) => EventProvider(context: context)),
|
create: (context) => EventProvider(context: context),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<AbsenceProvider>(
|
ChangeNotifierProvider<AbsenceProvider>(
|
||||||
create: (context) => AbsenceProvider(context: context)),
|
create: (context) => AbsenceProvider(context: context),
|
||||||
|
),
|
||||||
|
|
||||||
// other providers
|
// other providers
|
||||||
ChangeNotifierProvider<GradeCalculatorProvider>(
|
ChangeNotifierProvider<GradeCalculatorProvider>(
|
||||||
@@ -133,12 +154,26 @@ class App extends StatelessWidget {
|
|||||||
settings: settings,
|
settings: settings,
|
||||||
user: user,
|
user: user,
|
||||||
database: database,
|
database: database,
|
||||||
kreta: kreta)),
|
kreta: kreta,
|
||||||
|
),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<LiveCardProvider>(
|
ChangeNotifierProvider<LiveCardProvider>(
|
||||||
create: (context) =>
|
create: (context) => LiveCardProvider(
|
||||||
LiveCardProvider(timetable: timetable, settings: settings)),
|
timetable: timetable,
|
||||||
|
settings: settings,
|
||||||
|
),
|
||||||
|
),
|
||||||
ChangeNotifierProvider<GoalProvider>(
|
ChangeNotifierProvider<GoalProvider>(
|
||||||
create: (context) => GoalProvider(database: database, user: user)),
|
create: (context) => GoalProvider(
|
||||||
|
database: database,
|
||||||
|
user: user,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ChangeNotifierProvider<ShareProvider>(
|
||||||
|
create: (context) => ShareProvider(
|
||||||
|
user: user,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
child: Consumer<ThemeModeObserver>(
|
child: Consumer<ThemeModeObserver>(
|
||||||
builder: (context, themeMode, child) {
|
builder: (context, themeMode, child) {
|
||||||
|
|||||||
@@ -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, "app_icon": 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!!!
|
||||||
@@ -43,7 +45,7 @@ const usersDB = DatabaseStruct("users", {
|
|||||||
});
|
});
|
||||||
const userDataDB = DatabaseStruct("user_data", {
|
const userDataDB = DatabaseStruct("user_data", {
|
||||||
"id": String, "grades": String, "timetable": String, "exams": String,
|
"id": String, "grades": String, "timetable": String, "exams": String,
|
||||||
"homework": String, "messages": String, "notes": String,
|
"homework": String, "messages": String, "recipients": String, "notes": String,
|
||||||
"events": String, "absences": String, "group_averages": String,
|
"events": String, "absences": String, "group_averages": String,
|
||||||
// renamed subjects // non kreta data
|
// renamed subjects // non kreta data
|
||||||
"renamed_subjects": String,
|
"renamed_subjects": String,
|
||||||
@@ -99,7 +101,8 @@ Future<Database> initDB(DatabaseProvider database) async {
|
|||||||
);
|
);
|
||||||
await migrateDB(db, struct: userDataDB, defaultValues: {
|
await migrateDB(db, struct: userDataDB, defaultValues: {
|
||||||
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]",
|
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]",
|
||||||
"messages": "[]", "notes": "[]", "events": "[]", "absences": "[]",
|
"messages": "[]", "recipients": "[]", "notes": "[]", "events": "[]",
|
||||||
|
"absences": "[]",
|
||||||
"group_averages": "[]",
|
"group_averages": "[]",
|
||||||
// renamed subjects // non kreta data
|
// renamed subjects // non kreta data
|
||||||
"renamed_subjects": "{}",
|
"renamed_subjects": "{}",
|
||||||
|
|||||||
@@ -122,6 +122,19 @@ class UserDatabaseQuery {
|
|||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<List<SendRecipient>> getRecipients({required String userId}) async {
|
||||||
|
List<Map> userData =
|
||||||
|
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
||||||
|
if (userData.isEmpty) return [];
|
||||||
|
String? recipientsJson = userData.elementAt(0)["recipients"] as String?;
|
||||||
|
if (recipientsJson == null) return [];
|
||||||
|
List<SendRecipient> recipients = (jsonDecode(recipientsJson) as List)
|
||||||
|
.map((e) =>
|
||||||
|
SendRecipient.fromJson(e, SendRecipientType.fromJson(e['tipus'])))
|
||||||
|
.toList();
|
||||||
|
return recipients;
|
||||||
|
}
|
||||||
|
|
||||||
Future<List<Note>> getNotes({required String userId}) async {
|
Future<List<Note>> getNotes({required String userId}) async {
|
||||||
List<Map> userData =
|
List<Map> userData =
|
||||||
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ class UserDatabaseStore {
|
|||||||
where: "id = ?", whereArgs: [userId]);
|
where: "id = ?", whereArgs: [userId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> storeRecipients(List<SendRecipient> recipients,
|
||||||
|
{required String userId}) async {
|
||||||
|
String recipientsJson = jsonEncode(recipients.map((e) => e.json).toList());
|
||||||
|
await db.update("user_data", {"recipients": recipientsJson},
|
||||||
|
where: "id = ?", whereArgs: [userId]);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> storeNotes(List<Note> notes, {required String userId}) async {
|
Future<void> storeNotes(List<Note> notes, {required String userId}) async {
|
||||||
String notesJson = jsonEncode(notes.map((e) => e.json).toList());
|
String notesJson = jsonEncode(notes.map((e) => e.json).toList());
|
||||||
await db.update("user_data", {"notes": notesJson},
|
await db.update("user_data", {"notes": notesJson},
|
||||||
|
|||||||
@@ -9,16 +9,20 @@ import 'package:filcnaplo_kreta_api/client/client.dart';
|
|||||||
import 'package:filcnaplo_kreta_api/models/attachment.dart';
|
import 'package:filcnaplo_kreta_api/models/attachment.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:open_file/open_file.dart';
|
import 'package:open_filex/open_filex.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
extension AttachmentHelper on Attachment {
|
extension AttachmentHelper on Attachment {
|
||||||
Future<String> download(BuildContext context, {bool overwrite = false}) async {
|
Future<String> download(BuildContext context,
|
||||||
|
{bool overwrite = false}) async {
|
||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!overwrite && await File("$downloads/$name").exists()) return "$downloads/$name";
|
if (!overwrite && await File("$downloads/$name").exists()) {
|
||||||
|
return "$downloads/$name";
|
||||||
|
}
|
||||||
|
|
||||||
Uint8List data = await Provider.of<KretaClient>(context, listen: false).getAPI(downloadUrl, rawResponse: true);
|
Uint8List data = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(downloadUrl, rawResponse: true);
|
||||||
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
||||||
|
|
||||||
return "$downloads/$name";
|
return "$downloads/$name";
|
||||||
@@ -28,19 +32,24 @@ extension AttachmentHelper on Attachment {
|
|||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!await File("$downloads/$name").exists()) await download(context);
|
if (!await File("$downloads/$name").exists()) await download(context);
|
||||||
var result = await OpenFile.open("$downloads/$name");
|
var result = await OpenFilex.open("$downloads/$name");
|
||||||
return result.type == ResultType.done;
|
return result.type == ResultType.done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension HomeworkAttachmentHelper on HomeworkAttachment {
|
extension HomeworkAttachmentHelper on HomeworkAttachment {
|
||||||
Future<String> download(BuildContext context, {bool overwrite = false}) async {
|
Future<String> download(BuildContext context,
|
||||||
|
{bool overwrite = false}) async {
|
||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!overwrite && await File("$downloads/$name").exists()) return "$downloads/$name";
|
if (!overwrite && await File("$downloads/$name").exists()) {
|
||||||
|
return "$downloads/$name";
|
||||||
|
}
|
||||||
|
|
||||||
String url = downloadUrl(Provider.of<UserProvider>(context, listen: false).instituteCode ?? "");
|
String url = downloadUrl(
|
||||||
Uint8List data = await Provider.of<KretaClient>(context, listen: false).getAPI(url, rawResponse: true);
|
Provider.of<UserProvider>(context, listen: false).instituteCode ?? "");
|
||||||
|
Uint8List data = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(url, rawResponse: true);
|
||||||
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
||||||
|
|
||||||
return "$downloads/$name";
|
return "$downloads/$name";
|
||||||
@@ -50,7 +59,7 @@ extension HomeworkAttachmentHelper on HomeworkAttachment {
|
|||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!await File("$downloads/$name").exists()) await download(context);
|
if (!await File("$downloads/$name").exists()) await download(context);
|
||||||
var result = await OpenFile.open("$downloads/$name");
|
var result = await OpenFilex.open("$downloads/$name");
|
||||||
return result.type == ResultType.done;
|
return result.type == ResultType.done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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!,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import 'package:permission_handler/permission_handler.dart';
|
|||||||
class StorageHelper {
|
class StorageHelper {
|
||||||
static Future<bool> write(String path, Uint8List data) async {
|
static Future<bool> write(String path, Uint8List data) async {
|
||||||
try {
|
try {
|
||||||
if (await Permission.storage.request().isGranted) {
|
if (await Permission.manageExternalStorage.request().isGranted) {
|
||||||
await File(path).writeAsBytes(data);
|
await File(path).writeAsBytes(data);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -34,5 +34,6 @@ class StorageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return downloads;
|
return downloads;
|
||||||
|
// return (await getTemporaryDirectory()).path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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ó";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'dart:typed_data';
|
|||||||
import 'package:filcnaplo/api/client.dart';
|
import 'package:filcnaplo/api/client.dart';
|
||||||
import 'package:filcnaplo/helpers/storage_helper.dart';
|
import 'package:filcnaplo/helpers/storage_helper.dart';
|
||||||
import 'package:filcnaplo/models/release.dart';
|
import 'package:filcnaplo/models/release.dart';
|
||||||
import 'package:open_file/open_file.dart';
|
import 'package:open_filex/open_filex.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
enum UpdateState { none, preparing, downloading, installing }
|
enum UpdateState { none, preparing, downloading, installing }
|
||||||
@@ -33,11 +33,11 @@ extension UpdateHelper on Release {
|
|||||||
|
|
||||||
updateCallback(-1, UpdateState.installing);
|
updateCallback(-1, UpdateState.installing);
|
||||||
|
|
||||||
var permStatus =
|
var installPerms =
|
||||||
(await Permission.manageExternalStorage.request().isGranted &&
|
(await Permission.manageExternalStorage.request().isGranted &&
|
||||||
await Permission.requestInstallPackages.request().isGranted);
|
await Permission.requestInstallPackages.request().isGranted);
|
||||||
if (permStatus) {
|
if (installPerms) {
|
||||||
var result = await OpenFile.open(apk.path);
|
var result = await OpenFilex.open(apk.path);
|
||||||
|
|
||||||
if (result.type != ResultType.done) {
|
if (result.type != ResultType.done) {
|
||||||
// ignore: avoid_print
|
// ignore: avoid_print
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|||||||
void main() async {
|
void main() async {
|
||||||
// Initalize
|
// Initalize
|
||||||
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
|
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
// ignore: deprecated_member_use
|
||||||
binding.renderView.automaticSystemUiAdjustment = false;
|
binding.renderView.automaticSystemUiAdjustment = false;
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
// Startup
|
// Startup
|
||||||
@@ -63,7 +64,7 @@ class Startup {
|
|||||||
await flutterLocalNotificationsPlugin
|
await flutterLocalNotificationsPlugin
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin>()!
|
AndroidFlutterLocalNotificationsPlugin>()!
|
||||||
.requestPermission();
|
.requestNotificationsPermission();
|
||||||
} else if (Platform.isIOS) {
|
} else if (Platform.isIOS) {
|
||||||
await flutterLocalNotificationsPlugin
|
await flutterLocalNotificationsPlugin
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
|
|||||||
37
filcnaplo/lib/models/ad.dart
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
class Ad {
|
||||||
|
String title;
|
||||||
|
String description;
|
||||||
|
String author;
|
||||||
|
Uri? logoUrl;
|
||||||
|
bool overridePremium;
|
||||||
|
DateTime date;
|
||||||
|
DateTime expireDate;
|
||||||
|
Uri launchUrl;
|
||||||
|
|
||||||
|
Ad({
|
||||||
|
required this.title,
|
||||||
|
required this.description,
|
||||||
|
required this.author,
|
||||||
|
this.logoUrl,
|
||||||
|
this.overridePremium = false,
|
||||||
|
required this.date,
|
||||||
|
required this.expireDate,
|
||||||
|
required this.launchUrl,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Ad.fromJson(Map json) {
|
||||||
|
return Ad(
|
||||||
|
title: json['title'] ?? 'Ad',
|
||||||
|
description: json['description'] ?? '',
|
||||||
|
author: json['author'] ?? 'reFilc',
|
||||||
|
logoUrl: json['logo_url'] != null ? Uri.parse(json['logo_url']) : null,
|
||||||
|
overridePremium: json['override_premium'] ?? false,
|
||||||
|
date:
|
||||||
|
json['date'] != null ? DateTime.parse(json['date']) : DateTime.now(),
|
||||||
|
expireDate: json['expire_date'] != null
|
||||||
|
? DateTime.parse(json['expire_date'])
|
||||||
|
: DateTime.now(),
|
||||||
|
launchUrl: Uri.parse(json['launch_url'] ?? 'https://refilc.hu'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,18 +3,22 @@ import 'dart:io';
|
|||||||
class Config {
|
class Config {
|
||||||
String _userAgent;
|
String _userAgent;
|
||||||
Map? json;
|
Map? json;
|
||||||
static const String _version = String.fromEnvironment("APPVER", defaultValue: "2.2.0");
|
static const String _version =
|
||||||
|
String.fromEnvironment("APPVER", defaultValue: "3.0.4");
|
||||||
|
|
||||||
Config({required String userAgent, this.json}) : _userAgent = userAgent;
|
Config({required String userAgent, this.json}) : _userAgent = userAgent;
|
||||||
|
|
||||||
factory Config.fromJson(Map json) {
|
factory Config.fromJson(Map json) {
|
||||||
return Config(
|
return Config(
|
||||||
userAgent: json["user_agent"] ?? "hu.refilc.naplo/\$0/\$1/\$2",
|
userAgent: json["user_agent"] ?? "hu.ekreta.student/\$0/\$1/\$2",
|
||||||
json: json,
|
json: json,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String get userAgent => _userAgent.replaceAll("\$0", _version).replaceAll("\$1", platform).replaceAll("\$2", "0");
|
String get userAgent => _userAgent
|
||||||
|
.replaceAll("\$0", _version)
|
||||||
|
.replaceAll("\$1", platform)
|
||||||
|
.replaceAll("\$2", "0");
|
||||||
|
|
||||||
static String get platform {
|
static String get platform {
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
|
|||||||
@@ -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,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool _renamedTeachersEnabled;
|
bool _renamedTeachersEnabled;
|
||||||
bool _renamedTeachersItalics;
|
bool _renamedTeachersItalics;
|
||||||
Color _liveActivityColor;
|
Color _liveActivityColor;
|
||||||
|
String _welcomeMessage;
|
||||||
|
String _appIcon;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
DatabaseProvider? database,
|
DatabaseProvider? database,
|
||||||
@@ -111,6 +115,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 +126,8 @@ 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,
|
||||||
|
required String appIcon,
|
||||||
}) : _database = database,
|
}) : _database = database,
|
||||||
_language = language,
|
_language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
@@ -153,6 +161,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 +171,9 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_renamedSubjectsItalics = renameSubjectsItalics,
|
_renamedSubjectsItalics = renameSubjectsItalics,
|
||||||
_renamedTeachersEnabled = renameTeachersEnabled,
|
_renamedTeachersEnabled = renameTeachersEnabled,
|
||||||
_renamedTeachersItalics = renameTeachersItalics,
|
_renamedTeachersItalics = renameTeachersItalics,
|
||||||
_liveActivityColor = liveActivityColor;
|
_liveActivityColor = liveActivityColor,
|
||||||
|
_welcomeMessage = welcomeMessage,
|
||||||
|
_appIcon = appIcon;
|
||||||
|
|
||||||
factory SettingsProvider.fromMap(Map map,
|
factory SettingsProvider.fromMap(Map map,
|
||||||
{required DatabaseProvider database}) {
|
{required DatabaseProvider database}) {
|
||||||
@@ -214,6 +226,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 +237,8 @@ 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"],
|
||||||
|
appIcon: map["app_icon"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +279,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 +290,8 @@ 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,
|
||||||
|
"app_icon": _appIcon,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,9 +333,11 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bellDelay: 0,
|
bellDelay: 0,
|
||||||
gradeOpeningFun: true,
|
gradeOpeningFun: true,
|
||||||
iconPack: IconPack.cupertino,
|
iconPack: IconPack.cupertino,
|
||||||
customAccentColor: const Color(0xff20AC9B),
|
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 +347,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersEnabled: false,
|
renameTeachersEnabled: false,
|
||||||
renameTeachersItalics: false,
|
renameTeachersItalics: false,
|
||||||
liveActivityColor: const Color(0xFF676767),
|
liveActivityColor: const Color(0xFF676767),
|
||||||
|
welcomeMessage: '',
|
||||||
|
appIcon: 'refilc_default',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,6 +388,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 +399,8 @@ 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;
|
||||||
|
String get appIcon => _appIcon;
|
||||||
|
|
||||||
Future<void> update({
|
Future<void> update({
|
||||||
bool store = true,
|
bool store = true,
|
||||||
@@ -408,6 +436,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 +447,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool? renamedTeachersEnabled,
|
bool? renamedTeachersEnabled,
|
||||||
bool? renamedTeachersItalics,
|
bool? renamedTeachersItalics,
|
||||||
Color? liveActivityColor,
|
Color? liveActivityColor,
|
||||||
|
String? welcomeMessage,
|
||||||
|
String? appIcon,
|
||||||
}) 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 +535,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 +573,13 @@ 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 (appIcon != null && appIcon != _appIcon) {
|
||||||
|
_appIcon = appIcon;
|
||||||
|
}
|
||||||
|
// store or not
|
||||||
if (store) await _database?.store.storeSettings(this);
|
if (store) await _database?.store.storeSettings(this);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|||||||
80
filcnaplo/lib/models/shared_theme.dart
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
class SharedTheme {
|
||||||
|
Map json;
|
||||||
|
String id;
|
||||||
|
bool isPublic;
|
||||||
|
String nickname;
|
||||||
|
Color backgroundColor;
|
||||||
|
Color panelsColor;
|
||||||
|
Color accentColor;
|
||||||
|
Color iconColor;
|
||||||
|
bool shadowEffect;
|
||||||
|
SharedGradeColors gradeColors;
|
||||||
|
|
||||||
|
SharedTheme({
|
||||||
|
required this.json,
|
||||||
|
required this.id,
|
||||||
|
this.isPublic = false,
|
||||||
|
this.nickname = 'Anonymous',
|
||||||
|
required this.backgroundColor,
|
||||||
|
required this.panelsColor,
|
||||||
|
required this.accentColor,
|
||||||
|
required this.iconColor,
|
||||||
|
required this.shadowEffect,
|
||||||
|
required this.gradeColors,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SharedTheme.fromJson(Map json, SharedGradeColors gradeColors) {
|
||||||
|
return SharedTheme(
|
||||||
|
json: json,
|
||||||
|
id: json['public_id'],
|
||||||
|
isPublic: json['is_public'] ?? false,
|
||||||
|
nickname: json['nickname'] ?? 'Anonymous',
|
||||||
|
backgroundColor: Color(json['background_color']),
|
||||||
|
panelsColor: Color(json['panels_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,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:filcnaplo/api/providers/ad_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/update_provider.dart';
|
import 'package:filcnaplo/api/providers/update_provider.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/ui/date_widget.dart';
|
import 'package:filcnaplo/ui/date_widget.dart';
|
||||||
@@ -14,6 +15,7 @@ import 'package:filcnaplo/ui/filter/widgets/lessons.dart' as lesson_filter;
|
|||||||
import 'package:filcnaplo/ui/filter/widgets/update.dart' as update_filter;
|
import 'package:filcnaplo/ui/filter/widgets/update.dart' as update_filter;
|
||||||
import 'package:filcnaplo/ui/filter/widgets/missed_exams.dart'
|
import 'package:filcnaplo/ui/filter/widgets/missed_exams.dart'
|
||||||
as missed_exam_filter;
|
as missed_exam_filter;
|
||||||
|
import 'package:filcnaplo/ui/filter/widgets/ads.dart' as ad_filter;
|
||||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
import 'package:filcnaplo_kreta_api/models/week.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';
|
||||||
@@ -33,6 +35,7 @@ import 'package:provider/provider.dart';
|
|||||||
const List<FilterType> homeFilters = [
|
const List<FilterType> homeFilters = [
|
||||||
FilterType.all,
|
FilterType.all,
|
||||||
FilterType.grades,
|
FilterType.grades,
|
||||||
|
FilterType.exams,
|
||||||
FilterType.messages,
|
FilterType.messages,
|
||||||
FilterType.absences
|
FilterType.absences
|
||||||
];
|
];
|
||||||
@@ -50,7 +53,8 @@ enum FilterType {
|
|||||||
lessons,
|
lessons,
|
||||||
updates,
|
updates,
|
||||||
certifications,
|
certifications,
|
||||||
missedExams
|
missedExams,
|
||||||
|
ads,
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
||||||
@@ -65,6 +69,7 @@ Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
|||||||
final eventProvider = Provider.of<EventProvider>(context);
|
final eventProvider = Provider.of<EventProvider>(context);
|
||||||
final updateProvider = Provider.of<UpdateProvider>(context);
|
final updateProvider = Provider.of<UpdateProvider>(context);
|
||||||
final settingsProvider = Provider.of<SettingsProvider>(context);
|
final settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
final adProvider = Provider.of<AdProvider>(context);
|
||||||
|
|
||||||
List<DateWidget> items = [];
|
List<DateWidget> items = [];
|
||||||
|
|
||||||
@@ -82,6 +87,7 @@ Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
|||||||
getFilterWidgets(FilterType.updates, context: context),
|
getFilterWidgets(FilterType.updates, context: context),
|
||||||
getFilterWidgets(FilterType.certifications, context: context),
|
getFilterWidgets(FilterType.certifications, context: context),
|
||||||
getFilterWidgets(FilterType.missedExams, context: context),
|
getFilterWidgets(FilterType.missedExams, context: context),
|
||||||
|
getFilterWidgets(FilterType.ads, context: context),
|
||||||
]);
|
]);
|
||||||
items = all.expand((x) => x).toList();
|
items = all.expand((x) => x).toList();
|
||||||
|
|
||||||
@@ -89,13 +95,14 @@ Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
|||||||
|
|
||||||
// Grades
|
// Grades
|
||||||
case FilterType.grades:
|
case FilterType.grades:
|
||||||
if(!settingsProvider.gradeOpeningFun) {
|
if (!settingsProvider.gradeOpeningFun) {
|
||||||
gradeProvider.seenAll();
|
gradeProvider.seenAll();
|
||||||
}
|
}
|
||||||
items = grade_filter.getWidgets(
|
items = grade_filter.getWidgets(
|
||||||
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;
|
||||||
@@ -164,6 +171,13 @@ Future<List<DateWidget>> getFilterWidgets(FilterType activeData,
|
|||||||
items = missed_exam_filter
|
items = missed_exam_filter
|
||||||
.getWidgets(timetableProvider.getWeek(Week.current()) ?? []);
|
.getWidgets(timetableProvider.getWeek(Week.current()) ?? []);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Ads
|
||||||
|
case FilterType.ads:
|
||||||
|
if (adProvider.available) {
|
||||||
|
items = ad_filter.getWidgets(adProvider.ads);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
@@ -201,6 +215,8 @@ Widget filterItemBuilder(
|
|||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
if (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,
|
||||||
|
|||||||
25
filcnaplo/lib/ui/filter/widgets/ads.dart
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import 'package:filcnaplo/models/ad.dart';
|
||||||
|
import 'package:filcnaplo/ui/date_widget.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/common/widgets/ad/ad_viewable.dart'
|
||||||
|
as mobile;
|
||||||
|
|
||||||
|
List<DateWidget> getWidgets(List<Ad> providerAds) {
|
||||||
|
List<DateWidget> items = [];
|
||||||
|
|
||||||
|
if (providerAds.isNotEmpty) {
|
||||||
|
for (var ad in providerAds) {
|
||||||
|
if (ad.date.isBefore(DateTime.now()) &&
|
||||||
|
ad.expireDate.isAfter(DateTime.now())) {
|
||||||
|
providerAds.sort((a, b) => -a.date.compareTo(b.date));
|
||||||
|
|
||||||
|
items.add(DateWidget(
|
||||||
|
key: ad.description,
|
||||||
|
date: ad.date,
|
||||||
|
widget: mobile.AdViewable(ad),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return items;
|
||||||
|
}
|
||||||
@@ -87,13 +87,13 @@ Widget _defaultItemBuilder(Color color, bool isCurrentColor, void Function() cha
|
|||||||
// The blocky color picker you can alter the layout and shape.
|
// The blocky color picker you can alter the layout and shape.
|
||||||
class BlockPicker extends StatefulWidget {
|
class BlockPicker extends StatefulWidget {
|
||||||
BlockPicker({
|
BlockPicker({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.pickerColor,
|
required this.pickerColor,
|
||||||
required this.onColorChanged,
|
required this.onColorChanged,
|
||||||
this.useInShowDialog = true,
|
this.useInShowDialog = true,
|
||||||
this.layoutBuilder = _defaultLayoutBuilder,
|
this.layoutBuilder = _defaultLayoutBuilder,
|
||||||
this.itemBuilder = _defaultItemBuilder,
|
this.itemBuilder = _defaultItemBuilder,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Color? pickerColor;
|
final Color? pickerColor;
|
||||||
final ValueChanged<Color> onColorChanged;
|
final ValueChanged<Color> onColorChanged;
|
||||||
@@ -7,20 +7,26 @@
|
|||||||
///
|
///
|
||||||
/// You can create your own layout by importing `picker.dart`.
|
/// You can create your own layout by importing `picker.dart`.
|
||||||
|
|
||||||
|
// ignore_for_file: use_build_context_synchronously
|
||||||
|
|
||||||
library hsv_picker;
|
library hsv_picker;
|
||||||
|
|
||||||
import 'package:filcnaplo_premium/ui/mobile/flutter_colorpicker/block_picker.dart';
|
import 'package:filcnaplo/models/shared_theme.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/flutter_colorpicker/palette.dart';
|
import 'package:filcnaplo_mobile_ui/common/custom_snack_bar.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/flutter_colorpicker/utils.dart';
|
import 'package:filcnaplo_kreta_api/providers/share_provider.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/theme.dart';
|
import 'package:filcnaplo/ui/flutter_colorpicker/block_picker.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/theme.i18n.dart';
|
import 'package:filcnaplo/ui/flutter_colorpicker/palette.dart';
|
||||||
|
import 'package:filcnaplo/ui/flutter_colorpicker/utils.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/screens/settings/theme_screen.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/screens/settings/theme_screen.i18n.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class FilcColorPicker extends StatefulWidget {
|
class FilcColorPicker extends StatefulWidget {
|
||||||
const FilcColorPicker({
|
const FilcColorPicker({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.colorMode,
|
required this.colorMode,
|
||||||
required this.pickerColor,
|
required this.pickerColor,
|
||||||
required this.onColorChanged,
|
required this.onColorChanged,
|
||||||
@@ -48,7 +54,8 @@ class FilcColorPicker extends StatefulWidget {
|
|||||||
this.hexInputController,
|
this.hexInputController,
|
||||||
this.colorHistory,
|
this.colorHistory,
|
||||||
this.onHistoryChanged,
|
this.onHistoryChanged,
|
||||||
}) : super(key: key);
|
required this.onThemeIdProvided,
|
||||||
|
});
|
||||||
|
|
||||||
final CustomColorMode colorMode;
|
final CustomColorMode colorMode;
|
||||||
final Color pickerColor;
|
final Color pickerColor;
|
||||||
@@ -70,12 +77,17 @@ class FilcColorPicker extends StatefulWidget {
|
|||||||
final TextEditingController? hexInputController;
|
final TextEditingController? hexInputController;
|
||||||
final List<Color>? colorHistory;
|
final List<Color>? colorHistory;
|
||||||
final ValueChanged<List<Color>>? onHistoryChanged;
|
final ValueChanged<List<Color>>? onHistoryChanged;
|
||||||
|
final void Function(SharedTheme theme) onThemeIdProvided;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_FilcColorPickerState createState() => _FilcColorPickerState();
|
FilcColorPickerState createState() => FilcColorPickerState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FilcColorPickerState extends State<FilcColorPicker> {
|
class FilcColorPickerState extends State<FilcColorPicker> {
|
||||||
|
final idController = TextEditingController();
|
||||||
|
|
||||||
|
late final ShareProvider shareProvider;
|
||||||
|
|
||||||
HSVColor currentHsvColor = const HSVColor.fromAHSV(0.0, 0.0, 0.0, 0.0);
|
HSVColor currentHsvColor = const HSVColor.fromAHSV(0.0, 0.0, 0.0, 0.0);
|
||||||
List<Color> colorHistory = [];
|
List<Color> colorHistory = [];
|
||||||
bool isAdvancedView = false;
|
bool isAdvancedView = false;
|
||||||
@@ -98,6 +110,7 @@ class _FilcColorPickerState extends State<FilcColorPicker> {
|
|||||||
if (widget.colorHistory != null && widget.onHistoryChanged != null) {
|
if (widget.colorHistory != null && widget.onHistoryChanged != null) {
|
||||||
colorHistory = widget.colorHistory ?? [];
|
colorHistory = widget.colorHistory ?? [];
|
||||||
}
|
}
|
||||||
|
shareProvider = Provider.of<ShareProvider>(context, listen: false);
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +195,8 @@ class _FilcColorPickerState extends State<FilcColorPicker> {
|
|||||||
widget.portraitOnly) {
|
widget.portraitOnly) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
if (widget.colorMode != CustomColorMode.theme)
|
if (widget.colorMode != CustomColorMode.theme &&
|
||||||
|
widget.colorMode != CustomColorMode.enterId)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -215,7 +229,9 @@ class _FilcColorPickerState extends State<FilcColorPicker> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isAdvancedView && widget.colorMode != CustomColorMode.theme)
|
if (isAdvancedView &&
|
||||||
|
widget.colorMode != CustomColorMode.theme &&
|
||||||
|
widget.colorMode != CustomColorMode.enterId)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 6.0),
|
padding: const EdgeInsets.only(bottom: 6.0),
|
||||||
child: ColorPickerInput(
|
child: ColorPickerInput(
|
||||||
@@ -231,6 +247,54 @@ class _FilcColorPickerState extends State<FilcColorPicker> {
|
|||||||
embeddedText: false,
|
embeddedText: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (widget.colorMode == CustomColorMode.enterId)
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TextField(
|
||||||
|
autocorrect: false,
|
||||||
|
autofocus: true,
|
||||||
|
onEditingComplete: () async {
|
||||||
|
SharedTheme? theme = await shareProvider.getThemeById(
|
||||||
|
context,
|
||||||
|
id: idController.text.replaceAll(' ', ''),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (theme != null) {
|
||||||
|
widget.onThemeIdProvided(theme);
|
||||||
|
idController.clear();
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
CustomSnackBar(
|
||||||
|
content: Text("theme_not_found".i18n,
|
||||||
|
style: const TextStyle(color: Colors.white)),
|
||||||
|
backgroundColor: AppColors.of(context).red,
|
||||||
|
context: context,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
controller: idController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'theme_id'.i18n,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// MaterialActionButton(
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
// children: [
|
||||||
|
// Text('check_id'.i18n),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// backgroundColor: AppColors.of(context).filc,
|
||||||
|
// onPressed: () {},
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (widget.colorMode != CustomColorMode.enterId)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 70 * (widget.colorMode == CustomColorMode.theme ? 2 : 1),
|
height: 70 * (widget.colorMode == CustomColorMode.theme ? 2 : 1),
|
||||||
child: BlockPicker(
|
child: BlockPicker(
|
||||||
@@ -281,7 +345,8 @@ class _FilcColorPickerState extends State<FilcColorPicker> {
|
|||||||
onColorChanged: (c) => {},
|
onColorChanged: (c) => {},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.colorMode != CustomColorMode.theme)
|
if (widget.colorMode != CustomColorMode.theme &&
|
||||||
|
widget.colorMode != CustomColorMode.enterId)
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
|
|
||||||
|
// ignore: dangling_library_doc_comments
|
||||||
/// The components of HSV Color Picker
|
/// The components of HSV Color Picker
|
||||||
///
|
///
|
||||||
/// Try to create a Color Picker with other layout on your own :)
|
/// Try to create a Color Picker with other layout on your own :)
|
||||||
@@ -317,11 +318,11 @@ class ColorPickerInput extends StatefulWidget {
|
|||||||
const ColorPickerInput(
|
const ColorPickerInput(
|
||||||
this.color,
|
this.color,
|
||||||
this.onColorChanged, {
|
this.onColorChanged, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.enableAlpha = true,
|
this.enableAlpha = true,
|
||||||
this.embeddedText = false,
|
this.embeddedText = false,
|
||||||
this.disable = false,
|
this.disable = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Color color;
|
final Color color;
|
||||||
final ValueChanged<Color> onColorChanged;
|
final ValueChanged<Color> onColorChanged;
|
||||||
@@ -330,10 +331,10 @@ class ColorPickerInput extends StatefulWidget {
|
|||||||
final bool disable;
|
final bool disable;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ColorPickerInputState createState() => _ColorPickerInputState();
|
ColorPickerInputState createState() => ColorPickerInputState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ColorPickerInputState extends State<ColorPickerInput> {
|
class ColorPickerInputState extends State<ColorPickerInput> {
|
||||||
TextEditingController textEditingController = TextEditingController();
|
TextEditingController textEditingController = TextEditingController();
|
||||||
int inputColor = 0;
|
int inputColor = 0;
|
||||||
|
|
||||||
@@ -346,11 +347,7 @@ class _ColorPickerInputState extends State<ColorPickerInput> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (inputColor != widget.color.value) {
|
if (inputColor != widget.color.value) {
|
||||||
textEditingController.text = '#' +
|
textEditingController.text = '#${widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : ''}';
|
||||||
widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0') +
|
|
||||||
widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0') +
|
|
||||||
widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0') +
|
|
||||||
(widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : '');
|
|
||||||
}
|
}
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 6.0, left: 12.0, right: 12.0),
|
padding: const EdgeInsets.only(top: 6.0, left: 12.0, right: 12.0),
|
||||||
@@ -516,10 +513,10 @@ class ColorPickerSlider extends StatelessWidget {
|
|||||||
this.onColorChanged,
|
this.onColorChanged,
|
||||||
this.onColorChangeEnd,
|
this.onColorChangeEnd,
|
||||||
this.onProblem, {
|
this.onProblem, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.displayThumbColor = false,
|
this.displayThumbColor = false,
|
||||||
this.fullThumbColor = false,
|
this.fullThumbColor = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final TrackType trackType;
|
final TrackType trackType;
|
||||||
final HSVColor hsvColor;
|
final HSVColor hsvColor;
|
||||||
@@ -657,13 +654,13 @@ class ColorPickerSlider extends StatelessWidget {
|
|||||||
class ColorIndicator extends StatelessWidget {
|
class ColorIndicator extends StatelessWidget {
|
||||||
const ColorIndicator(
|
const ColorIndicator(
|
||||||
this.hsvColor, {
|
this.hsvColor, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.currentHsvColor,
|
this.currentHsvColor,
|
||||||
this.icon,
|
this.icon,
|
||||||
this.width = 50.0,
|
this.width = 50.0,
|
||||||
this.height = 50.0,
|
this.height = 50.0,
|
||||||
this.adaptive = false,
|
this.adaptive = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final HSVColor hsvColor;
|
final HSVColor hsvColor;
|
||||||
final HSVColor? currentHsvColor;
|
final HSVColor? currentHsvColor;
|
||||||
@@ -711,8 +708,8 @@ class ColorPickerArea extends StatelessWidget {
|
|||||||
this.onColorChanged,
|
this.onColorChanged,
|
||||||
this.onChangeEnd,
|
this.onChangeEnd,
|
||||||
this.paletteType, {
|
this.paletteType, {
|
||||||
Key? key,
|
super.key,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final HSVColor hsvColor;
|
final HSVColor hsvColor;
|
||||||
final ValueChanged<HSVColor> onColorChanged;
|
final ValueChanged<HSVColor> onColorChanged;
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
|
|
||||||
|
// ignore: dangling_library_doc_comments
|
||||||
/// Common function lib
|
/// Common function lib
|
||||||
|
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
@@ -10,14 +10,20 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class GradeTile extends StatelessWidget {
|
class GradeTile extends StatelessWidget {
|
||||||
const GradeTile(this.grade,
|
const GradeTile(
|
||||||
{Key? key, this.onTap, this.padding, this.censored = false})
|
this.grade, {
|
||||||
: super(key: key);
|
super.key,
|
||||||
|
this.onTap,
|
||||||
|
this.padding,
|
||||||
|
this.censored = false,
|
||||||
|
this.viewOverride = false,
|
||||||
|
});
|
||||||
|
|
||||||
final Grade grade;
|
final Grade grade;
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
final EdgeInsetsGeometry? padding;
|
final EdgeInsetsGeometry? padding;
|
||||||
final bool censored;
|
final bool censored;
|
||||||
|
final bool viewOverride;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -26,7 +32,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
bool isTitleItalic = false;
|
bool isTitleItalic = false;
|
||||||
bool isSubtitleItalic = false;
|
bool isSubtitleItalic = false;
|
||||||
EdgeInsets leadingPadding = EdgeInsets.zero;
|
EdgeInsets leadingPadding = EdgeInsets.zero;
|
||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView =
|
||||||
|
SubjectGradesContainer.of(context) != null || viewOverride;
|
||||||
String subjectName =
|
String subjectName =
|
||||||
grade.subject.renamedTo ?? grade.subject.name.capital();
|
grade.subject.renamedTo ?? grade.subject.name.capital();
|
||||||
String modeDescription = grade.mode.description.capital();
|
String modeDescription = grade.mode.description.capital();
|
||||||
@@ -34,8 +41,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 +56,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 +69,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 +136,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 +156,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
|
||||||
@@ -184,7 +194,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
class GradeValueWidget extends StatelessWidget {
|
class GradeValueWidget extends StatelessWidget {
|
||||||
const GradeValueWidget(
|
const GradeValueWidget(
|
||||||
this.value, {
|
this.value, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.size = 38.0,
|
this.size = 38.0,
|
||||||
this.fill = false,
|
this.fill = false,
|
||||||
this.contrast = false,
|
this.contrast = false,
|
||||||
@@ -193,7 +203,7 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
this.complemented = false,
|
this.complemented = false,
|
||||||
this.nocolor = false,
|
this.nocolor = false,
|
||||||
this.color,
|
this.color,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final GradeValue value;
|
final GradeValue value;
|
||||||
final double size;
|
final double size;
|
||||||
@@ -210,8 +220,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 +293,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,
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'lesson_tile.i18n.dart';
|
import 'lesson_tile.i18n.dart';
|
||||||
|
|
||||||
class LessonTile extends StatelessWidget {
|
class LessonTile extends StatelessWidget {
|
||||||
const LessonTile(this.lesson, {Key? key, this.onTap, this.swapDesc = false})
|
const LessonTile(this.lesson, {super.key, this.onTap, this.swapDesc = false});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final Lesson lesson;
|
final Lesson lesson;
|
||||||
final bool swapDesc;
|
final bool swapDesc;
|
||||||
@@ -287,8 +286,7 @@ enum LessonSubtileType { homework, exam, absence }
|
|||||||
|
|
||||||
class LessonSubtile extends StatelessWidget {
|
class LessonSubtile extends StatelessWidget {
|
||||||
const LessonSubtile(
|
const LessonSubtile(
|
||||||
{Key? key, this.onPressed, required this.title, required this.type})
|
{super.key, this.onPressed, required this.title, required this.type});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final Function()? onPressed;
|
final Function()? onPressed;
|
||||||
final String title;
|
final String title;
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import 'package:provider/provider.dart';
|
|||||||
class MessageTile extends StatelessWidget {
|
class MessageTile extends StatelessWidget {
|
||||||
const MessageTile(
|
const MessageTile(
|
||||||
this.message, {
|
this.message, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.messages,
|
this.messages,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.censored = false,
|
this.censored = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Message message;
|
final Message message;
|
||||||
final List<Message>? messages;
|
final List<Message>? messages;
|
||||||
|
|||||||
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
@@ -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.1+221
|
version: 4.5.1+238
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.17.0 <3.0.0"
|
||||||
@@ -25,26 +25,27 @@ dependencies:
|
|||||||
|
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
i18n_extension: ^9.0.0
|
i18n_extension: ^10.0.1
|
||||||
sqflite: ^2.2.0+2
|
sqflite: ^2.2.0+2
|
||||||
intl: ^0.18.0
|
intl: ^0.18.0
|
||||||
provider: ^5.0.0
|
provider: ^5.0.0
|
||||||
http: ^0.13.3
|
http: ^0.13.3
|
||||||
uuid: ^3.0.4
|
uuid: ^4.2.1
|
||||||
html: ^0.15.0
|
html: ^0.15.0
|
||||||
open_file:
|
open_filex: ^4.3.4
|
||||||
git:
|
# open_file:
|
||||||
url: https://github.com/crazecoder/open_file
|
# git:
|
||||||
ref: master
|
# url: https://github.com/crazecoder/open_file
|
||||||
|
# ref: master
|
||||||
path_provider: ^2.0.2
|
path_provider: ^2.0.2
|
||||||
permission_handler: ^10.2.0
|
permission_handler: ^11.0.1
|
||||||
share_plus: ^7.0.2
|
share_plus: ^7.0.2
|
||||||
connectivity_plus: ^4.0.1
|
connectivity_plus: ^5.0.2
|
||||||
flutter_displaymode: ^0.6.0
|
flutter_displaymode: ^0.6.0
|
||||||
quick_actions: ^1.0.1
|
quick_actions: ^1.0.1
|
||||||
animated_list_plus: ^0.5.0
|
animated_list_plus: ^0.5.0
|
||||||
dynamic_color: ^1.2.2
|
dynamic_color: ^1.2.2
|
||||||
material_color_utilities: ^0.2.0
|
material_color_utilities: ^0.5.0
|
||||||
crypto: ^3.0.2
|
crypto: ^3.0.2
|
||||||
elegant_notification: ^1.6.1
|
elegant_notification: ^1.6.1
|
||||||
flutter_feather_icons: ^2.0.0+1
|
flutter_feather_icons: ^2.0.0+1
|
||||||
@@ -53,9 +54,9 @@ dependencies:
|
|||||||
lottie: ^1.4.3
|
lottie: ^1.4.3
|
||||||
rive: ^0.9.1
|
rive: ^0.9.1
|
||||||
animated_background: ^2.0.0
|
animated_background: ^2.0.0
|
||||||
dropdown_button2: ^1.8.9
|
dropdown_button2: ^1.9.4
|
||||||
home_widget: ^0.1.6
|
home_widget: ^0.1.6
|
||||||
flutter_expandable_fab: ^1.8.1
|
flutter_expandable_fab: ^2.0.0
|
||||||
uni_links: ^0.5.1
|
uni_links: ^0.5.1
|
||||||
url_launcher: ^6.1.6
|
url_launcher: ^6.1.6
|
||||||
workmanager: ^0.5.1
|
workmanager: ^0.5.1
|
||||||
@@ -63,7 +64,7 @@ dependencies:
|
|||||||
image_picker: ^0.8.6
|
image_picker: ^0.8.6
|
||||||
animations: ^2.0.1
|
animations: ^2.0.1
|
||||||
background_fetch: ^1.1.5
|
background_fetch: ^1.1.5
|
||||||
flutter_local_notifications: ^14.1.0
|
flutter_local_notifications: ^16.2.0
|
||||||
package_info_plus: ^4.0.2
|
package_info_plus: ^4.0.2
|
||||||
screenshot: ^2.1.0
|
screenshot: ^2.1.0
|
||||||
flutter_staggered_grid_view: ^0.7.0
|
flutter_staggered_grid_view: ^0.7.0
|
||||||
@@ -73,7 +74,7 @@ dependencies:
|
|||||||
url: https://github.com/kimaah/image_crop.git
|
url: https://github.com/kimaah/image_crop.git
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^2.0.1
|
flutter_lints: ^3.0.1
|
||||||
flutter_launcher_icons: "^0.13.1"
|
flutter_launcher_icons: "^0.13.1"
|
||||||
flutter_native_splash: "^2.3.0"
|
flutter_native_splash: "^2.3.0"
|
||||||
sqflite_common_ffi: ^2.0.0+3
|
sqflite_common_ffi: ^2.0.0+3
|
||||||
@@ -87,6 +88,7 @@ flutter:
|
|||||||
- assets/animations/
|
- assets/animations/
|
||||||
- assets/images/
|
- assets/images/
|
||||||
- assets/images/subject_covers/
|
- assets/images/subject_covers/
|
||||||
|
- assets/launch_icons/
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
- family: FilcIcons
|
- family: FilcIcons
|
||||||
|
|||||||
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/
|
|
||||||
@@ -31,6 +31,11 @@ bool FlutterWindow::OnCreate() {
|
|||||||
this->Show();
|
this->Show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Flutter can complete the first frame before the "show window" callback is
|
||||||
|
// registered. The following call ensures a frame is pending to ensure the
|
||||||
|
// window is shown. It is a no-op if the first frame hasn't completed yet.
|
||||||
|
flutter_controller_->ForceRedraw();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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
|
|
||||||
@@ -61,14 +61,21 @@ class FilterBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
// avoid fading over selected tab
|
// avoid fading over selected tab
|
||||||
return ShaderMask(
|
return ShaderMask(
|
||||||
shaderCallback: (Rect bounds) {
|
shaderCallback: (Rect bounds) {
|
||||||
final Color bg = Theme.of(context).scaffoldBackgroundColor;
|
final Color bg =
|
||||||
|
Theme.of(context).scaffoldBackgroundColor;
|
||||||
final double index = controller.animation!.value;
|
final double index = controller.animation!.value;
|
||||||
return LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [
|
return LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
index < 0.2 ? Colors.transparent : bg,
|
index < 0.2 ? Colors.transparent : bg,
|
||||||
Colors.transparent,
|
Colors.transparent,
|
||||||
Colors.transparent,
|
Colors.transparent,
|
||||||
index > controller.length - 1.2 ? Colors.transparent : bg
|
index > controller.length - 1.2
|
||||||
], stops: const [
|
? Colors.transparent
|
||||||
|
: bg
|
||||||
|
],
|
||||||
|
stops: const [
|
||||||
0,
|
0,
|
||||||
0.1,
|
0.1,
|
||||||
0.9,
|
0.9,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
||||||
import 'package:filcnaplo/helpers/average_helper.dart';
|
import 'package:filcnaplo/helpers/average_helper.dart';
|
||||||
@@ -32,7 +33,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}) {
|
||||||
@@ -56,13 +57,14 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
// Providers
|
// Providers
|
||||||
late GradeProvider gradeProvider;
|
late GradeProvider gradeProvider;
|
||||||
late GradeCalculatorProvider calculatorProvider;
|
late GradeCalculatorProvider calculatorProvider;
|
||||||
|
late SettingsProvider settingsProvider;
|
||||||
|
|
||||||
late double average;
|
late double average;
|
||||||
late Widget gradeGraph;
|
late Widget gradeGraph;
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
@@ -142,6 +144,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
gradeProvider = Provider.of<GradeProvider>(context);
|
gradeProvider = Provider.of<GradeProvider>(context);
|
||||||
calculatorProvider = Provider.of<GradeCalculatorProvider>(context);
|
calculatorProvider = Provider.of<GradeCalculatorProvider>(context);
|
||||||
|
settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
List<Grade> subjectGrades = getSubjectGrades(widget.subject).toList();
|
List<Grade> subjectGrades = getSubjectGrades(widget.subject).toList();
|
||||||
average = AverageHelper.averageEvals(subjectGrades);
|
average = AverageHelper.averageEvals(subjectGrades);
|
||||||
@@ -244,7 +247,8 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
subject: widget.subject, context: context),
|
subject: widget.subject, context: context),
|
||||||
scrollController: _scrollController,
|
scrollController: _scrollController,
|
||||||
title: widget.subject.renamedTo ?? widget.subject.name.capital(),
|
title: widget.subject.renamedTo ?? widget.subject.name.capital(),
|
||||||
italic: widget.subject.isRenamed,
|
italic: widget.subject.isRenamed &&
|
||||||
|
settingsProvider.renamedSubjectsItalics,
|
||||||
child: SubjectGradesContainer(
|
child: SubjectGradesContainer(
|
||||||
child: CupertinoScrollbar(
|
child: CupertinoScrollbar(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import 'package:filcnaplo_desktop_ui/pages/grades/grade_subject_view.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:filcnaplo/helpers/average_helper.dart';
|
import 'package:filcnaplo/helpers/average_helper.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/grades/average_selector.dart';
|
import 'package:filcnaplo_mobile_ui/pages/grades/average_selector.dart';
|
||||||
import 'grades_page.i18n.dart';
|
import 'grades_page.i18n.dart';
|
||||||
|
|
||||||
class GradesPage extends StatefulWidget {
|
class GradesPage extends StatefulWidget {
|
||||||
@@ -41,24 +41,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
|
||||||
|
.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
||||||
.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);
|
||||||
@@ -145,6 +146,7 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
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,
|
||||||
@@ -208,7 +210,7 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
title: Row(
|
title: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
PremiumAverageSelector(
|
AverageSelector(
|
||||||
value: avgDropValue,
|
value: avgDropValue,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
@@ -5,15 +5,25 @@ import 'package:elegant_notification/elegant_notification.dart';
|
|||||||
import 'package:elegant_notification/resources/arrays.dart';
|
import 'package:elegant_notification/resources/arrays.dart';
|
||||||
import 'package:filcnaplo/api/client.dart';
|
import 'package:filcnaplo/api/client.dart';
|
||||||
import 'package:filcnaplo/api/login.dart';
|
import 'package:filcnaplo/api/login.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.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';
|
||||||
import 'login_screen.i18n.dart';
|
import 'login_screen.i18n.dart';
|
||||||
|
|
||||||
|
const LinearGradient _backgroundGradient = LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color.fromARGB(255, 61, 122, 244),
|
||||||
|
Color.fromARGB(255, 23, 77, 185),
|
||||||
|
Color.fromARGB(255, 7, 42, 112),
|
||||||
|
],
|
||||||
|
begin: Alignment(-0.8, -2.0),
|
||||||
|
end: Alignment(0.8, 1.0),
|
||||||
|
stops: [-1.0, 0.0, 1.0],
|
||||||
|
);
|
||||||
|
|
||||||
class LoginScreen extends StatefulWidget {
|
class LoginScreen extends StatefulWidget {
|
||||||
const LoginScreen({Key? key, this.back = false}) : super(key: key);
|
const LoginScreen({Key? key, this.back = false}) : super(key: key);
|
||||||
|
|
||||||
@@ -70,14 +80,20 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Platform.isMacOS) Window.getTitlebarHeight().then((value) => setState(() => topInset = value));
|
if (Platform.isMacOS) {
|
||||||
|
Window.getTitlebarHeight()
|
||||||
|
.then((value) => setState(() => topInset = value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.of(context).filc,
|
body: Container(
|
||||||
body: SafeArea(
|
decoration: const BoxDecoration(
|
||||||
|
gradient: _backgroundGradient,
|
||||||
|
),
|
||||||
|
child: SafeArea(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
@@ -91,20 +107,27 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
padding: const EdgeInsets.only(bottom: 24.0),
|
padding: const EdgeInsets.only(bottom: 24.0),
|
||||||
child: ClipRect(
|
child: ClipRect(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 32.0),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 12.0, right: 12.0, bottom: 32.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 82.0,
|
width: 100.0,
|
||||||
height: 82.0,
|
height: 100.0,
|
||||||
// Png shadow *hack*
|
// Png shadow *hack*
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: Opacity(child: Image.asset("assets/icons/ic_splash.png", color: Colors.black), opacity: 0.3),
|
child: Opacity(
|
||||||
|
child: Image.asset(
|
||||||
|
"assets/icons/ic_splash.png",
|
||||||
|
color: Colors.black),
|
||||||
|
opacity: 0.3),
|
||||||
),
|
),
|
||||||
BackdropFilter(
|
BackdropFilter(
|
||||||
filter: ImageFilter.blur(sigmaX: 6.0, sigmaY: 6.0),
|
filter: ImageFilter.blur(
|
||||||
child: Image.asset("assets/icons/ic_splash.png"),
|
sigmaX: 6.0, sigmaY: 6.0),
|
||||||
|
child: Image.asset(
|
||||||
|
"assets/icons/ic_splash.png"),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -124,7 +147,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 6.0),
|
padding: const EdgeInsets.only(bottom: 6.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -164,7 +188,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 6.0),
|
padding: const EdgeInsets.only(bottom: 6.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -242,19 +267,29 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
padding: EdgeInsets.symmetric(vertical: 6.0),
|
padding: EdgeInsets.symmetric(vertical: 6.0),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
|
Colors.white),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_loginState == LoginState.missingFields || _loginState == LoginState.invalidGrant || _loginState == LoginState.failed)
|
if (_loginState == LoginState.missingFields ||
|
||||||
|
_loginState == LoginState.invalidGrant ||
|
||||||
|
_loginState == LoginState.failed)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
["missing_fields", "invalid_grant", "error"][_loginState.index].i18n,
|
[
|
||||||
style: const TextStyle(color: Colors.red, fontWeight: FontWeight.w500),
|
"missing_fields",
|
||||||
|
"invalid_grant",
|
||||||
|
"error"
|
||||||
|
][_loginState.index]
|
||||||
|
.i18n,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.red,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -276,6 +311,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +319,11 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
String username = usernameController.text;
|
String username = usernameController.text;
|
||||||
String password = passwordController.text;
|
String password = passwordController.text;
|
||||||
|
|
||||||
if (username == "" || password == "" || schoolController.selectedSchool == null) {
|
if (username == "" ||
|
||||||
|
password ==
|
||||||
|
"" ||
|
||||||
|
schoolController.selectedSchool == null
|
||||||
|
) {
|
||||||
return setState(() => _loginState = LoginState.missingFields);
|
return setState(() => _loginState = LoginState.missingFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +353,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
).show(context);
|
).show(context);
|
||||||
},
|
},
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
Navigator.of(context).pushNamedAndRemoveUntil("login_to_navigation", (_) => false);
|
Navigator.of(context)
|
||||||
|
.pushNamedAndRemoveUntil("login_to_navigation", (_) => false);
|
||||||
}).then((res) => setState(() => _loginState = res));
|
}).then((res) => setState(() => _loginState = res));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class _SidebarState extends State<Sidebar> {
|
|||||||
Provider.of<ExamProvider>(context, listen: false).restore(),
|
Provider.of<ExamProvider>(context, listen: false).restore(),
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
||||||
Provider.of<MessageProvider>(context, listen: false).restore(),
|
Provider.of<MessageProvider>(context, listen: false).restore(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false)
|
||||||
|
.restoreRecipients(),
|
||||||
Provider.of<NoteProvider>(context, listen: false).restore(),
|
Provider.of<NoteProvider>(context, listen: false).restore(),
|
||||||
Provider.of<EventProvider>(context, listen: false).restore(),
|
Provider.of<EventProvider>(context, listen: false).restore(),
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
||||||
@@ -176,13 +178,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));
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'settings_screen.i18n.dart';
|
import 'settings_screen.i18n.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/nickname.dart';
|
import 'package:filcnaplo_mobile_ui/screens/settings/user/nickname.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/icon_pack.dart';
|
|
||||||
|
|
||||||
class SettingsScreen extends StatefulWidget {
|
class SettingsScreen extends StatefulWidget {
|
||||||
const SettingsScreen({Key? key}) : super(key: key);
|
const SettingsScreen({Key? key}) : super(key: key);
|
||||||
@@ -68,6 +67,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
Provider.of<ExamProvider>(context, listen: false).restore(),
|
Provider.of<ExamProvider>(context, listen: false).restore(),
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
||||||
Provider.of<MessageProvider>(context, listen: false).restore(),
|
Provider.of<MessageProvider>(context, listen: false).restore(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false)
|
||||||
|
.restoreRecipients(),
|
||||||
Provider.of<NoteProvider>(context, listen: false).restore(),
|
Provider.of<NoteProvider>(context, listen: false).restore(),
|
||||||
Provider.of<EventProvider>(context, listen: false).restore(),
|
Provider.of<EventProvider>(context, listen: false).restore(),
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
||||||
@@ -400,9 +401,9 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
if (v) {
|
if (v) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) => PopScope(
|
||||||
WillPopScope(
|
onPopInvoked: (didPop) =>
|
||||||
onWillPop: () async => false,
|
false,
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
shape:
|
shape:
|
||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
@@ -586,7 +587,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
.secondary,
|
.secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const PremiumIconPackSelector(),
|
// we need icon pack selector here
|
||||||
|
// const PremiumIconPackSelector(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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
@@ -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";
|
||||||
|
|
||||||
@@ -20,18 +21,14 @@ class KretaAPI {
|
|||||||
static String groups(String iss) =>
|
static String groups(String iss) =>
|
||||||
BaseKreta.kreta(iss) + KretaApiEndpoints.groups;
|
BaseKreta.kreta(iss) + KretaApiEndpoints.groups;
|
||||||
static String groupAverages(String iss, String uid) =>
|
static String groupAverages(String iss, String uid) =>
|
||||||
BaseKreta.kreta(iss) +
|
"${BaseKreta.kreta(iss)}${KretaApiEndpoints.groupAverages}?oktatasiNevelesiFeladatUid=$uid";
|
||||||
KretaApiEndpoints.groupAverages +
|
static String averages(String iss, String uid) =>
|
||||||
"?oktatasiNevelesiFeladatUid=" +
|
"${BaseKreta.kreta(iss)}${KretaApiEndpoints.averages}?oktatasiNevelesiFeladatUid=$uid";
|
||||||
uid;
|
|
||||||
static String timetable(String iss, {DateTime? start, DateTime? end}) =>
|
static String timetable(String iss, {DateTime? start, DateTime? end}) =>
|
||||||
BaseKreta.kreta(iss) +
|
BaseKreta.kreta(iss) +
|
||||||
KretaApiEndpoints.timetable +
|
KretaApiEndpoints.timetable +
|
||||||
(start != null && end != null
|
(start != null && end != null
|
||||||
? "?datumTol=" +
|
? "?datumTol=${start.toUtc().toIso8601String()}&datumIg=${end.toUtc().toIso8601String()}"
|
||||||
start.toUtc().toIso8601String() +
|
|
||||||
"&datumIg=" +
|
|
||||||
end.toUtc().toIso8601String()
|
|
||||||
: "");
|
: "");
|
||||||
static String exams(String iss) =>
|
static String exams(String iss) =>
|
||||||
BaseKreta.kreta(iss) + KretaApiEndpoints.exams;
|
BaseKreta.kreta(iss) + KretaApiEndpoints.exams;
|
||||||
@@ -40,7 +37,7 @@ class KretaAPI {
|
|||||||
KretaApiEndpoints.homework +
|
KretaApiEndpoints.homework +
|
||||||
(id != null ? "/$id" : "") +
|
(id != null ? "/$id" : "") +
|
||||||
(id == null && start != null
|
(id == null && start != null
|
||||||
? "?datumTol=" + DateFormat('yyyy-MM-dd').format(start)
|
? "?datumTol=${DateFormat('yyyy-MM-dd').format(start)}"
|
||||||
: "");
|
: "");
|
||||||
static String capabilities(String iss) =>
|
static String capabilities(String iss) =>
|
||||||
BaseKreta.kreta(iss) + KretaApiEndpoints.capabilities;
|
BaseKreta.kreta(iss) + KretaApiEndpoints.capabilities;
|
||||||
@@ -48,6 +45,28 @@ 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 =
|
||||||
@@ -60,8 +79,10 @@ class KretaAPI {
|
|||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientCategories;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientCategories;
|
||||||
static const availableCategories =
|
static const availableCategories =
|
||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.availableCategories;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.availableCategories;
|
||||||
static const recipientsTeacher =
|
static const recipientTeachers =
|
||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientsTeacher;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientTeachers;
|
||||||
|
static const recipientDirectorate =
|
||||||
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientDirectorate;
|
||||||
static const uploadAttachment =
|
static const uploadAttachment =
|
||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.uploadAttachment;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.uploadAttachment;
|
||||||
static String downloadAttachment(String id) =>
|
static String downloadAttachment(String id) =>
|
||||||
@@ -81,6 +102,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";
|
||||||
@@ -90,6 +112,7 @@ class KretaApiEndpoints {
|
|||||||
static const groups = "/ellenorzo/V3/Sajat/OsztalyCsoportok";
|
static const groups = "/ellenorzo/V3/Sajat/OsztalyCsoportok";
|
||||||
static const groupAverages =
|
static const groupAverages =
|
||||||
"/ellenorzo/V3/Sajat/Ertekelesek/Atlagok/OsztalyAtlagok";
|
"/ellenorzo/V3/Sajat/Ertekelesek/Atlagok/OsztalyAtlagok";
|
||||||
|
static const averages = "/ellenorzo/V3/idk";
|
||||||
static const timetable = "/ellenorzo/V3/Sajat/OrarendElemek";
|
static const timetable = "/ellenorzo/V3/Sajat/OrarendElemek";
|
||||||
static const exams = "/ellenorzo/V3/Sajat/BejelentettSzamonkeresek";
|
static const exams = "/ellenorzo/V3/Sajat/BejelentettSzamonkeresek";
|
||||||
static const homework = "/ellenorzo/V3/Sajat/HaziFeladatok";
|
static const homework = "/ellenorzo/V3/Sajat/HaziFeladatok";
|
||||||
@@ -97,6 +120,8 @@ 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 {
|
||||||
@@ -108,7 +133,8 @@ class KretaAdminEndpoints {
|
|||||||
"/api/v1/kommunikacio/postaladaelemek/$id";
|
"/api/v1/kommunikacio/postaladaelemek/$id";
|
||||||
static const recipientCategories = "/api/v1/adatszotarak/cimzetttipusok";
|
static const recipientCategories = "/api/v1/adatszotarak/cimzetttipusok";
|
||||||
static const availableCategories = "/api/v1/kommunikacio/cimezhetotipusok";
|
static const availableCategories = "/api/v1/kommunikacio/cimezhetotipusok";
|
||||||
static const recipientsTeacher = "/api/v1/kreta/alkalmazottak/tanar";
|
static const recipientTeachers = "/api/v1/kreta/alkalmazottak/tanar";
|
||||||
|
static const recipientDirectorate = "/api/v1/kreta/alkalmazottak/igazgatosag";
|
||||||
static const uploadAttachment = "/ideiglenesfajlok";
|
static const uploadAttachment = "/ideiglenesfajlok";
|
||||||
static String downloadAttachment(String id) =>
|
static String downloadAttachment(String id) =>
|
||||||
"/api/v1/dokumentumok/uzenetek/$id";
|
"/api/v1/dokumentumok/uzenetek/$id";
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -89,6 +91,9 @@ class KretaClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res == null) throw "Login error";
|
if (res == null) throw "Login error";
|
||||||
|
if (res.body == 'invalid_grant' || res.body.replaceAll(' ', '') == '') {
|
||||||
|
throw "Auth error";
|
||||||
|
}
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
return jsonDecode(res.body);
|
return jsonDecode(res.body);
|
||||||
@@ -134,6 +139,9 @@ class KretaClient {
|
|||||||
if (!headerMap.containsKey("content-type")) {
|
if (!headerMap.containsKey("content-type")) {
|
||||||
headerMap["content-type"] = "application/json";
|
headerMap["content-type"] = "application/json";
|
||||||
}
|
}
|
||||||
|
if (url.contains('kommunikacio/uzenetek')) {
|
||||||
|
headerMap["X-Uzenet-Lokalizacio"] = "hu-HU";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = await client.post(Uri.parse(url), headers: headerMap, body: body);
|
res = await client.post(Uri.parse(url), headers: headerMap, body: body);
|
||||||
@@ -148,6 +156,7 @@ class KretaClient {
|
|||||||
if (res == null) throw "Login error";
|
if (res == null) throw "Login error";
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
|
print(jsonDecode(res.body));
|
||||||
return jsonDecode(res.body);
|
return jsonDecode(res.body);
|
||||||
} else {
|
} else {
|
||||||
return res.body;
|
return res.body;
|
||||||
@@ -160,7 +169,73 @@ class KretaClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> sendFilesAPI(
|
||||||
|
String url, {
|
||||||
|
Map<String, String>? headers,
|
||||||
|
bool autoHeader = true,
|
||||||
|
Map<String, String>? body,
|
||||||
|
}) async {
|
||||||
|
Map<String, String> headerMap;
|
||||||
|
|
||||||
|
if (headers != null) {
|
||||||
|
headerMap = headers;
|
||||||
|
} else {
|
||||||
|
headerMap = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
http.StreamedResponse? res;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
if (autoHeader) {
|
||||||
|
if (!headerMap.containsKey("authorization") && accessToken != null) {
|
||||||
|
headerMap["authorization"] = "Bearer $accessToken";
|
||||||
|
}
|
||||||
|
if (!headerMap.containsKey("user-agent") && userAgent != null) {
|
||||||
|
headerMap["user-agent"] = "$userAgent";
|
||||||
|
}
|
||||||
|
if (!headerMap.containsKey("content-type")) {
|
||||||
|
headerMap["content-type"] = "multipart/form-data";
|
||||||
|
}
|
||||||
|
if (url.contains('kommunikacio/uzenetek')) {
|
||||||
|
headerMap["X-Uzenet-Lokalizacio"] = "hu-HU";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var request = http.MultipartRequest("POST", Uri.parse(url));
|
||||||
|
|
||||||
|
// request.files.add(value)
|
||||||
|
|
||||||
|
request.fields.addAll(body ?? {});
|
||||||
|
request.headers.addAll(headers ?? {});
|
||||||
|
|
||||||
|
res = await request.send();
|
||||||
|
|
||||||
|
if (res.statusCode == 401) {
|
||||||
|
await refreshLogin();
|
||||||
|
headerMap.remove("authorization");
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res == null) throw "Login error";
|
||||||
|
|
||||||
|
print(res.statusCode);
|
||||||
|
|
||||||
|
return res.statusCode;
|
||||||
|
} on http.ClientException catch (error) {
|
||||||
|
print(
|
||||||
|
"ERROR: KretaClient.postAPI ($url) ClientException: ${error.message}");
|
||||||
|
} catch (error) {
|
||||||
|
print("ERROR: KretaClient.postAPI ($url) ${error.runtimeType}: $error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
@@ -179,13 +254,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(
|
||||||
|
KretaAPI.login,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: User.loginBody(
|
body: User.loginBody(
|
||||||
username: loginUser.username,
|
username: loginUser.username,
|
||||||
password: loginUser.password,
|
password: loginUser.password,
|
||||||
instituteCode: loginUser.instituteCode,
|
instituteCode: loginUser.instituteCode,
|
||||||
));
|
),
|
||||||
|
);
|
||||||
|
|
||||||
if (loginRes != null) {
|
if (loginRes != null) {
|
||||||
if (loginRes.containsKey("access_token")) {
|
if (loginRes.containsKey("access_token")) {
|
||||||
@@ -212,5 +289,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,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// ignore_for_file: avoid_print
|
// ignore_for_file: avoid_print, use_build_context_synchronously
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
@@ -154,9 +154,9 @@ class TimetableController extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < days.length; i++) {
|
for (int i = 0; i < days.length; i++) {
|
||||||
List<Lesson> _day = List.castFrom(days[i]);
|
List<Lesson> day0 = List.castFrom(days[i]);
|
||||||
|
|
||||||
List<int> lessonIndexes = _getIndexes(_day);
|
List<int> lessonIndexes = _getIndexes(day0);
|
||||||
int minIndex = 0, maxIndex = 0;
|
int minIndex = 0, maxIndex = 0;
|
||||||
|
|
||||||
if (lessonIndexes.isNotEmpty) {
|
if (lessonIndexes.isNotEmpty) {
|
||||||
@@ -170,7 +170,7 @@ class TimetableController extends ChangeNotifier {
|
|||||||
// Fill missing indexes with empty spaces
|
// Fill missing indexes with empty spaces
|
||||||
for (var i in List<int>.generate(
|
for (var i in List<int>.generate(
|
||||||
maxIndex - minIndex + 1, (int i) => minIndex + i)) {
|
maxIndex - minIndex + 1, (int i) => minIndex + i)) {
|
||||||
List<Lesson> indexLessons = _getLessonsByIndex(_day, i);
|
List<Lesson> indexLessons = _getLessonsByIndex(day0, i);
|
||||||
|
|
||||||
// Empty lesson
|
// Empty lesson
|
||||||
if (indexLessons.isEmpty) {
|
if (indexLessons.isEmpty) {
|
||||||
@@ -193,13 +193,13 @@ class TimetableController extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Additional lessons
|
// Additional lessons
|
||||||
day.addAll(_day.where((l) =>
|
day.addAll(day0.where((l) =>
|
||||||
int.tryParse(l.lessonIndex) == null && l.subject.id != ''));
|
int.tryParse(l.lessonIndex) == null && l.subject.id != ''));
|
||||||
|
|
||||||
day.sort((a, b) => a.start.compareTo(b.start));
|
day.sort((a, b) => a.start.compareTo(b.start));
|
||||||
|
|
||||||
// Special Dates
|
// Special Dates
|
||||||
for (var l in _day) {
|
for (var l in day0) {
|
||||||
l.subject.id == '' ? day.insert(0, l) : null;
|
l.subject.id == '' ? day.insert(0, l) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
||||||
|
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'category.dart';
|
import 'category.dart';
|
||||||
import 'subject.dart';
|
import 'subject.dart';
|
||||||
@@ -12,7 +14,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 +59,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"] ?? ""
|
||||||
: "",
|
: "",
|
||||||
|
|||||||