Compare commits
989 Commits
Author | SHA1 | Date | |
---|---|---|---|
007e4404c1 | |||
![]() |
4bc578ef06 | ||
8a3002ade1 | |||
ca06073f37 | |||
52dd14d10b | |||
dd787effbc | |||
![]() |
7eac57b94d | ||
![]() |
ee0ba71c8f | ||
![]() |
ab64faeadb | ||
![]() |
1460f2aa4e | ||
![]() |
8925b3a5f8 | ||
eb0308cbed | |||
c90e01737c | |||
05c406657a | |||
fc402eef16 | |||
![]() |
e9cfc7bbfc | ||
![]() |
7e711d64e8 | ||
![]() |
80008d8f00 | ||
81267d54e3 | |||
![]() |
0dc921c603 | ||
![]() |
4e23b745f3 | ||
![]() |
ce91b47ad1 | ||
![]() |
250ed2f105 | ||
![]() |
4cde28cd72 | ||
![]() |
df63c258b3 | ||
![]() |
1b6992132e | ||
![]() |
55350b0e5d | ||
![]() |
8d532a442d | ||
![]() |
cc4091e165 | ||
![]() |
1f05f1d091 | ||
![]() |
cc04293ead | ||
e1cae2f698 | |||
84a3e46ff7 | |||
a9360c6dc8 | |||
5d9c975b98 | |||
0b47155862 | |||
8662775e21 | |||
![]() |
2ac948539c | ||
b93ea7193d | |||
b6b5c71cef | |||
![]() |
0cf62aea86 | ||
![]() |
f2f3366e2c | ||
4b7845c31e | |||
08519ebf27 | |||
![]() |
894b3ac5b5 | ||
![]() |
4135503a30 | ||
![]() |
7f9bd34a82 | ||
![]() |
64dfe4a814 | ||
![]() |
6568e3c588 | ||
![]() |
1109c08cf5 | ||
![]() |
9cfbcc932b | ||
![]() |
843224f348 | ||
![]() |
b5ee1afe05 | ||
![]() |
67649cc5fd | ||
![]() |
ee0e724b8a | ||
![]() |
d6e783f375 | ||
![]() |
1e89359333 | ||
![]() |
24f8804f60 | ||
![]() |
300b951014 | ||
![]() |
8b49007cca | ||
![]() |
4101dc7c17 | ||
![]() |
939cc6bbe2 | ||
![]() |
13e00f8462 | ||
![]() |
7d89ea0f5d | ||
![]() |
fe4d7b318e | ||
![]() |
0464624648 | ||
![]() |
d09f3772a3 | ||
![]() |
a7ff9e7825 | ||
![]() |
bc3f8cfff9 | ||
![]() |
063cc99d1a | ||
![]() |
739e75160d | ||
![]() |
889d0d6057 | ||
![]() |
f5a7820991 | ||
![]() |
580f93fa6f | ||
![]() |
654c12e9fb | ||
![]() |
7ab14756a6 | ||
![]() |
0a02d4e831 | ||
![]() |
ac3429f30f | ||
![]() |
6388650c77 | ||
![]() |
728534170c | ||
![]() |
f4d840462e | ||
![]() |
b08b127895 | ||
![]() |
d41872e6e2 | ||
![]() |
0602c2ea3f | ||
![]() |
afcff10862 | ||
![]() |
9e187fc04c | ||
![]() |
7d5b97fe00 | ||
![]() |
fd3b21b8e6 | ||
![]() |
071f682f77 | ||
![]() |
8723f75889 | ||
![]() |
c9666f5333 | ||
![]() |
a218b62742 | ||
![]() |
41b1d899d0 | ||
![]() |
ad18efd340 | ||
![]() |
cf0dc50df5 | ||
![]() |
994d3085bb | ||
![]() |
6292708ba0 | ||
![]() |
a26ca67892 | ||
![]() |
f2d6b6079e | ||
![]() |
4faee05823 | ||
![]() |
864701fd1e | ||
![]() |
80d50cd82b | ||
![]() |
521f609707 | ||
![]() |
96ff70d7d5 | ||
![]() |
658bfe38a3 | ||
![]() |
a74b2cd3d7 | ||
![]() |
414755c777 | ||
![]() |
3708b917c4 | ||
![]() |
986b13de68 | ||
![]() |
d391448870 | ||
![]() |
38d9b5f3b2 | ||
![]() |
2dafe5ed02 | ||
![]() |
939761695f | ||
![]() |
f1ba5230fc | ||
![]() |
a50f449f7c | ||
![]() |
fe3ed31830 | ||
![]() |
0ec33f8631 | ||
![]() |
6634010b97 | ||
![]() |
816ddf58a2 | ||
![]() |
d7741ca1c4 | ||
![]() |
a2cbe5d90b | ||
![]() |
7919d0e284 | ||
![]() |
92fe3b7dcd | ||
![]() |
63fd37c31f | ||
![]() |
aa10f0672e | ||
![]() |
a3694b59ec | ||
![]() |
9ecee0bb01 | ||
![]() |
b9e9bef182 | ||
51297ddc09 | |||
4d64705e59 | |||
![]() |
d642f19834 | ||
![]() |
51b25395c1 | ||
![]() |
4474562538 | ||
d93dce7857 | |||
d6fe2812c7 | |||
ed0f69d155 | |||
c4a17633f8 | |||
d426d4866a | |||
89adf5a26f | |||
117ee63b18 | |||
d27b5f8a51 | |||
![]() |
9671c250b9 | ||
2d5c270641 | |||
eda093a9b5 | |||
![]() |
544e9c214a | ||
![]() |
5c3dbcbd52 | ||
![]() |
cd5f86db00 | ||
![]() |
9adfe636d6 | ||
210e8ce0d4 | |||
b1a7deca4a | |||
fa96770c9c | |||
5be67693c2 | |||
9ee5e8a35e | |||
3372c1ffde | |||
94989687fa | |||
![]() |
52b9b4f5db | ||
![]() |
75a2fa3726 | ||
![]() |
2c1bde9398 | ||
![]() |
fd9794f3bf | ||
![]() |
a673d3f1b3 | ||
![]() |
f2c8e869b5 | ||
![]() |
b4f2d38e99 | ||
![]() |
d842b2d588 | ||
f4fd9a3c2f | |||
a215bd7313 | |||
3211279a53 | |||
2d4e281682 | |||
148f945f3b | |||
![]() |
aaa783ac45 | ||
![]() |
d70f92d4e5 | ||
![]() |
0f08400d63 | ||
![]() |
140a8f8e78 | ||
17c9d1c447 | |||
d8e23d8fa9 | |||
c4491eb0c6 | |||
4945468e02 | |||
![]() |
9845ae9539 | ||
![]() |
3a2fc67cb2 | ||
![]() |
148a43663c | ||
![]() |
4a45131359 | ||
![]() |
4128018a59 | ||
![]() |
0d509c90b1 | ||
![]() |
3ef58974c9 | ||
![]() |
df75fadfea | ||
![]() |
4254a7998a | ||
![]() |
17faa545e5 | ||
![]() |
506fb82dd0 | ||
![]() |
bc8eb1910e | ||
![]() |
fd1b15df77 | ||
![]() |
dd86c7436a | ||
![]() |
8860a0269c | ||
![]() |
ce02dda46c | ||
![]() |
f16a52d0fb | ||
![]() |
cc8ce40222 | ||
![]() |
b6a933fe85 | ||
![]() |
767eba3776 | ||
![]() |
320499a466 | ||
![]() |
52c2f3090d | ||
![]() |
d4df0170a3 | ||
![]() |
796b35e27c | ||
![]() |
051cdc895e | ||
![]() |
e23bdac995 | ||
![]() |
de0e8e1317 | ||
![]() |
b5b0046ef5 | ||
![]() |
92f16e054d | ||
![]() |
9470c848bf | ||
![]() |
c40026e594 | ||
![]() |
93eaa5a74b | ||
![]() |
5503b41be3 | ||
![]() |
bd716e1717 | ||
![]() |
7f8b716712 | ||
![]() |
1a7b59f2fc | ||
![]() |
9f62e44b52 | ||
![]() |
7c34552aa5 | ||
![]() |
57d784443a | ||
![]() |
e73ee5a1f2 | ||
![]() |
4277f0662a | ||
![]() |
604e9dcaad | ||
![]() |
c0dd84c665 | ||
7dc33d3b87 | |||
9bee0daeb5 | |||
![]() |
dd8a4430a9 | ||
47934620ea | |||
9e815aff2f | |||
d8393b24e1 | |||
1abe990847 | |||
3a92716019 | |||
9b947256c8 | |||
0586da3742 | |||
9d863e1ec0 | |||
![]() |
e080800aa8 | ||
e6f7728e42 | |||
ac11da1744 | |||
cad7bd19dc | |||
e1870b08e5 | |||
![]() |
7842aa447f | ||
![]() |
a23b2d63e5 | ||
![]() |
58faeb4fa2 | ||
![]() |
48e64d7761 | ||
![]() |
aef8f78d16 | ||
![]() |
2b36528327 | ||
![]() |
918252ae4b | ||
![]() |
63c650b68d | ||
![]() |
090b0ccc85 | ||
![]() |
0768dc9404 | ||
![]() |
d36351d76b | ||
![]() |
45a8e0dd71 | ||
![]() |
94da2a9756 | ||
![]() |
37aa1858a8 | ||
![]() |
82f8a489dd | ||
![]() |
96b69b89ae | ||
![]() |
d9da7625ed | ||
![]() |
c016258fb9 | ||
![]() |
855e48aea8 | ||
![]() |
b7e83d10dc | ||
![]() |
45ffdff324 | ||
![]() |
cd0729fa5e | ||
![]() |
30cfdfe784 | ||
16f2593d22 | |||
14ab0c4ce3 | |||
9eb1317143 | |||
910a38650d | |||
a1f166980d | |||
0598b94ab9 | |||
1310ad4f2e | |||
![]() |
4d32500d90 | ||
![]() |
67558b76a3 | ||
![]() |
7ab8914076 | ||
![]() |
b0eb819afa | ||
![]() |
416f42f42d | ||
![]() |
a319b26d82 | ||
![]() |
84537fdcef | ||
![]() |
30f24d5d33 | ||
![]() |
8c118eedc1 | ||
![]() |
4dbe3d07a3 | ||
![]() |
f1b1b23234 | ||
![]() |
540e4d2812 | ||
![]() |
93dd275969 | ||
![]() |
c79c45705d | ||
![]() |
ce31182a5c | ||
![]() |
174046f954 | ||
![]() |
3fc14ffbb8 | ||
![]() |
f579270886 | ||
![]() |
365bd7957e | ||
![]() |
d24c4ec187 | ||
![]() |
75ba5405bb | ||
![]() |
e0bf8ac5e5 | ||
![]() |
1a3d78a5bc | ||
![]() |
c205bc592c | ||
![]() |
308c8f966f | ||
![]() |
139ac28be6 | ||
![]() |
bbe53b8c01 | ||
![]() |
56a0c2c02e | ||
![]() |
122a5ea210 | ||
![]() |
aaa3d79b30 | ||
![]() |
cacf566794 | ||
![]() |
9b29ede6eb | ||
![]() |
9e9e46d0f8 | ||
![]() |
9901251cfc | ||
![]() |
e7ec93132d | ||
![]() |
7cec2ff525 | ||
![]() |
2ca8f4b8fe | ||
![]() |
ae66a462e7 | ||
![]() |
c85f15eb49 | ||
![]() |
e04cc5ea2b | ||
![]() |
3ed456c01f | ||
![]() |
f64b1360d9 | ||
![]() |
c9db496e59 | ||
![]() |
d915200faa | ||
![]() |
32abfe7037 | ||
![]() |
3db67b2288 | ||
![]() |
7488c9abdd | ||
![]() |
49ebb8b1c3 | ||
![]() |
55befca3aa | ||
![]() |
0cc3aa07ad | ||
![]() |
0a1c5bbfd2 | ||
![]() |
a17600c4ea | ||
![]() |
6d0315e4e6 | ||
![]() |
25a72da3a8 | ||
![]() |
6d8d11cd87 | ||
![]() |
3b1e345f14 | ||
![]() |
6b8708e1e3 | ||
![]() |
7edde06c11 | ||
![]() |
6803ac8642 | ||
![]() |
6b99edca94 | ||
![]() |
24384e7488 | ||
![]() |
14df196f34 | ||
![]() |
597c50bbf6 | ||
![]() |
96ed4d0b46 | ||
![]() |
39eb435817 | ||
![]() |
587c16fb1f | ||
![]() |
c4e7ebc020 | ||
![]() |
816b14e735 | ||
![]() |
56c87b146b | ||
![]() |
2e14d52c25 | ||
![]() |
d217265ae7 | ||
![]() |
5f27432518 | ||
![]() |
5f6ad03335 | ||
![]() |
8f05dc4ed4 | ||
![]() |
0b96cd9080 | ||
![]() |
f346d9b8ef | ||
![]() |
d5f583a0d2 | ||
![]() |
4abd16ab76 | ||
![]() |
ae17e9f8b7 | ||
![]() |
b9b43fe961 | ||
![]() |
a4b04798f2 | ||
![]() |
703c5f8691 | ||
![]() |
93d56fec28 | ||
![]() |
b7b3a37b52 | ||
![]() |
b6fbfd5756 | ||
![]() |
ca544082ba | ||
![]() |
bd30a77fc2 | ||
![]() |
65fbfb3dca | ||
![]() |
ab56de53eb | ||
![]() |
30a9a23b86 | ||
![]() |
6ba105f08c | ||
![]() |
d84a9892c8 | ||
![]() |
d0599bed7d | ||
![]() |
ca177ad69f | ||
![]() |
05ded4da52 | ||
![]() |
3cbfee7220 | ||
![]() |
ee0c2d708c | ||
![]() |
8115d89bf5 | ||
![]() |
78e6408962 | ||
![]() |
bc61b61ae1 | ||
![]() |
d746ebc143 | ||
![]() |
f2be0ee6d4 | ||
![]() |
156466235d | ||
![]() |
677303fa2c | ||
![]() |
1b95afdfc2 | ||
![]() |
57a4c65d2c | ||
![]() |
3868e70b23 | ||
![]() |
d204af42db | ||
![]() |
89604a8b4f | ||
![]() |
cdde5c11ee | ||
![]() |
10d1d1e0a0 | ||
![]() |
96b84e2ddd | ||
![]() |
3e20977195 | ||
![]() |
cad186e00a | ||
![]() |
e1c409c621 | ||
![]() |
8224976202 | ||
![]() |
9f26845cda | ||
![]() |
a08c9b221b | ||
![]() |
df2de39109 | ||
![]() |
1058608034 | ||
![]() |
95cad1ed70 | ||
![]() |
ee0613d720 | ||
![]() |
25a92f3714 | ||
![]() |
91cd263112 | ||
![]() |
58065575bf | ||
![]() |
71f8970300 | ||
![]() |
28ce83765a | ||
![]() |
fe2215d7b7 | ||
![]() |
236c34dbe6 | ||
![]() |
02af238c1b | ||
![]() |
d3cd22ec7c | ||
![]() |
7ac8c55b17 | ||
![]() |
d740dea1f7 | ||
![]() |
cb4c551c47 | ||
![]() |
c0589cba5c | ||
![]() |
f0b9dfa1e6 | ||
![]() |
8d90e81de7 | ||
![]() |
ef8d216eff | ||
![]() |
e33728a071 | ||
![]() |
1388ba58c1 | ||
![]() |
73db67c4e3 | ||
![]() |
697ed43e5a | ||
![]() |
38ee2d30f5 | ||
![]() |
a35c608a4c | ||
![]() |
3f537976e9 | ||
![]() |
90debfa60c | ||
![]() |
51d8ef7707 | ||
![]() |
3f782e762a | ||
![]() |
84717433df | ||
![]() |
b5ead56c4e | ||
![]() |
896d414032 | ||
![]() |
a5ecf67acd | ||
![]() |
c731c32001 | ||
![]() |
86a656e25d | ||
![]() |
6f6473ceee | ||
![]() |
cdde458fe7 | ||
![]() |
fd58c3595e | ||
![]() |
02a078df2a | ||
![]() |
ce8173891b | ||
![]() |
cb8db8670f | ||
![]() |
6dccd1f6eb | ||
![]() |
044ce0705a | ||
![]() |
5b053c645c | ||
![]() |
ee386d085c | ||
![]() |
329ad57e36 | ||
![]() |
6f694e8abe | ||
![]() |
ee67cd5362 | ||
![]() |
feaa3468d7 | ||
![]() |
4a8d42fe4b | ||
![]() |
abc595357f | ||
![]() |
a51d65f7cc | ||
![]() |
5849775660 | ||
![]() |
146a31d561 | ||
![]() |
2e49c78ea0 | ||
![]() |
3543aa40e6 | ||
![]() |
fc52bda69c | ||
![]() |
8762aa467b | ||
![]() |
feace62dcb | ||
![]() |
d5127e8a56 | ||
![]() |
23563bc4f9 | ||
![]() |
6a7087d4f5 | ||
![]() |
c012cdff64 | ||
![]() |
ed556d2bd4 | ||
![]() |
6662d4a48f | ||
![]() |
05f4215faf | ||
![]() |
d685a64f78 | ||
![]() |
a024ac674d | ||
![]() |
6416af3928 | ||
![]() |
7a79122b5a | ||
![]() |
3ab43d84fe | ||
![]() |
fdd4a9700c | ||
![]() |
3e140ce0ed | ||
![]() |
dfe8899b21 | ||
![]() |
7f88c8c3e1 | ||
![]() |
98efdfd8cf | ||
![]() |
a762cf70f6 | ||
![]() |
8f39fb267b | ||
![]() |
498ba2d69e | ||
![]() |
4887826a36 | ||
![]() |
1ed7661774 | ||
![]() |
06163f0ef8 | ||
![]() |
a6563f9a7e | ||
![]() |
97049bae46 | ||
![]() |
5340fc2ed4 | ||
![]() |
d9ec195233 | ||
![]() |
4a858de9da | ||
![]() |
81e57d2f38 | ||
![]() |
114168c1c1 | ||
![]() |
f6a096a322 | ||
![]() |
5bc51ec96b | ||
![]() |
72208680ff | ||
![]() |
b5fc1b911b | ||
![]() |
161f61ea96 | ||
![]() |
1757e16dea | ||
![]() |
9a7140744e | ||
![]() |
d984ee0a42 | ||
![]() |
ffbcefacbd | ||
![]() |
461338d99b | ||
![]() |
ee64468a8f | ||
![]() |
5ae35fb06e | ||
![]() |
2245fc368d | ||
a805d8292f | |||
14bcb62184 | |||
9ef0f1f1a2 | |||
b84b3e39d9 | |||
61bc1f4d72 | |||
c83f512382 | |||
d8d93efb20 | |||
778850d8ee | |||
763b629ddd | |||
1a25ebd1f2 | |||
76083b679f | |||
7a43179b47 | |||
2a89b6dc58 | |||
![]() |
3e7f38666e | ||
acde0b6951 | |||
![]() |
e188536d65 | ||
625ef9ce37 | |||
52530197c3 | |||
bf1bb53c96 | |||
49b98e8b10 | |||
7d6d659933 | |||
a762ac5fc2 | |||
a2b2a7956b | |||
5940eae3f6 | |||
![]() |
9f8f888f91 | ||
![]() |
be4f87184e | ||
![]() |
18e557cc1b | ||
![]() |
be21eac230 | ||
![]() |
6b3372e41a | ||
![]() |
daf45760ec | ||
![]() |
423be26cb5 | ||
![]() |
941ed5e0d1 | ||
![]() |
3a2b3fa568 | ||
![]() |
9d49ee0eae | ||
![]() |
9d49ec3972 | ||
![]() |
4262a7a413 | ||
![]() |
6a79e8b3db | ||
![]() |
a5f924ae77 | ||
![]() |
561b2e4b53 | ||
![]() |
2bdc26cb21 | ||
![]() |
dc380a9777 | ||
![]() |
d5ce47c82c | ||
![]() |
22ff003125 | ||
eb50493cc5 | |||
73d1215b23 | |||
45f8cf2248 | |||
6242f7cc2e | |||
1bdb2934f5 | |||
115c35cec1 | |||
7cd6d7da2d | |||
fd8ebb98a5 | |||
f02bacc877 | |||
5d250a4c39 | |||
7fdae2b25e | |||
e08f5253ce | |||
9fed6a0dda | |||
d4f70ce67d | |||
6afd09945b | |||
806355099e | |||
fa6aa62e56 | |||
![]() |
9d2bd1b37a | ||
![]() |
dc250e449f | ||
![]() |
05c10df239 | ||
![]() |
2ae0d9aa37 | ||
![]() |
b04c8509a7 | ||
![]() |
9d4c99acc7 | ||
![]() |
c5a564a4cd | ||
![]() |
1b16e0ffd4 | ||
![]() |
39b892523b | ||
![]() |
649f10f5b8 | ||
![]() |
e06b92fde7 | ||
![]() |
f1429faf3f | ||
![]() |
7f074c67e3 | ||
![]() |
917d6d01db | ||
![]() |
9ea0085ddb | ||
![]() |
a199f919b6 | ||
![]() |
5e63c73c3b | ||
![]() |
dfd3f42550 | ||
![]() |
b8e4c4ea3a | ||
![]() |
5522856f47 | ||
![]() |
1933b84f68 | ||
![]() |
203024b154 | ||
![]() |
8488921075 | ||
![]() |
5966594b44 | ||
![]() |
5d0b49b1c7 | ||
![]() |
d4721a5b7a | ||
![]() |
a552158ed4 | ||
![]() |
de5f347339 | ||
![]() |
9e8009fe06 | ||
![]() |
b2db424d20 | ||
![]() |
e2ac4303f3 | ||
![]() |
0dc9a0640a | ||
![]() |
7363fc81cb | ||
![]() |
629e7e92a4 | ||
![]() |
48f6a23a9b | ||
![]() |
e6fc1fd656 | ||
![]() |
e5c73e6dcd | ||
![]() |
fd5d636930 | ||
![]() |
f226734468 | ||
![]() |
d72c6347a3 | ||
![]() |
f099d3012e | ||
![]() |
7e09fe7fff | ||
![]() |
7c9b12301b | ||
![]() |
35d927f09e | ||
![]() |
74df76e9b0 | ||
![]() |
8494e7a753 | ||
![]() |
6eff27d4d8 | ||
![]() |
28d39375ba | ||
![]() |
c1965e2453 | ||
![]() |
91b293d211 | ||
595b0ab211 | |||
efa19c672a | |||
ed80d3fc62 | |||
7736c2d2ff | |||
3742f1f477 | |||
12278c350f | |||
![]() |
28aa153414 | ||
![]() |
21ebbf224b | ||
![]() |
6dd2fa100a | ||
![]() |
b4df085936 | ||
![]() |
1bdfd53753 | ||
73d596c645 | |||
8c46b941ae | |||
c4d05fe91f | |||
![]() |
ac355ef586 | ||
![]() |
346a64d3bc | ||
![]() |
b98e4c0347 | ||
![]() |
9b232a4a97 | ||
![]() |
1ec226511c | ||
![]() |
673f02cdd0 | ||
![]() |
edd7ffce02 | ||
![]() |
87c4416b50 | ||
![]() |
7efa770ed7 | ||
929d3727f8 | |||
0e4c715211 | |||
![]() |
f9768170b3 | ||
![]() |
f6ff98c5ed | ||
![]() |
0f97dddcd8 | ||
![]() |
b73cc62c16 | ||
![]() |
51ececc34a | ||
![]() |
88daf43c3a | ||
![]() |
32c5e8ae91 | ||
![]() |
7ebc470a7b | ||
![]() |
010867260c | ||
![]() |
0b4d14c223 | ||
![]() |
31d5556142 | ||
![]() |
b83689a20b | ||
![]() |
0e0ab56bd6 | ||
![]() |
d65b5de195 | ||
![]() |
9a9749d986 | ||
![]() |
299f037cce | ||
![]() |
cc4c3851fb | ||
![]() |
063729096a | ||
![]() |
f64b3c4135 | ||
![]() |
25464eff79 | ||
![]() |
312c140f7d | ||
![]() |
c2df28c1c7 | ||
![]() |
b33d6560d3 | ||
![]() |
715fed2764 | ||
![]() |
55a9a41722 | ||
![]() |
1b17e0d0ce | ||
![]() |
9c43de08db | ||
![]() |
c214705368 | ||
![]() |
c5456d442f | ||
![]() |
6105848d8e | ||
cc9d83b4ae | |||
![]() |
25bec328fa | ||
![]() |
310636413e | ||
![]() |
ae1f3f9389 | ||
![]() |
c5526a41d3 | ||
![]() |
2ff2ae7d98 | ||
![]() |
4b6ba27174 | ||
![]() |
aac0ceb577 | ||
![]() |
1171e3aaaf | ||
![]() |
0d1c7b7143 | ||
![]() |
304e0ea877 | ||
![]() |
4a1aa75cb2 | ||
![]() |
50bb647d8f | ||
![]() |
0f4080c166 | ||
38380462f1 | |||
8b3358aa13 | |||
![]() |
cbbf9b42b2 | ||
![]() |
c9362dcb8b | ||
![]() |
9b0beff9de | ||
![]() |
5eec61a7a9 | ||
![]() |
85f5c408c0 | ||
![]() |
2c333d4cc2 | ||
![]() |
449b1d63c5 | ||
![]() |
a727059945 | ||
![]() |
3b5bdad158 | ||
![]() |
2560464f8d | ||
![]() |
a055de9046 | ||
![]() |
41a5f7c539 | ||
![]() |
c3d02928c1 | ||
![]() |
0d18309583 | ||
![]() |
120215d3b8 | ||
![]() |
a8a94f5f88 | ||
![]() |
e3532c5787 | ||
![]() |
d647776d6c | ||
![]() |
35dc47fd62 | ||
![]() |
404933168f | ||
![]() |
a158b2418e | ||
![]() |
39bd08f1ea | ||
![]() |
06247a160d | ||
![]() |
4b2b90be8e | ||
![]() |
dee6a13b1c | ||
![]() |
63c21c087f | ||
![]() |
a7eda9faf9 | ||
![]() |
cccda1aadb | ||
![]() |
076d6a12a2 | ||
![]() |
2ff8974cc9 | ||
![]() |
161c9943c4 | ||
![]() |
fc2347e707 | ||
![]() |
8c654beb05 | ||
![]() |
23b6e1b8c7 | ||
![]() |
ea44f74cc4 | ||
![]() |
67dbe64683 | ||
![]() |
25234801df | ||
![]() |
13a1ff4f7c | ||
![]() |
e31daef26b | ||
![]() |
f3f4f7915d | ||
![]() |
69819ed692 | ||
![]() |
a93f1c2422 | ||
![]() |
a0975d635d | ||
![]() |
f03c4d4e62 | ||
![]() |
1d92a5336e | ||
![]() |
bf81680b56 | ||
![]() |
18892c6156 | ||
![]() |
8b91e0e1d3 | ||
![]() |
773a8f61e9 | ||
![]() |
a435f56f2e | ||
![]() |
6e23397905 | ||
![]() |
458971392e | ||
![]() |
6f17f69281 | ||
![]() |
5b9187d545 | ||
![]() |
648fac6904 | ||
![]() |
33919fe155 | ||
![]() |
66431ef7d3 | ||
![]() |
5b3c47fa19 | ||
![]() |
2d5160b232 | ||
![]() |
a2cf76cb88 | ||
![]() |
8d84b2c65f | ||
![]() |
c55f4058c7 | ||
![]() |
3b78711478 | ||
![]() |
a061ebd1e9 | ||
![]() |
4ed3cfc90e | ||
![]() |
1cd1d7ae88 | ||
![]() |
4b0726f939 | ||
![]() |
c6633be301 | ||
![]() |
11d99a4cf9 | ||
![]() |
a53b8c7fdb | ||
![]() |
1483c39029 | ||
![]() |
5a39f2053f | ||
![]() |
6fb6732a2d | ||
![]() |
bd00156ece | ||
![]() |
a6b9150983 | ||
![]() |
587811778d | ||
![]() |
4e5695a118 | ||
8a2275e56e | |||
a8c44c3096 | |||
![]() |
da62b1bfa9 | ||
![]() |
8bbeb11b59 | ||
![]() |
caee521edd | ||
![]() |
b607096317 | ||
![]() |
d8b85ba1b4 | ||
![]() |
23673a34d8 | ||
![]() |
af13555afb | ||
![]() |
de1e9fd8f4 | ||
![]() |
23af433e5d | ||
![]() |
6323b567de | ||
![]() |
fd603d8c9e | ||
![]() |
05e9ee97ca | ||
![]() |
0bf6feb731 | ||
![]() |
450d2bb3fa | ||
![]() |
0eabf19d23 | ||
![]() |
45bf766d1c | ||
![]() |
4a6fabd47d | ||
![]() |
ec5880290a | ||
![]() |
5f49633867 | ||
![]() |
cce6bba19d | ||
![]() |
f5d8c61a62 | ||
![]() |
6ec9f84eab | ||
![]() |
34ca1c51a0 | ||
![]() |
52b1b303bd | ||
![]() |
c98e692546 | ||
![]() |
1042f6de02 | ||
![]() |
2ed822e1da | ||
![]() |
b5634ed59f | ||
![]() |
187f0c0216 | ||
![]() |
71e9bbc830 | ||
![]() |
6297b9cc24 | ||
![]() |
e62fd40f88 | ||
![]() |
e010242469 | ||
![]() |
5476397af6 | ||
![]() |
f238b86dc7 | ||
![]() |
f5ad70fb28 | ||
![]() |
697c003678 | ||
![]() |
ffbcc302ea | ||
![]() |
1ded31491a | ||
![]() |
f8e2da3345 | ||
![]() |
8c77a0a323 | ||
![]() |
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 | ||
6293bb4017 | |||
03a5057269 | |||
4a15514ba0 |
10
.github/workflows/android.yml
vendored
@ -15,10 +15,10 @@ jobs:
|
|||||||
encodedString: ${{ secrets.KEYSTORE_BASE64 }}
|
encodedString: ${{ secrets.KEYSTORE_BASE64 }}
|
||||||
- name: Create key.properties
|
- name: Create key.properties
|
||||||
run: |
|
run: |
|
||||||
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > filcnaplo/android/key.properties
|
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > refilc/android/key.properties
|
||||||
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> filcnaplo/android/key.properties
|
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> refilc/android/key.properties
|
||||||
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> filcnaplo/android/key.properties
|
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> refilc/android/key.properties
|
||||||
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> filcnaplo/android/key.properties
|
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> refilc/android/key.properties
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: "zulu"
|
distribution: "zulu"
|
||||||
@ -32,7 +32,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: ./fix-pub.sh
|
run: ./fix-pub.sh
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cd filcnaplo && ./build.sh
|
run: cd refilc && ./build.sh
|
||||||
- name: Upload Android Release
|
- name: Upload Android Release
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
4
.github/workflows/ios.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
|||||||
|
|
||||||
# Build and sign the ipa using a single flutter command
|
# Build and sign the ipa using a single flutter command
|
||||||
- name: Building IPA
|
- name: Building IPA
|
||||||
working-directory: filcnaplo
|
working-directory: refilc
|
||||||
run: bash build-ipa.sh
|
run: bash build-ipa.sh
|
||||||
|
|
||||||
# Collect the file and upload as artifact
|
# Collect the file and upload as artifact
|
||||||
@ -55,7 +55,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: release-ipa
|
name: release-ipa
|
||||||
# Path to the release files
|
# Path to the release files
|
||||||
path: filcnaplo/build/ios/ipa/*.ipa
|
path: refilc/build/ios/ipa/*.ipa
|
||||||
|
|
||||||
# Important! Cleanup: remove the certificate and provisioning profile from the runner!
|
# Important! Cleanup: remove the certificate and provisioning profile from the runner!
|
||||||
- name: Clean up keychain and provisioning profile
|
- name: Clean up keychain and provisioning profile
|
||||||
|
101
.gitignore
vendored
@ -1,52 +1,57 @@
|
|||||||
# See https://www.dartlang.org/guides/libraries/private-files
|
|
||||||
|
|
||||||
.gitignore
|
refilc/.flutter-plugins
|
||||||
|
refilc/.flutter-plugins-dependencies
|
||||||
|
refilc/pubspec.lock
|
||||||
|
refilc/.dart_tool/
|
||||||
|
# refilc/android/
|
||||||
|
# refilc/ios/
|
||||||
|
# refilc/windows/
|
||||||
|
# refilc/linux/
|
||||||
|
# refilc/macos/
|
||||||
|
refilc/build/
|
||||||
|
refilc/android/key.properties
|
||||||
|
refilc/android/debug.keystore
|
||||||
|
|
||||||
termek.txt
|
# refilc_desktop_ui/.flutter-plugins
|
||||||
|
# refilc_desktop_ui/.flutter-plugins-dependencies
|
||||||
|
# refilc_desktop_ui/pubspec.lock
|
||||||
|
# refilc_desktop_ui/.dart_tool/
|
||||||
|
|
||||||
|
refilc_kreta_api/.flutter-plugins
|
||||||
|
refilc_kreta_api/.flutter-plugins-dependencies
|
||||||
|
refilc_kreta_api/pubspec.lock
|
||||||
|
refilc_kreta_api/.dart_tool/
|
||||||
|
|
||||||
|
refilc_mobile_ui/.flutter-plugins
|
||||||
|
refilc_mobile_ui/.flutter-plugins-dependencies
|
||||||
|
refilc_mobile_ui/pubspec.lock
|
||||||
|
refilc_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
|
||||||
|
.gradle
|
||||||
|
.kotlin
|
||||||
|
|
||||||
|
refilc/.DS_Store
|
||||||
.DS_Store
|
.DS_Store
|
||||||
filc3.properties
|
refilc/linux/flutter/
|
||||||
local.properties
|
.plugin_symlinks/
|
||||||
# Files and directories created by pub
|
refilc/macos/Flutter/
|
||||||
.dart_tool/
|
refilc/ios/Flutter/
|
||||||
.packages
|
refilc/ios/Runner/GeneratedPluginRegistrant.h
|
||||||
build/
|
refilc/ios/Runner/GeneratedPluginRegistrant.m
|
||||||
# If you're building an application, you may want to check-in your pubspec.lock
|
refilc/android/local.properties
|
||||||
pubspec.lock
|
refilc/android/debugkey.properties
|
||||||
|
refilc/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
|
||||||
|
|
||||||
# Directory created by dartdoc
|
tool_logs/build/*.log
|
||||||
# If you don't generate documentation locally you can remove this line.
|
tool_logs/d8dx_fix/*.log
|
||||||
doc/api/
|
tool_logs/pub_fix/*.log
|
||||||
|
refilc_mobile_ui/android/local.properties
|
||||||
# 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
|
|
||||||
filcnaplo/ios/Flutter/Generated 4.xcconfig
|
|
||||||
|
3
.idea/.gitignore
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
1286
.idea/libraries/Dart_Packages.xml
generated
41
.idea/libraries/Dart_SDK.xml
generated
@ -1,25 +1,28 @@
|
|||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="Dart SDK">
|
<library name="Dart SDK">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/async" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/async" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/cli" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/cli" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/collection" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/collection" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/convert" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/concurrent" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/core" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/convert" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/developer" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/core" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/ffi" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/developer" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/html" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/ffi" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/indexed_db" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/html" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/io" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/indexed_db" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/isolate" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/io" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/js" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/isolate" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/js_util" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/js" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/math" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/js_interop" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/js_interop_unsafe" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/svg" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/js_util" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/typed_data" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/math" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/web_audio" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
||||||
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/web_gl" />
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/svg" />
|
||||||
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/typed_data" />
|
||||||
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/web_audio" />
|
||||||
|
<root url="file://P:/flutter/bin/cache/dart-sdk/lib/web_gl" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
1
.idea/misc.xml
generated
@ -1,4 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 33, extension level 3 Platform" project-jdk-type="Android SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 33, extension level 3 Platform" project-jdk-type="Android SDK" />
|
||||||
</project>
|
</project>
|
13
.idea/naplo.iml
generated
@ -60,8 +60,21 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/filcnaplo/linux/flutter/ephemeral/.plugin_symlinks/flutter_acrylic/build" />
|
<excludeFolder url="file://$MODULE_DIR$/filcnaplo/linux/flutter/ephemeral/.plugin_symlinks/flutter_acrylic/build" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/filcnaplo/linux/flutter/ephemeral/.plugin_symlinks/flutter_acrylic/.pub" />
|
<excludeFolder url="file://$MODULE_DIR$/filcnaplo/linux/flutter/ephemeral/.plugin_symlinks/flutter_acrylic/.pub" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/filcnaplo/linux/flutter/ephemeral/.plugin_symlinks/flutter_acrylic/.dart_tool" />
|
<excludeFolder url="file://$MODULE_DIR$/filcnaplo/linux/flutter/ephemeral/.plugin_symlinks/flutter_acrylic/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_kreta_api/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_kreta_api/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_kreta_api/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_mobile_ui/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_mobile_ui/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_mobile_ui/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_plus/.dart_tool" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_plus/.pub" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/refilc_plus/build" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
5
.idea/vcs.xml
generated
@ -2,9 +2,6 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/filcnaplo_desktop_ui" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/refilc_plus" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/filcnaplo_kreta_api" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/filcnaplo_mobile_ui" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/filcnaplo_premium" vcs="Git" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
40
.vscode/launch.json
vendored
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "filcnaplo",
|
|
||||||
"cwd": "filcnaplo",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart",
|
|
||||||
"toolArgs": [
|
|
||||||
"--dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// "name": "filcnaplo release",
|
|
||||||
// "cwd": "filcnaplo release",
|
|
||||||
// "request": "launch",
|
|
||||||
// "type": "dart",
|
|
||||||
// "program": "lib/main.dart",
|
|
||||||
// "toolArgs": [
|
|
||||||
// "--dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1)"
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
"name": "Flutter",
|
|
||||||
"program": "lib/main.dart",
|
|
||||||
"cwd": "filcnaplo",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart",
|
|
||||||
"flutterMode": "debug"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Flutter (release)",
|
|
||||||
"program": "lib/main.dart",
|
|
||||||
"cwd": "filcnaplo",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "dart",
|
|
||||||
"flutterMode": "release"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
# Contribution guide
|
# Contribution guide (Hozzájárulási útmutató)
|
||||||
Köszönjük, ha programozással segíted a munkánkat!
|
Köszönjük, ha programozással segíted a munkánkat!
|
||||||
A folytatáshoz szükséged lesz egy Linux-ot vagy Windows-t futtató számítógépre, minimális programozási tapasztalatra és egy kis angoltudásra.
|
A folytatáshoz szükséged lesz egy MacOS-t, Linux-ot vagy Windows-t futtató számítógépre, minimális programozási tapasztalatra és egy kis angoltudásra.
|
||||||
Segít, ha már gyakorlottabb vagy a programozásban, és ha ismered a [Git](https://git-scm.com/) és a [GitHub](https://github.com/) működését. ;)
|
Segít, ha már gyakorlottabb vagy a programozásban, és ha ismered a [Git](https://git-scm.com/) és a [GitHub](https://github.com/) működését. ;)
|
||||||
|
|
||||||
## Miben segítsek?
|
## Miben segítsek?
|
||||||
@ -14,7 +14,7 @@ A legjobban annak örülünk, ha az [Issues](https://github.com/refilc/naplo/iss
|
|||||||
## Hogyan segítsek?
|
## Hogyan segítsek?
|
||||||
Nem ígérhetünk itt sem programozás-, sem Git-kurzust, de a projektspecifikus dolgokat leírjuk, és segítünk a Flutter telepítésében.
|
Nem ígérhetünk itt sem programozás-, sem Git-kurzust, de a projektspecifikus dolgokat leírjuk, és segítünk a Flutter telepítésében.
|
||||||
|
|
||||||
A **reFilc** a Google által pár éve létrehozott **[Flutter](https://flutter.dev/)** keretrendszert használja, aminek nyelve a **[Dart](https://dart.dev/)**. Ha ismered a C#, Java, C++, vagy egyéb hasonló programnyelvek működését, **nem fog nagy gondot okozni a használata.** A felhasználói felület létrehozásában az is segíthet, ha foglalkoztál már korábban weboldalakkal vagy alkalmazásfejlesztéssel.
|
A **reFilc** a Google által pár éve létrehozott **[Flutter](https://flutter.dev/)** keretrendszert használja, aminek nyelve a **[Dart](https://dart.dev/)**. Ha ismered a JavaScript, C#, Java, C++, vagy egyéb hasonló programnyelvek működését, **nem fog nagy gondot okozni a használata.** A felhasználói felület létrehozásában az is segíthet, ha foglalkoztál már korábban weboldalakkal vagy alkalmazásfejlesztéssel.
|
||||||
Ha még nem használtad a Flutter-t, mindenképp böngészd át a [YouTube csatornájukat](https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw).
|
Ha még nem használtad a Flutter-t, mindenképp böngészd át a [YouTube csatornájukat](https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw).
|
||||||
Kód vagy UI teszteléséhez Flutter telepítése nélkül is használhatod a [DartPad](https://dartpad.dev/)-et.
|
Kód vagy UI teszteléséhez Flutter telepítése nélkül is használhatod a [DartPad](https://dartpad.dev/)-et.
|
||||||
|
|
||||||
@ -24,13 +24,13 @@ Kód vagy UI teszteléséhez Flutter telepítése nélkül is használhatod a [D
|
|||||||
Ha nem értessz a Git-hez vagy a GitHub-hoz, ajánljuk figyelmedbe [ezt a cikket](https://medium.com/envienta-magyarorsz%C3%A1g/git-%C3%A9s-github-gyorstalpal%C3%B3-f2d78a732deb), viszont arra kérünk, hogy a használatukat ne a **reFilc**en próbáld ki először. Hozz létre egy saját Repo-t és abban tesztelgess. Ha már nagyjából kitapasztaltad, várjuk hozzájárulásodat.
|
Ha nem értessz a Git-hez vagy a GitHub-hoz, ajánljuk figyelmedbe [ezt a cikket](https://medium.com/envienta-magyarorsz%C3%A1g/git-%C3%A9s-github-gyorstalpal%C3%B3-f2d78a732deb), viszont arra kérünk, hogy a használatukat ne a **reFilc**en próbáld ki először. Hozz létre egy saját Repo-t és abban tesztelgess. Ha már nagyjából kitapasztaltad, várjuk hozzájárulásodat.
|
||||||
|
|
||||||
Készíts egy Fork-ot a saját GitHub fiókod alá.
|
Készíts egy Fork-ot a saját GitHub fiókod alá.
|
||||||
A **reFilc** legfrissebb, **épp fejlesztés alatt álló verzióját a [master branch](https://github.com/refilc/naplo/tree/master)-en találod**. Kérjük ide Commit-olj és ide célozd a Fork-odból a Pull Request-edet. Írd le benne, hogy mit változtattál és ha lehet, csatolj képernyőképet is.
|
A **reFilc** legfrissebb, **épp fejlesztés alatt álló verzióját a [dev branch](https://github.com/refilc/naplo/tree/dev)-en találod**. Kérjük ide Commit-olj és ide célozd a Fork-odból a Pull Request-edet. Írd le benne, hogy mit változtattál és ha lehet, csatolj képernyőképet is.
|
||||||
Minél gyakrabban készíts minél részletesebben elnevezett Commit-okat, hogy mások is el tudjanak igazodni az általad beküldött kódban.
|
Minél gyakrabban készíts minél részletesebben elnevezett Commit-okat, hogy mások is el tudjanak igazodni az általad beküldött kódban.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Az általad fejlesztett funkciók mellé a Changelog-ba odakerül a GitHub felhasználóneved.
|
Az általad fejlesztett funkciók mellé a Changelog-ba odakerül a GitHub felhasználóneved.
|
||||||
Ha jelentős és rendszeres hozzájáruló vagy, Discord-on megkaphatod a `DEV` rangot.
|
Ha jelentős és rendszeres hozzájáruló vagy, Discord-on megkaphatod a `Contributor` rangot, valamint kaphatsz kedvezményt a reFilc+ előfizetésekből és Merch-ekből!
|
||||||
|
|
||||||
Ha bárhol elakadtál vagy kérdésed van, keress bátran Discordon!
|
Ha bárhol elakadtál vagy kérdésed van, keress bátran Discord-on!
|
||||||
**Jó fejlesztést kívánunk!**
|
**Jó fejlesztést kívánunk!**
|
||||||
|
119
README.md
@ -1,52 +1,67 @@
|
|||||||
<p align=center>
|
<p align=center>
|
||||||
<img src="https://media.discordapp.net/attachments/1111727410677825596/1113217167513624646/reFilc_Logo_Squircle.png?width=671&height=671" width=150>
|
<img src="https://raw.githubusercontent.com/Laky2k8/Refilc-2-Episode-1/refs/heads/master/refilc-2-real.png" width=150>
|
||||||
<h1 align=center><b>reFilc</b></h1>
|
<h1 align=center><b>reFilc</b></h1>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
#### Nem hivatalos e-napló alkalmazás az e-KRÉTA rendszerhez - tanulóktól, tanulóknak.
|
#### Nem hivatalos e-napló alkalmazás az e-KRÉTA rendszerhez - tanulóktól, tanulóknak.
|
||||||
|
|
||||||
[](https://github.com/refilc/naplo/releases) [](https://dc.refilc.hu)
|
[](https://github.com/refilc/naplo/releases) [](https://discord.gg/refilc-1111649116020285532)
|
||||||
|
|
||||||
## Setup
|
## Környezet felállítása
|
||||||
|
|
||||||
### Clone the project
|
### Source code letöltése
|
||||||
|
|
||||||
```sh
|
*Az építhéshez szükséged lesz a refilc_plus repora is, amit itt találsz: [student-plus](https://git.qwit.cloud/refilc/student-plus)*
|
||||||
git clone https://github.com/refilc/naplo
|
|
||||||
cd naplo
|
```sh
|
||||||
```
|
git clone https://git.qwit.cloud/refilc/student-legacy.git --recursive
|
||||||
|
cd naplo
|
||||||
### Install packages
|
# ha ez nem töltött le refilc plus repoba értelmes dolgokat futtasd a többi parancsot is
|
||||||
|
rm -rf refilc_plus
|
||||||
Run `fix-pub.sh`
|
git clone https://git.qwit.cloud/refilc/student-plus.git refilc_plus
|
||||||
|
```
|
||||||
### Run the app
|
|
||||||
|
### Csomagok telepítése
|
||||||
```sh
|
|
||||||
cd filcnaplo
|
Menj be minden mappába és futtasd a következő parancsokat:
|
||||||
flutter run
|
```sh
|
||||||
```
|
flutter clean
|
||||||
|
flutter pub get
|
||||||
### Contribution
|
```
|
||||||
|
|
||||||
**Nézd meg a [Contribution guide](CONTRIBUTING.md)-ot!**
|
### Alkalmazás építése
|
||||||
|
|
||||||
Az összes (ugyan azon verzióhoz tartozó) contribution meg fog jelenni a release-nél. Kérjük, írd le a Discord nevedet a Description-be, hogy adhassunk rangot.
|
```sh
|
||||||
|
cd refilc
|
||||||
-------
|
flutter build apk --release
|
||||||
|
```
|
||||||
# Team
|
|
||||||
|
*Ez egy apk fájlt fog építeni*
|
||||||
**kima:** head developer / project manager
|
|
||||||
|
### Contribution
|
||||||
**Reiner, pdf, Pearoo, Zizi:** community- and project manager / developer
|
|
||||||
|
**Nézd meg a [Contribution guide](CONTRIBUTING.md)-ot!**
|
||||||
**vrolandd, TMarccci:** head developer
|
|
||||||
|
Az összes (ugyan azon verzióhoz tartozó) contribution meg fog jelenni a release-nél. Kérjük, írd le a Discord nevedet a Description-be, hogy adhassunk rangot.
|
||||||
**dwe., xou, SebRHQ:** designer
|
|
||||||
|
-------
|
||||||
**Péter:** video editor
|
|
||||||
|
# Csapatunk
|
||||||
**annon:** a régi Filc Napló fejlesztője (ez az app, ha bár sokban változott, alapjaiban a Filc-re épül)
|
|
||||||
|
**Management**
|
||||||
<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>
|
- Zypherift
|
||||||
|
- hayn
|
||||||
|
- Pearoo
|
||||||
|
- Zizi
|
||||||
|
- mnus
|
||||||
|
- xou
|
||||||
|
|
||||||
|
**Designerek**
|
||||||
|
- dwe
|
||||||
|
- xou
|
||||||
|
|
||||||
|
**vrolandd, TMarccci:** head developer
|
||||||
|
|
||||||
|
**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)*
|
||||||
|
13
changelog.md
@ -1,13 +0,0 @@
|
|||||||
What's new:
|
|
||||||
|
|
||||||
- design tweak
|
|
||||||
- new premium ui
|
|
||||||
- premium fix
|
|
||||||
- rounding fix
|
|
||||||
- graph percentage fix
|
|
||||||
- fail warning
|
|
||||||
- Widget
|
|
||||||
- fix sent messages
|
|
||||||
- fix ios live activities
|
|
||||||
- Hibajavítások 🐛
|
|
||||||
- **Megérkezett a Filc Premium!** ✨
|
|
7
check-outdated.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
cd refilc && flutter pub outdated && cd ..
|
||||||
|
cd refilc_kreta_api && flutter pub outdated && cd ..
|
||||||
|
cd refilc_mobile_ui && flutter pub outdated && cd ..
|
||||||
|
# cd refilc_desktop_ui && flutter pub upgrade && cd ..
|
||||||
|
cd refilc_plus && flutter pub outdated && cd ..
|
||||||
|
|
||||||
|
echo Outdated version list above.
|
47
filcnaplo/.gitignore
vendored
@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
key.properties
|
|
@ -1,30 +0,0 @@
|
|||||||
# This file tracks properties of this Flutter project.
|
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
||||||
#
|
|
||||||
# This file should be version controlled.
|
|
||||||
|
|
||||||
version:
|
|
||||||
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
|
||||||
channel: stable
|
|
||||||
|
|
||||||
project_type: app
|
|
||||||
|
|
||||||
# Tracks metadata for the flutter migrate command
|
|
||||||
migration:
|
|
||||||
platforms:
|
|
||||||
- platform: root
|
|
||||||
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
|
||||||
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
|
||||||
- platform: web
|
|
||||||
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
|
||||||
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
|
||||||
|
|
||||||
# User provided section
|
|
||||||
|
|
||||||
# List of Local paths (relative to this file) that should be
|
|
||||||
# ignored by the migrate tool.
|
|
||||||
#
|
|
||||||
# Files that are not part of the templates will be ignored by default.
|
|
||||||
unmanaged_files:
|
|
||||||
- 'lib/main.dart'
|
|
||||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
|
@ -1,29 +0,0 @@
|
|||||||
# This file configures the analyzer, which statically analyzes Dart code to
|
|
||||||
# check for errors, warnings, and lints.
|
|
||||||
#
|
|
||||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
|
||||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
|
||||||
# invoked from the command line by running `flutter analyze`.
|
|
||||||
|
|
||||||
# The following line activates a set of recommended lints for Flutter apps,
|
|
||||||
# packages, and plugins designed to encourage good coding practices.
|
|
||||||
include: package:flutter_lints/flutter.yaml
|
|
||||||
|
|
||||||
linter:
|
|
||||||
# The lint rules applied to this project can be customized in the
|
|
||||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
|
||||||
# included above or to enable additional rules. A list of all available lints
|
|
||||||
# and their documentation is published at
|
|
||||||
# https://dart-lang.github.io/linter/lints/index.html.
|
|
||||||
#
|
|
||||||
# Instead of disabling a lint rule for the entire project in the
|
|
||||||
# section below, it can also be suppressed for a single line of code
|
|
||||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
|
||||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
|
||||||
# producing the lint.
|
|
||||||
rules:
|
|
||||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
|
||||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
|
||||||
|
|
||||||
# Additional information about this file can be found at
|
|
||||||
# https://dart.dev/guides/language/analysis-options
|
|
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,99 +0,0 @@
|
|||||||
def localProperties = new Properties()
|
|
||||||
def localPropertiesFile = rootProject.file('local.properties')
|
|
||||||
if (localPropertiesFile.exists()) {
|
|
||||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
|
||||||
localProperties.load(reader)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
|
||||||
if (flutterRoot == null) {
|
|
||||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
|
||||||
}
|
|
||||||
|
|
||||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
|
||||||
if (flutterVersionCode == null) {
|
|
||||||
throw new GradleException("Undefined VersionCode")
|
|
||||||
}
|
|
||||||
|
|
||||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
|
||||||
if (flutterVersionName == null) {
|
|
||||||
throw new GradleException("Undefined VersionName")
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
apply plugin: 'kotlin-android'
|
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
|
||||||
|
|
||||||
def keystoreProperties = new Properties()
|
|
||||||
def keystorePropertiesFile = rootProject.file("key.properties")
|
|
||||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
|
||||||
}
|
|
||||||
|
|
||||||
lintOptions {
|
|
||||||
disable 'InvalidPackage'
|
|
||||||
disable "Instantiatable"
|
|
||||||
checkReleaseBuilds false
|
|
||||||
abortOnError false
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "hu.refilc.naplo"
|
|
||||||
minSdkVersion 21
|
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
||||||
versionCode flutterVersionCode.toInteger()
|
|
||||||
versionName flutterVersionName
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
multiDexEnabled true
|
|
||||||
}
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
// Flag to enable support for the new language APIs
|
|
||||||
coreLibraryDesugaringEnabled true
|
|
||||||
// Sets Java compatibility to Java 8
|
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
|
||||||
}
|
|
||||||
|
|
||||||
signingConfigs {
|
|
||||||
release {
|
|
||||||
keyAlias keystoreProperties['keyAlias']
|
|
||||||
keyPassword keystoreProperties['keyPassword']
|
|
||||||
storeFile file(keystoreProperties['storeFile'])
|
|
||||||
storePassword keystoreProperties['storePassword']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
signingConfig signingConfigs.release
|
|
||||||
shrinkResources false
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildFeatures {
|
|
||||||
viewBinding true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flutter {
|
|
||||||
source '../..'
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'com.android.support:multidex:2.0.1'
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
||||||
implementation 'joda-time:joda-time:2.9.4'
|
|
||||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
|
||||||
implementation 'androidx.window:window:1.0.0'
|
|
||||||
implementation 'androidx.window:window-java:1.0.0'
|
|
||||||
}
|
|
5
filcnaplo/android/app/proguard-rules.pro
vendored
@ -1,5 +0,0 @@
|
|||||||
-keep class io.flutter.plugin.editing.** { *; }
|
|
||||||
-keep class androidx.lifecycle.DefaultLifecycleObserver
|
|
||||||
-keep class com.pauldemarco.flutter_blue.** { *; }
|
|
||||||
-keep class com.mr.flutter.plugin.filepicker.** { *; }
|
|
||||||
-keep class com.shockwave.**
|
|
@ -1,86 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
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"
|
|
||||||
android:requestLegacyExternalStorage="true">
|
|
||||||
<activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
|
|
||||||
android:launchMode="singleTop" android:theme="@style/LaunchTheme"
|
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
||||||
android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"
|
|
||||||
android:showWhenLocked="true"
|
|
||||||
android:turnScreenOn="true">
|
|
||||||
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable"
|
|
||||||
android:resource="@drawable/launch_background" />
|
|
||||||
<meta-data android:name="io.flutter.embedding.android.NormalTheme"
|
|
||||||
android:resource="@style/NormalTheme" />
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter android:autoVerify="true">
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
<!-- Accepts URIs that begin with https://api.refilcapp.hu -->
|
|
||||||
<data
|
|
||||||
android:scheme="https"
|
|
||||||
android:host="api.refilcapp.hu"
|
|
||||||
android:pathPrefix="/v1/auth/callback" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter android:autoVerify="true">
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
<!-- Accepts URIs that begin with https://refilc.hu -->
|
|
||||||
<data
|
|
||||||
android:scheme="https"
|
|
||||||
android:host="refilc.hu"
|
|
||||||
android:pathPrefix="/app" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
|
||||||
|
|
||||||
<receiver android:name="hu.refilc.naplo.widget_timetable.WidgetTimetable"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
|
||||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_LEFT" />
|
|
||||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_RIGHT" />
|
|
||||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_TODAY" />
|
|
||||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_REFRESH" />
|
|
||||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_BUY_PREMIUM" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.appwidget.provider"
|
|
||||||
android:resource="@xml/home_widget_test_info" />
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<service android:name="hu.refilc.naplo.widget_timetable.WidgetTimetableService"
|
|
||||||
android:permission="android.permission.BIND_REMOTEVIEWS" />
|
|
||||||
|
|
||||||
<receiver android:name="es.antonborri.home_widget.HomeWidgetBackgroundReceiver"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="es.antonborri.home_widget.action.BACKGROUND" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<service android:name="es.antonborri.home_widget.HomeWidgetBackgroundService"
|
|
||||||
android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true" />
|
|
||||||
</application>
|
|
||||||
|
|
||||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
|
||||||
|
|
||||||
<!-- Permissions -->
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
||||||
</manifest>
|
|
@ -1,7 +0,0 @@
|
|||||||
package hu.refilc.naplo;
|
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity;
|
|
||||||
|
|
||||||
public class MainActivity extends FlutterActivity {
|
|
||||||
|
|
||||||
}
|
|
@ -1,119 +0,0 @@
|
|||||||
package hu.refilc.naplo.database;
|
|
||||||
|
|
||||||
import android.content.ContentValues;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
|
|
||||||
import hu.refilc.naplo.database.SQLiteHelper;
|
|
||||||
|
|
||||||
public class DBManager {
|
|
||||||
private Context context;
|
|
||||||
private SQLiteDatabase database;
|
|
||||||
private SQLiteHelper dbHelper;
|
|
||||||
|
|
||||||
public DBManager(Context c) {
|
|
||||||
this.context = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DBManager open() throws SQLException {
|
|
||||||
this.dbHelper = new SQLiteHelper(this.context);
|
|
||||||
this.database = this.dbHelper.getWritableDatabase();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void close() {
|
|
||||||
this.dbHelper.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchWidget(int wid) {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_WIDGETS, new String[]{SQLiteHelper._ID, SQLiteHelper.DAY_SEL}, SQLiteHelper._ID + " = " + wid, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchTimetable() {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_USER_DATA, new String[]{SQLiteHelper.TIMETABLE}, null, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchLastUser() {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_SETTINGS, new String[]{SQLiteHelper.LAST_ACCOUNT_ID}, null, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchTheme() {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_SETTINGS, new String[]{SQLiteHelper.THEME, SQLiteHelper.ACCENT_COLOR}, null, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchPremiumToken() {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_SETTINGS, new String[]{SQLiteHelper.PREMIUM_TOKEN}, null, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchPremiumScopes() {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_SETTINGS, new String[]{SQLiteHelper.PREMIUM_SCOPES}, null, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Cursor fetchLocale() {
|
|
||||||
Cursor cursor = this.database.query(SQLiteHelper.TABLE_NAME_SETTINGS, new String[]{SQLiteHelper.LOCALE}, null, null, null, null, null);
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.moveToFirst();
|
|
||||||
}
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteWidget(int _id) {
|
|
||||||
this.database.delete(SQLiteHelper.TABLE_NAME_WIDGETS, "_id=" + _id, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*public void changeSettings(int _id, Map<String, String> map) {
|
|
||||||
ContentValues con = new ContentValues();
|
|
||||||
for(Map.Entry<String, String> e: map.entrySet()){
|
|
||||||
con.put(e.getKey(), e.getValue());
|
|
||||||
}
|
|
||||||
this.database.update(SQLiteHelper.TABLE_NAME_WIDGETS, con, "_id = " + _id, null);
|
|
||||||
}
|
|
||||||
public void insertSettings(int _id, Map<String, String> map) {
|
|
||||||
ContentValues con = new ContentValues();
|
|
||||||
for(Map.Entry<String, String> e: map.entrySet()){
|
|
||||||
con.put(e.getKey(), e.getValue());
|
|
||||||
//Log.d("Settings added", e.getKey() + " - " + e.getValue());
|
|
||||||
}
|
|
||||||
this.database.insert(SQLiteHelper.TABLE_NAME_WIDGETS, null, con);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public void insertSelDay(int _id, int day_sel) {
|
|
||||||
ContentValues con = new ContentValues();
|
|
||||||
con.put(SQLiteHelper._ID, _id);
|
|
||||||
con.put(SQLiteHelper.DAY_SEL, day_sel);
|
|
||||||
this.database.insert(SQLiteHelper.TABLE_NAME_WIDGETS, null, con);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int update(int _id, int day_sel) {
|
|
||||||
ContentValues con = new ContentValues();
|
|
||||||
con.put(SQLiteHelper.DAY_SEL, day_sel);
|
|
||||||
return this.database.update(SQLiteHelper.TABLE_NAME_WIDGETS, con, SQLiteHelper._ID + " = " + _id, null);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package hu.refilc.naplo.database;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
|
||||||
import android.database.sqlite.SQLiteOpenHelper;
|
|
||||||
|
|
||||||
public class SQLiteHelper extends SQLiteOpenHelper {
|
|
||||||
private static final String CREATE_TABLE_WIDGET = " create table widgets ( _id INTEGER NOT NULL, day_sel INTEGER NOT NULL);";
|
|
||||||
private static final String DB_NAME = "app.db";
|
|
||||||
private static final int DB_VERSION = 1;
|
|
||||||
public static final String _ID = "_id";
|
|
||||||
public static final String DAY_SEL = "day_sel";
|
|
||||||
public static final String TIMETABLE = "timetable";
|
|
||||||
public static final String LAST_ACCOUNT_ID = "last_account_id";
|
|
||||||
public static final String THEME = "theme";
|
|
||||||
public static final String PREMIUM_TOKEN = "premium_token";
|
|
||||||
public static final String PREMIUM_SCOPES = "premium_scopes";
|
|
||||||
public static final String LOCALE = "language";
|
|
||||||
public static final String ACCENT_COLOR = "accent_color";
|
|
||||||
public static final String TABLE_NAME_WIDGETS = "widgets";
|
|
||||||
public static final String TABLE_NAME_USER_DATA = "user_data";
|
|
||||||
public static final String TABLE_NAME_SETTINGS = "settings";
|
|
||||||
|
|
||||||
public SQLiteHelper(Context context) {
|
|
||||||
super(context, DB_NAME, null, 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCreate(SQLiteDatabase db) {
|
|
||||||
db.execSQL(CREATE_TABLE_WIDGET);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
|
||||||
db.execSQL("DROP TABLE IF EXISTS widgets");
|
|
||||||
onCreate(db);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package hu.refilc.naplo.utils;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.net.ConnectivityManager;
|
|
||||||
import android.net.NetworkInfo;
|
|
||||||
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class Utils {
|
|
||||||
public static boolean hasNetwork(Context context) {
|
|
||||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
||||||
NetworkInfo netInfo = cm.getActiveNetworkInfo();
|
|
||||||
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Date getWeekStartDate() {
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
|
|
||||||
calendar.add(Calendar.DATE, -1);
|
|
||||||
}
|
|
||||||
return calendar.getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Date getWeekEndDate() {
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
|
|
||||||
calendar.add(Calendar.DATE, 1);
|
|
||||||
}
|
|
||||||
calendar.add(Calendar.DATE, -1);
|
|
||||||
return calendar.getTime();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
package hu.refilc.naplo.utils;
|
|
||||||
|
|
||||||
import java.time.DayOfWeek;
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
public class Week {
|
|
||||||
private final LocalDate start;
|
|
||||||
private final LocalDate end;
|
|
||||||
|
|
||||||
private Week(LocalDate start, LocalDate end) {
|
|
||||||
this.start = start;
|
|
||||||
this.end = end;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Week current() {
|
|
||||||
return fromDate(LocalDate.now());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Week fromId(int id) {
|
|
||||||
LocalDate _now = getYearStart().plusDays(id * 7L);
|
|
||||||
return new Week(_now.minusDays(_now.getDayOfWeek().getValue() - 1), _now.plusDays(7 - _now.getDayOfWeek().getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Week fromDate(LocalDate date) {
|
|
||||||
|
|
||||||
return new Week(date.minusDays(date.getDayOfWeek().getValue() - 1), date.plusDays(7 - date.getDayOfWeek().getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Week next() {
|
|
||||||
return Week.fromDate(start.plusDays(8));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int id() {
|
|
||||||
return (int) Math.ceil(Duration.between(getYearStart().atStartOfDay(), start.atStartOfDay()).toDays() / 7f);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static LocalDate getYearStart() {
|
|
||||||
LocalDate now = LocalDate.now();
|
|
||||||
LocalDate start = getYearStart(now.getYear());
|
|
||||||
return start.isBefore(now) ? start : getYearStart(now.getYear() -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static LocalDate getYearStart(int year) {
|
|
||||||
LocalDate time = LocalDate.of(year, 9, 1);
|
|
||||||
if (time.getDayOfWeek() == DayOfWeek.SATURDAY)
|
|
||||||
return time.plusDays(2);
|
|
||||||
else if (time.getDayOfWeek() == DayOfWeek.SUNDAY)
|
|
||||||
return time.plusDays(1);
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) return true;
|
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
|
||||||
Week week = (Week) o;
|
|
||||||
return this.id() == week.id();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return id();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,392 +0,0 @@
|
|||||||
package hu.refilc.naplo.widget_timetable;
|
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.appwidget.AppWidgetManager;
|
|
||||||
import android.appwidget.AppWidgetProvider;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.RemoteViews;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import org.joda.time.DateTime;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.time.DayOfWeek;
|
|
||||||
import java.time.format.TextStyle;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
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.MainActivity;
|
|
||||||
import hu.refilc.naplo.R;
|
|
||||||
|
|
||||||
import hu.refilc.naplo.utils.Week;
|
|
||||||
|
|
||||||
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
|
|
||||||
|
|
||||||
import es.antonborri.home_widget.HomeWidgetBackgroundIntent;
|
|
||||||
import es.antonborri.home_widget.HomeWidgetLaunchIntent;
|
|
||||||
import es.antonborri.home_widget.HomeWidgetProvider;
|
|
||||||
|
|
||||||
public class WidgetTimetable extends HomeWidgetProvider {
|
|
||||||
|
|
||||||
private static final String ACTION_WIDGET_CLICK_NAV_LEFT = "list_widget.ACTION_WIDGET_CLICK_NAV_LEFT";
|
|
||||||
private static final String ACTION_WIDGET_CLICK_NAV_RIGHT = "list_widget.ACTION_WIDGET_CLICK_NAV_RIGHT";
|
|
||||||
private static final String ACTION_WIDGET_CLICK_NAV_TODAY = "list_widget.ACTION_WIDGET_CLICK_NAV_TODAY";
|
|
||||||
private static final String ACTION_WIDGET_CLICK_NAV_REFRESH = "list_widget.ACTION_WIDGET_CLICK_NAV_REFRESH";
|
|
||||||
private static final String ACTION_WIDGET_CLICK_BUY_PREMIUM = "list_widget.ACTION_WIDGET_CLICK_BUY_PREMIUM";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds, SharedPreferences widgetData) {
|
|
||||||
for (int i = 0; i < appWidgetIds.length; i++) {
|
|
||||||
RemoteViews views = generateView(context, appWidgetIds[i]);
|
|
||||||
|
|
||||||
if(premiumEnabled(context) && userLoggedIn(context)) {
|
|
||||||
int rday = selectDay(context, appWidgetIds[i], 0, true);
|
|
||||||
views.setTextViewText(R.id.nav_current, convertDayOfWeek(context, rday));
|
|
||||||
}
|
|
||||||
|
|
||||||
pushUpdate(context, views, appWidgetIds[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void pushUpdate(Context context, RemoteViews remoteViews, int appWidgetSingleId) {
|
|
||||||
AppWidgetManager manager = AppWidgetManager.getInstance(context);
|
|
||||||
|
|
||||||
manager.updateAppWidget(appWidgetSingleId, remoteViews);
|
|
||||||
manager.notifyAppWidgetViewDataChanged(appWidgetSingleId, R.id.widget_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RemoteViews generateView(Context context, int appId) {
|
|
||||||
Intent serviceIntent = new Intent(context, WidgetTimetableService.class);
|
|
||||||
serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appId);
|
|
||||||
serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME)));
|
|
||||||
|
|
||||||
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_timetable);
|
|
||||||
|
|
||||||
views.setViewVisibility(R.id.need_premium, View.GONE);
|
|
||||||
views.setViewVisibility(R.id.need_login, View.GONE);
|
|
||||||
views.setViewVisibility(R.id.tt_grid_cont, View.GONE);
|
|
||||||
|
|
||||||
if(!userLoggedIn(context)) {
|
|
||||||
views.setViewVisibility(R.id.need_login, View.VISIBLE);
|
|
||||||
views.setOnClickPendingIntent(R.id.open_login, makePending(context, ACTION_WIDGET_CLICK_BUY_PREMIUM, appId));
|
|
||||||
} else if(premiumEnabled(context)) {
|
|
||||||
views.setViewVisibility(R.id.tt_grid_cont, View.VISIBLE);
|
|
||||||
views.setOnClickPendingIntent(R.id.nav_to_left, makePending(context, ACTION_WIDGET_CLICK_NAV_LEFT, appId));
|
|
||||||
views.setOnClickPendingIntent(R.id.nav_to_right, makePending(context, ACTION_WIDGET_CLICK_NAV_RIGHT, appId));
|
|
||||||
views.setOnClickPendingIntent(R.id.nav_current, makePending(context, ACTION_WIDGET_CLICK_NAV_TODAY, appId));
|
|
||||||
views.setOnClickPendingIntent(R.id.nav_refresh, makePending(context, ACTION_WIDGET_CLICK_NAV_REFRESH, appId));
|
|
||||||
views.setRemoteAdapter(R.id.widget_list, serviceIntent);
|
|
||||||
views.setEmptyView(R.id.widget_list, R.id.empty_view);
|
|
||||||
} else {
|
|
||||||
views.setViewVisibility(R.id.need_premium, View.VISIBLE);
|
|
||||||
views.setOnClickPendingIntent(R.id.buy_premium, makePending(context, ACTION_WIDGET_CLICK_BUY_PREMIUM, appId));
|
|
||||||
}
|
|
||||||
|
|
||||||
return views;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PendingIntent makePending(Context context, String action, int appWidgetId) {
|
|
||||||
Intent activebtnnext = new Intent(context, WidgetTimetable.class);
|
|
||||||
activebtnnext.setAction(action);
|
|
||||||
activebtnnext.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
|
|
||||||
return PendingIntent.getBroadcast(context, appWidgetId, activebtnnext , PendingIntent.FLAG_IMMUTABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
super.onReceive(context, intent);
|
|
||||||
|
|
||||||
if(intent.hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID)) {
|
|
||||||
int appId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
|
|
||||||
RemoteViews views = generateView(context, appId);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if(premiumEnabled(context) && userLoggedIn(context)) {
|
|
||||||
if (intent.getAction().equals(ACTION_WIDGET_CLICK_NAV_LEFT)) {
|
|
||||||
int rday = selectDay(context, appId, -1, false);
|
|
||||||
views.setTextViewText(R.id.nav_current, convertDayOfWeek(context, rday));
|
|
||||||
|
|
||||||
pushUpdate(context, views, appId);
|
|
||||||
} else if (intent.getAction().equals(ACTION_WIDGET_CLICK_NAV_RIGHT)) {
|
|
||||||
int rday = selectDay(context, appId, 1, false);
|
|
||||||
views.setTextViewText(R.id.nav_current, convertDayOfWeek(context, rday));
|
|
||||||
|
|
||||||
pushUpdate(context, views, appId);
|
|
||||||
} else if (intent.getAction().equals(ACTION_WIDGET_CLICK_NAV_TODAY)) {
|
|
||||||
int rday = getToday(context);
|
|
||||||
setSelectedDay(context, appId, rday);
|
|
||||||
|
|
||||||
views.setTextViewText(R.id.nav_current, convertDayOfWeek(context, rday));
|
|
||||||
|
|
||||||
pushUpdate(context, views, appId);
|
|
||||||
} else if (intent.getAction().equals(ACTION_WIDGET_CLICK_NAV_REFRESH)) {
|
|
||||||
PendingIntent pendingIntent = HomeWidgetLaunchIntent.INSTANCE.getActivity(context, MainActivity.class, Uri.parse("timetable://refresh"));
|
|
||||||
pendingIntent.send();
|
|
||||||
} else if (intent.getAction().equals("android.appwidget.action.APPWIDGET_DELETED")) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
dbManager.deleteWidget(appId);
|
|
||||||
dbManager.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(intent.getAction().equals(ACTION_WIDGET_CLICK_BUY_PREMIUM)) {
|
|
||||||
PendingIntent pendingIntent = HomeWidgetLaunchIntent.INSTANCE.getActivity(context, MainActivity.class, Uri.parse("settings://premium"));
|
|
||||||
pendingIntent.send();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String convertDayOfWeek(Context context, int rday) {
|
|
||||||
|
|
||||||
/*if(rday == -1) return DayOfWeek.of(1).getDisplayName(TextStyle.FULL, new Locale("hu", "HU"));
|
|
||||||
|
|
||||||
String dayOfWeek = DayOfWeek.of(rday + 1).getDisplayName(TextStyle.FULL, new Locale("hu", "HU"));*/
|
|
||||||
|
|
||||||
String dayOfWeek = "Unknown";
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
Locale loc = getLocale(context);
|
|
||||||
|
|
||||||
if (rday == -1)
|
|
||||||
return DayOfWeek.of(1).getDisplayName(TextStyle.FULL, loc);
|
|
||||||
|
|
||||||
dayOfWeek = DayOfWeek.of(rday + 1).getDisplayName(TextStyle.FULL, loc);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dayOfWeek.substring(0, 1).toUpperCase() + dayOfWeek.substring(1).toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setSelectedDay(Context context, int wid, int day) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
dbManager.update(wid, day);
|
|
||||||
dbManager.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getToday(Context context) {
|
|
||||||
int rday = new DateTime().getDayOfWeek() - 1;
|
|
||||||
List<JSONArray> s = genJsonDays(context);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if(checkIsAfter(s, rday)) rday += 1;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return retDay(rday, s.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int selectDay(Context context, int wid, int add, Boolean afterSubjects) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
Cursor cursor = dbManager.fetchWidget(wid);
|
|
||||||
|
|
||||||
List<JSONArray> s = genJsonDays(context);
|
|
||||||
int retday = new DateTime().getDayOfWeek() - 1;
|
|
||||||
|
|
||||||
if(cursor.getCount() != 0) retday = retDay(cursor.getInt(1) + add, s.size());
|
|
||||||
|
|
||||||
if(afterSubjects) if(checkIsAfter(s, retday)) retday += 1;
|
|
||||||
retday = retDay(retday, s.size());
|
|
||||||
|
|
||||||
if(cursor.getCount() == 0) dbManager.insertSelDay(wid, retday);
|
|
||||||
else dbManager.update(wid, retday);
|
|
||||||
|
|
||||||
dbManager.close();
|
|
||||||
|
|
||||||
return retday;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean checkIsAfter(List<JSONArray> s, int retday) throws Exception {
|
|
||||||
retday = retDay(retday, s.size());
|
|
||||||
|
|
||||||
String vegIdopont = s.get(retday).getJSONObject(s.get(retday).length() - 1).getString("VegIdopont");
|
|
||||||
|
|
||||||
return new DateTime().isAfter(new DateTime(vegIdopont));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int retDay(int retday, int size) {
|
|
||||||
if (retday < 0) retday = size - 1;
|
|
||||||
else if (retday > size - 1) retday = 0;
|
|
||||||
|
|
||||||
return retday;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<JSONArray> genJsonDays(Context context) {
|
|
||||||
List<JSONArray> genDays = new ArrayList<>();
|
|
||||||
Map<String, JSONArray> dayMap = new HashMap<>();
|
|
||||||
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
Cursor ct = dbManager.fetchTimetable();
|
|
||||||
|
|
||||||
if (ct.getCount() == 0) {
|
|
||||||
return genDays;
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject fetchedTimetable = new JSONObject(ct.getString(0));
|
|
||||||
String currentWeek = String.valueOf(Week.current().id());
|
|
||||||
JSONArray week = fetchedTimetable.getJSONArray(currentWeek);
|
|
||||||
|
|
||||||
// Organize lessons into dates
|
|
||||||
for (int i = 0; i < week.length(); i++) {
|
|
||||||
try {
|
|
||||||
JSONObject entry = week.getJSONObject(i);
|
|
||||||
String date = entry.getString("Datum");
|
|
||||||
dayMap.computeIfAbsent(date, k -> new JSONArray()).put(entry);
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
genDays.addAll(dayMap.values());
|
|
||||||
|
|
||||||
// Sort the 'genDays' list of JSON based on the start time of the first entry
|
|
||||||
genDays.sort((day1, day2) -> {
|
|
||||||
try {
|
|
||||||
// Extract the start time of the first entry in each day's JSON
|
|
||||||
String startTime1 = day1.getJSONObject(0).getString("KezdetIdopont");
|
|
||||||
String startTime2 = day2.getJSONObject(0).getString("KezdetIdopont");
|
|
||||||
// Compare the start times and return the result for sorting
|
|
||||||
return startTime1.compareTo(startTime2);
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
dbManager.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
return genDays;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String zeroPad(int value, int padding){
|
|
||||||
StringBuilder b = new StringBuilder();
|
|
||||||
b.append(value);
|
|
||||||
while(b.length() < padding){
|
|
||||||
b.insert(0,"0");
|
|
||||||
}
|
|
||||||
return b.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Locale getLocale(Context context) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
String loc = dbManager.fetchLocale().getString(0);
|
|
||||||
dbManager.close();
|
|
||||||
|
|
||||||
if(loc.equals("hu") || loc.equals("de")) {
|
|
||||||
return new Locale(loc, loc.toUpperCase());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Locale("en", "GB");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean premiumEnabled(Context context) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
String premium_token = dbManager.fetchPremiumToken().getString(0);
|
|
||||||
String premium_scopes_raw = dbManager.fetchPremiumScopes().getString(0);
|
|
||||||
dbManager.close();
|
|
||||||
|
|
||||||
JSONArray arr = new JSONArray(premium_scopes_raw);
|
|
||||||
List<String> premium_scopes = new ArrayList<>();
|
|
||||||
for(int i = 0; i < arr.length(); i++){
|
|
||||||
String scope = arr.getString(i);
|
|
||||||
premium_scopes.add(scope.substring(scope.lastIndexOf('.') + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!premium_token.equals("") && (premium_scopes.contains("*") || premium_scopes.contains("TIMETALBE_WIDGET"))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean userLoggedIn(Context context) {
|
|
||||||
return !lastUserId(context).equals("");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String lastUserId(Context context) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
Cursor cursor = dbManager.fetchLastUser();
|
|
||||||
dbManager.close();
|
|
||||||
|
|
||||||
if(cursor != null && !cursor.getString(0).equals("")) {
|
|
||||||
String last_user = cursor.getString(0);
|
|
||||||
return last_user;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnabled(Context context) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisabled(Context context) {
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,356 +0,0 @@
|
|||||||
package hu.refilc.naplo.widget_timetable;
|
|
||||||
|
|
||||||
import android.appwidget.AppWidgetManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.RemoteViews;
|
|
||||||
import android.widget.RemoteViewsService;
|
|
||||||
|
|
||||||
import org.joda.time.DateTime;
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import hu.refilc.naplo.database.DBManager;
|
|
||||||
import hu.refilc.naplo.R;
|
|
||||||
|
|
||||||
public class WidgetTimetableDataProvider implements RemoteViewsService.RemoteViewsFactory {
|
|
||||||
|
|
||||||
private Context context;
|
|
||||||
private int appWidgetId;
|
|
||||||
|
|
||||||
private int rday = 0;
|
|
||||||
|
|
||||||
private int theme;
|
|
||||||
|
|
||||||
private Integer[] colorValues;
|
|
||||||
|
|
||||||
List<Lesson> day_subjects = new ArrayList<>();
|
|
||||||
List<Integer> lessonIndexes = new ArrayList<>();
|
|
||||||
|
|
||||||
Item witem;
|
|
||||||
|
|
||||||
/* Default values */
|
|
||||||
|
|
||||||
static class Item {
|
|
||||||
int Layout;
|
|
||||||
|
|
||||||
int NumVisibility;
|
|
||||||
int NameVisibility;
|
|
||||||
int NameNodescVisibility;
|
|
||||||
int DescVisibility;
|
|
||||||
int RoomVisibility;
|
|
||||||
int TimeVisibility;
|
|
||||||
|
|
||||||
int NumColor;
|
|
||||||
int NameColor;
|
|
||||||
int NameNodescColor;
|
|
||||||
int DescColor;
|
|
||||||
|
|
||||||
Integer[] NameNodescPadding = {0, 0, 0, 0};
|
|
||||||
|
|
||||||
public Item(int Layout, int NumVisibility,int NameVisibility,int NameNodescVisibility,int DescVisibility,int RoomVisibility,int TimeVisibility,int NumColor,int NameColor,int NameNodescColor,int DescColor) {
|
|
||||||
this.Layout = Layout;
|
|
||||||
this.NumVisibility = NumVisibility;
|
|
||||||
this.NameVisibility = NameVisibility;
|
|
||||||
this.NameNodescVisibility = NameNodescVisibility;
|
|
||||||
this.DescVisibility = DescVisibility;
|
|
||||||
this.RoomVisibility = RoomVisibility;
|
|
||||||
this.TimeVisibility = TimeVisibility;
|
|
||||||
|
|
||||||
this.NumColor = NumColor;
|
|
||||||
this.NameColor = NameColor;
|
|
||||||
this.NameNodescColor = NameNodescColor;
|
|
||||||
this.DescColor = DescColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static class Lesson {
|
|
||||||
String status;
|
|
||||||
String lessonIndex;
|
|
||||||
String lessonName;
|
|
||||||
String lessonTopic;
|
|
||||||
String lessonRoom;
|
|
||||||
long lessonStart;
|
|
||||||
long lessonEnd;
|
|
||||||
String substituteTeacher;
|
|
||||||
|
|
||||||
public Lesson(String status, String lessonIndex,String lessonName,String lessonTopic, String lessonRoom,long lessonStart,long lessonEnd,String substituteTeacher) {
|
|
||||||
this.status = status;
|
|
||||||
this.lessonIndex = lessonIndex;
|
|
||||||
this.lessonName = lessonName;
|
|
||||||
this.lessonTopic = lessonTopic;
|
|
||||||
this.lessonRoom = lessonRoom;
|
|
||||||
this.lessonStart = lessonStart;
|
|
||||||
this.lessonEnd = lessonEnd;
|
|
||||||
this.substituteTeacher = substituteTeacher;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer[] itemNameNodescPadding = {0, 0, 0, 0};
|
|
||||||
|
|
||||||
public WidgetTimetableDataProvider(Context context, Intent intent) {
|
|
||||||
this.context = context;
|
|
||||||
this.appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
|
|
||||||
|
|
||||||
this.theme = getThemeAccent(context);
|
|
||||||
|
|
||||||
this.colorValues = new Integer[]{R.color.filc,
|
|
||||||
R.color.blue_shade300,
|
|
||||||
R.color.green_shade300,
|
|
||||||
R.color.lime_shade300,
|
|
||||||
R.color.yellow_shade300,
|
|
||||||
R.color.orange_shade300,
|
|
||||||
R.color.red_shade300,
|
|
||||||
R.color.pink_shade300,
|
|
||||||
R.color.purple_shade300};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
initData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDataSetChanged() {
|
|
||||||
initData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount() {
|
|
||||||
|
|
||||||
return day_subjects.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLayout(final RemoteViews view) {
|
|
||||||
/* Visibilities */
|
|
||||||
view.setViewVisibility(R.id.tt_item_num, witem.NumVisibility);
|
|
||||||
view.setViewVisibility(R.id.tt_item_name, witem.NameVisibility);
|
|
||||||
view.setViewVisibility(R.id.tt_item_name_nodesc, witem.NameNodescVisibility);
|
|
||||||
view.setViewVisibility(R.id.tt_item_desc, witem.DescVisibility);
|
|
||||||
view.setViewVisibility(R.id.tt_item_room, witem.RoomVisibility);
|
|
||||||
view.setViewVisibility(R.id.tt_item_time, witem.TimeVisibility);
|
|
||||||
|
|
||||||
/* backgroundResources */
|
|
||||||
view.setInt(R.id.main_lay, "setBackgroundResource", witem.Layout);
|
|
||||||
|
|
||||||
/* Paddings */
|
|
||||||
view.setViewPadding(R.id.tt_item_name_nodesc, witem.NameNodescPadding[0], witem.NameNodescPadding[1], witem.NameNodescPadding[2], witem.NameNodescPadding[3]);
|
|
||||||
|
|
||||||
/* Text Colors */
|
|
||||||
view.setInt(R.id.tt_item_num, "setTextColor", getColor(context, witem.NumColor));
|
|
||||||
view.setInt(R.id.tt_item_name, "setTextColor", getColor(context, witem.NameColor));
|
|
||||||
view.setInt(R.id.tt_item_name_nodesc, "setTextColor", getColor(context, witem.NameNodescColor));
|
|
||||||
view.setInt(R.id.tt_item_desc, "setTextColor", getColor(context, witem.DescColor));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getColor(Context context, int color) {
|
|
||||||
return context.getResources().getColor(color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RemoteViews getViewAt(int position) {
|
|
||||||
RemoteViews view = new RemoteViews(context.getPackageName(), R.layout.timetable_item);
|
|
||||||
|
|
||||||
witem = defaultItem(theme);
|
|
||||||
|
|
||||||
Lesson curr_subject = day_subjects.get(position);
|
|
||||||
|
|
||||||
if (curr_subject.status.equals("empty")) {
|
|
||||||
witem.NumColor = R.color.text_miss_num;
|
|
||||||
|
|
||||||
witem.TimeVisibility = View.GONE;
|
|
||||||
witem.RoomVisibility = View.GONE;
|
|
||||||
|
|
||||||
witem.NameNodescColor = R.color.text_miss;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!curr_subject.substituteTeacher.equals("null")) {
|
|
||||||
witem.NumColor = R.color.yellow;
|
|
||||||
witem.Layout = R.drawable.card_layout_tile_helyetesitett;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (curr_subject.status.equals("Elmaradt")) {
|
|
||||||
witem.NumColor = R.color.red;
|
|
||||||
witem.Layout = R.drawable.card_layout_tile_elmarad;
|
|
||||||
} else if (curr_subject.status.equals("TanevRendjeEsemeny")) {
|
|
||||||
witem.NumVisibility = View.GONE;
|
|
||||||
witem.TimeVisibility = View.GONE;
|
|
||||||
witem.RoomVisibility = View.GONE;
|
|
||||||
|
|
||||||
witem.NameNodescPadding[0] = 50;
|
|
||||||
witem.NameNodescPadding[2] = 50;
|
|
||||||
|
|
||||||
witem.NameNodescColor = R.color.text_miss;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (curr_subject.lessonTopic.equals("null")) {
|
|
||||||
witem.DescVisibility = View.GONE;
|
|
||||||
witem.NameVisibility = View.GONE;
|
|
||||||
|
|
||||||
witem.NameNodescVisibility = View.VISIBLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
setLayout(view);
|
|
||||||
|
|
||||||
String lessonIndexTrailing = curr_subject.lessonIndex.equals("+") ? "" : ".";
|
|
||||||
|
|
||||||
view.setTextViewText(R.id.tt_item_num, curr_subject.lessonIndex + lessonIndexTrailing);
|
|
||||||
view.setTextViewText(R.id.tt_item_name, curr_subject.lessonName);
|
|
||||||
view.setTextViewText(R.id.tt_item_name_nodesc, curr_subject.lessonName);
|
|
||||||
view.setTextViewText(R.id.tt_item_desc, curr_subject.lessonTopic);
|
|
||||||
view.setTextViewText(R.id.tt_item_room, curr_subject.lessonRoom);
|
|
||||||
if(curr_subject.lessonStart != 0 && curr_subject.lessonEnd != 0)
|
|
||||||
view.setTextViewText(R.id.tt_item_time, WidgetTimetable.zeroPad(new DateTime(curr_subject.lessonStart).getHourOfDay(), 2) + ":" + WidgetTimetable.zeroPad(new DateTime(curr_subject.lessonStart).getMinuteOfHour(), 2) +
|
|
||||||
"\n" + WidgetTimetable.zeroPad(new DateTime(curr_subject.lessonEnd).getHourOfDay(), 2) + ":" + WidgetTimetable.zeroPad(new DateTime(curr_subject.lessonEnd).getMinuteOfHour(),2));
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RemoteViews getLoadingView() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getViewTypeCount() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getItemId(int position) {
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasStableIds() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initData() {
|
|
||||||
|
|
||||||
theme = getThemeAccent(context);
|
|
||||||
|
|
||||||
rday = WidgetTimetable.selectDay(context, appWidgetId, 0, false);
|
|
||||||
|
|
||||||
day_subjects.clear();
|
|
||||||
lessonIndexes.clear();
|
|
||||||
|
|
||||||
try {
|
|
||||||
List<JSONArray> arr = WidgetTimetable.genJsonDays(context);
|
|
||||||
|
|
||||||
if(arr.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
JSONArray arr_lessons = WidgetTimetable.genJsonDays(context).get(rday);
|
|
||||||
|
|
||||||
for (int i = 0; i < arr_lessons.length(); i++) {
|
|
||||||
JSONObject obj_lessons = arr_lessons.getJSONObject(i);
|
|
||||||
|
|
||||||
day_subjects.add(jsonToLesson(obj_lessons));
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(day_subjects.size() > 0) {
|
|
||||||
Collections.sort(day_subjects, new Comparator<Lesson>() {
|
|
||||||
public int compare(Lesson o1, Lesson o2) {
|
|
||||||
return new DateTime(o1.lessonStart).compareTo(new DateTime(o2.lessonStart));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (int i = 0; i < day_subjects.size(); i++) {
|
|
||||||
if(!day_subjects.get(i).lessonIndex.equals("+")) {
|
|
||||||
lessonIndexes.add(Integer.valueOf(day_subjects.get(i).lessonIndex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(lessonIndexes.size() > 0) {
|
|
||||||
|
|
||||||
int lessonsChecked = Collections.min(lessonIndexes);
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
while(lessonsChecked < Collections.max(lessonIndexes)) {
|
|
||||||
if(!lessonIndexes.contains(lessonsChecked)) {
|
|
||||||
day_subjects.add(i, emptyLesson(lessonsChecked));
|
|
||||||
}
|
|
||||||
lessonsChecked++;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getThemeAccent(Context context) {
|
|
||||||
DBManager dbManager = new DBManager(context.getApplicationContext());
|
|
||||||
|
|
||||||
try {
|
|
||||||
dbManager.open();
|
|
||||||
Cursor cursor = dbManager.fetchTheme();
|
|
||||||
dbManager.close();
|
|
||||||
|
|
||||||
return cursor.getInt(1);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item defaultItem(int theme) {
|
|
||||||
return new Item(
|
|
||||||
R.drawable.card_layout_tile,
|
|
||||||
View.VISIBLE,
|
|
||||||
View.VISIBLE,
|
|
||||||
View.INVISIBLE,
|
|
||||||
View.VISIBLE,
|
|
||||||
View.VISIBLE,
|
|
||||||
View.VISIBLE,
|
|
||||||
colorValues[theme >= colorValues.length ? 0 : theme],
|
|
||||||
R.color.text,
|
|
||||||
R.color.text,
|
|
||||||
R.color.text_desc
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Lesson emptyLesson(int lessonIndex) {
|
|
||||||
return new Lesson("empty", String.valueOf(lessonIndex), "Lyukasóra", "null", "null", 0, 0, "null");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Lesson jsonToLesson(JSONObject json) {
|
|
||||||
try {
|
|
||||||
String name = json.getString("Nev");
|
|
||||||
name = name.substring(0, 1).toUpperCase() + name.substring(1); // Capitalize name
|
|
||||||
return new Lesson(
|
|
||||||
json.getJSONObject("Allapot").getString("Nev"),
|
|
||||||
!json.getString("Oraszam").equals("null") ? json.getString("Oraszam") : "+",
|
|
||||||
name,
|
|
||||||
json.getString("Tema"),
|
|
||||||
json.getString("TeremNeve"),
|
|
||||||
new DateTime(json.getString("KezdetIdopont")).getMillis(),
|
|
||||||
new DateTime(json.getString("VegIdopont")).getMillis(),
|
|
||||||
json.getString("HelyettesTanarNeve")
|
|
||||||
);
|
|
||||||
}catch (Exception e) {
|
|
||||||
Log.d("Filc", "exception: " + e);
|
|
||||||
};
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
package hu.refilc.naplo.widget_timetable;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.widget.RemoteViewsService;
|
|
||||||
|
|
||||||
public class WidgetTimetableService extends RemoteViewsService {
|
|
||||||
@Override
|
|
||||||
public RemoteViewsFactory onGetViewFactory(Intent intent) {
|
|
||||||
return new WidgetTimetableDataProvider(getApplicationContext(), intent);
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 69 B |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 69 B |
Before Width: | Height: | Size: 185 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 185 KiB |
@ -1,8 +0,0 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536M \
|
|
||||||
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
|
|
||||||
--add-opens=java.base/java.lang=ALL-UNNAMED \
|
|
||||||
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
|
|
||||||
--add-opens=java.base/java.io=ALL-UNNAMED \
|
|
||||||
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
|
|
||||||
android.useAndroidX=true
|
|
||||||
android.enableJetifier=true
|
|
@ -1,11 +0,0 @@
|
|||||||
include ':app'
|
|
||||||
|
|
||||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
|
||||||
def properties = new Properties()
|
|
||||||
|
|
||||||
assert localPropertiesFile.exists()
|
|
||||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
|
||||||
|
|
||||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
|
||||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
|
||||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
|
@ -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.
|
|
Before Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 735 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 19 KiB |
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
flutter build apk --release --dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1) --no-tree-shake-icons
|
|
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,25 +0,0 @@
|
|||||||
import UIKit
|
|
||||||
import Flutter
|
|
||||||
|
|
||||||
@UIApplicationMain
|
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
|
||||||
override func application(
|
|
||||||
_ application: UIApplication,
|
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
||||||
) -> Bool {
|
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
|
||||||
|
|
||||||
// here, Without this code the task will not work.
|
|
||||||
//SwiftFlutterForegroundTaskPlugin.setPluginRegistrantCallback(registerPlugins)
|
|
||||||
if #available(iOS 10.0, *) {
|
|
||||||
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// here
|
|
||||||
func registerPlugins(registry: FlutterPluginRegistry) {
|
|
||||||
GeneratedPluginRegistrant.register(with: registry)
|
|
||||||
}
|
|
Before Width: | Height: | Size: 69 B |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 17 KiB |
@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
|
||||||
<array>
|
|
||||||
<string>com.transistorsoft.fetch</string>
|
|
||||||
</array>
|
|
||||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
|
||||||
<true/>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>reFilc</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
|
||||||
<false/>
|
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>https</string>
|
|
||||||
<string>http</string>
|
|
||||||
</array>
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
|
||||||
<true/>
|
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
|
||||||
<string>The app requires the photo library to set a custom profile picture.</string>
|
|
||||||
<key>NSSupportsLiveActivities</key>
|
|
||||||
<true/>
|
|
||||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
|
||||||
<true/>
|
|
||||||
<key>UIBackgroundModes</key>
|
|
||||||
<array>
|
|
||||||
<string>fetch</string>
|
|
||||||
<string>processing</string>
|
|
||||||
</array>
|
|
||||||
<key>UILaunchStoryboardName</key>
|
|
||||||
<string>LaunchScreen</string>
|
|
||||||
<key>UIMainStoryboardFile</key>
|
|
||||||
<string>Main</string>
|
|
||||||
<key>UIStatusBarHidden</key>
|
|
||||||
<false/>
|
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
||||||
<false/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Before Width: | Height: | Size: 577 KiB |
@ -1,31 +0,0 @@
|
|||||||
import Foundation
|
|
||||||
|
|
||||||
class LessonData {
|
|
||||||
var color: String
|
|
||||||
var icon: String
|
|
||||||
var index: String
|
|
||||||
var title: String
|
|
||||||
var subtitle: String
|
|
||||||
var description: String
|
|
||||||
var startDate: Date
|
|
||||||
var endDate: Date
|
|
||||||
var date: ClosedRange<Date>
|
|
||||||
var nextSubject: String
|
|
||||||
var nextRoom: String
|
|
||||||
|
|
||||||
init?() {
|
|
||||||
let sharedDefault = UserDefaults(suiteName: "group.refilc.livecard")!
|
|
||||||
|
|
||||||
self.color = sharedDefault.string(forKey: "color")!
|
|
||||||
self.icon = sharedDefault.string(forKey: "icon")!
|
|
||||||
self.index = sharedDefault.string(forKey: "index")!
|
|
||||||
self.title = sharedDefault.string(forKey: "title")!
|
|
||||||
self.subtitle = sharedDefault.string(forKey: "subtitle")!
|
|
||||||
self.description = sharedDefault.string(forKey: "description")!
|
|
||||||
self.startDate = Date(timeIntervalSince1970: Double(sharedDefault.string(forKey: "startDate")!)! / 1000)
|
|
||||||
self.endDate = Date(timeIntervalSince1970: Double(sharedDefault.string(forKey: "endDate")!)! / 1000)
|
|
||||||
date = self.startDate...self.endDate
|
|
||||||
self.nextSubject = sharedDefault.string(forKey: "nextSubject")!
|
|
||||||
self.nextRoom = sharedDefault.string(forKey: "nextRoom")!
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,186 +0,0 @@
|
|||||||
import ActivityKit
|
|
||||||
import WidgetKit
|
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
@main
|
|
||||||
struct Widgets: WidgetBundle {
|
|
||||||
var body: some Widget {
|
|
||||||
if #available(iOS 16.1, *) {
|
|
||||||
LiveCardWidget()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Color Converter
|
|
||||||
extension Color {
|
|
||||||
init(hex: String, alpha: Double = 1.0) {
|
|
||||||
var hexValue = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
|
|
||||||
|
|
||||||
if hexValue.hasPrefix("#") {
|
|
||||||
hexValue.remove(at: hexValue.startIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
var rgbValue: UInt64 = 0
|
|
||||||
Scanner(string: hexValue).scanHexInt64(&rgbValue)
|
|
||||||
|
|
||||||
let red = Double((rgbValue & 0xFF0000) >> 16) / 255.0
|
|
||||||
let green = Double((rgbValue & 0x00FF00) >> 8) / 255.0
|
|
||||||
let blue = Double(rgbValue & 0x0000FF) / 255.0
|
|
||||||
|
|
||||||
self.init(
|
|
||||||
.sRGB,
|
|
||||||
red: red,
|
|
||||||
green: green,
|
|
||||||
blue: blue,
|
|
||||||
opacity: alpha
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// We need to redefined live activities pipe
|
|
||||||
struct LiveActivitiesAppAttributes: ActivityAttributes, Identifiable {
|
|
||||||
public struct ContentState: Codable, Hashable { }
|
|
||||||
|
|
||||||
var id = UUID()
|
|
||||||
}
|
|
||||||
|
|
||||||
struct LockScreenLiveActivityView: View {
|
|
||||||
let context: ActivityViewContext<LiveActivitiesAppAttributes>
|
|
||||||
|
|
||||||
let lesson = LessonData()
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
HStack(alignment: .center) {
|
|
||||||
Image(systemName: lesson!.icon)
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width: CGFloat(30), height: CGFloat(30))
|
|
||||||
.padding(.leading, CGFloat(24))
|
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
|
||||||
HStack(alignment: .center) {
|
|
||||||
Text(lesson!.index + lesson!.title)
|
|
||||||
.font(.title3)
|
|
||||||
.bold()
|
|
||||||
|
|
||||||
Text(lesson!.subtitle)
|
|
||||||
.font(.subheadline)
|
|
||||||
.padding(.trailing, 12)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lesson!.description != "") {
|
|
||||||
Text(lesson!.description)
|
|
||||||
.font(.subheadline)
|
|
||||||
}
|
|
||||||
|
|
||||||
HStack {
|
|
||||||
Image(systemName: "arrow.right")
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width: CGFloat(8), height: CGFloat(8))
|
|
||||||
Text(lesson!.nextSubject)
|
|
||||||
.font(.caption)
|
|
||||||
Text(lesson!.nextRoom)
|
|
||||||
.font(.caption2)
|
|
||||||
}
|
|
||||||
}.padding(15)
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.frame(width: 85)
|
|
||||||
.font(.title)
|
|
||||||
.monospacedDigit()
|
|
||||||
.padding(.trailing, CGFloat(24))
|
|
||||||
}
|
|
||||||
.activityBackgroundTint(
|
|
||||||
lesson!.color == "#676767"
|
|
||||||
? nil
|
|
||||||
: Color(hex: lesson!.color)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(iOSApplicationExtension 16.1, *)
|
|
||||||
struct LiveCardWidget: Widget {
|
|
||||||
var body: some WidgetConfiguration {
|
|
||||||
/// Live Activity Notification
|
|
||||||
ActivityConfiguration(for: LiveActivitiesAppAttributes.self) { context in
|
|
||||||
LockScreenLiveActivityView(context: context)
|
|
||||||
/// Dynamic Island
|
|
||||||
} dynamicIsland: { context in
|
|
||||||
let lesson = LessonData()
|
|
||||||
|
|
||||||
/// Expanded
|
|
||||||
return DynamicIsland {
|
|
||||||
DynamicIslandExpandedRegion(.leading) {
|
|
||||||
VStack {
|
|
||||||
Spacer()
|
|
||||||
Image(systemName: lesson!.icon)
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width: CGFloat(30), height: CGFloat(30))
|
|
||||||
.padding(.leading, CGFloat(6))
|
|
||||||
.padding(.bottom, CGFloat(6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DynamicIslandExpandedRegion(.center) {
|
|
||||||
VStack(alignment: .leading) {
|
|
||||||
Text(lesson!.index + lesson!.title)
|
|
||||||
.lineLimit(1)
|
|
||||||
.font(.title3)
|
|
||||||
.bold()
|
|
||||||
|
|
||||||
Text(lesson!.description)
|
|
||||||
.lineLimit(2)
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DynamicIslandExpandedRegion(.trailing) {
|
|
||||||
VStack {
|
|
||||||
Spacer()
|
|
||||||
Text(lesson!.subtitle)
|
|
||||||
.lineLimit(1)
|
|
||||||
.font(.subheadline)
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Compact
|
|
||||||
} compactLeading: {
|
|
||||||
Label {
|
|
||||||
Text(lesson!.title)
|
|
||||||
} icon: {
|
|
||||||
Image(systemName: lesson!.icon)
|
|
||||||
}
|
|
||||||
.font(.caption2)
|
|
||||||
} compactTrailing: {
|
|
||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.frame(width: 40)
|
|
||||||
.font(.caption2)
|
|
||||||
|
|
||||||
/// Collapsed
|
|
||||||
} minimal: {
|
|
||||||
VStack(alignment: .center) {
|
|
||||||
Image(systemName: lesson!.icon)
|
|
||||||
.resizable()
|
|
||||||
.aspectRatio(contentMode: .fit)
|
|
||||||
.frame(width: CGFloat(12), height: CGFloat(12))
|
|
||||||
|
|
||||||
Text(timerInterval: lesson!.date, countsDown: true)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.monospacedDigit()
|
|
||||||
.font(.system(size: CGFloat(10)))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.keylineTint(
|
|
||||||
lesson!.color == "#676767"
|
|
||||||
? nil
|
|
||||||
: Color(hex: lesson!.color)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,251 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:filcnaplo/models/ad.dart';
|
|
||||||
import 'package:filcnaplo/models/config.dart';
|
|
||||||
import 'package:filcnaplo/models/news.dart';
|
|
||||||
import 'package:filcnaplo/models/release.dart';
|
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:filcnaplo/models/shared_theme.dart';
|
|
||||||
import 'package:filcnaplo/models/supporter.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/school.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
|
||||||
|
|
||||||
class FilcAPI {
|
|
||||||
// API base
|
|
||||||
static const baseUrl = "https://api.refilc.hu";
|
|
||||||
|
|
||||||
// Public API
|
|
||||||
static const schoolList = "$baseUrl/v1/public/school-list";
|
|
||||||
static const news = "$baseUrl/v1/public/news";
|
|
||||||
static const supporters = "$baseUrl/v1/public/supporters";
|
|
||||||
|
|
||||||
// Private API
|
|
||||||
static const ads = "$baseUrl/v1/private/ads";
|
|
||||||
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 premiumScopesApi = "https://api.filcnaplo.hu/premium/scopes";
|
|
||||||
|
|
||||||
// Updates
|
|
||||||
static const repo = "refilc/naplo";
|
|
||||||
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 Future<bool> checkConnectivity() async =>
|
|
||||||
(await Connectivity().checkConnectivity()) != ConnectivityResult.none;
|
|
||||||
|
|
||||||
static Future<List<School>?> getSchools() async {
|
|
||||||
try {
|
|
||||||
http.Response res = await http.get(Uri.parse(schoolList));
|
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
List<School> schools = (jsonDecode(res.body) as List)
|
|
||||||
.cast<Map>()
|
|
||||||
.map((json) => School.fromJson(json))
|
|
||||||
.toList();
|
|
||||||
schools.add(School(
|
|
||||||
city: "Tiszabura",
|
|
||||||
instituteCode: "supporttest-reni-tiszabura-teszt01",
|
|
||||||
name: "FILC Éles Reni tiszabura-teszt",
|
|
||||||
));
|
|
||||||
return schools;
|
|
||||||
} else {
|
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
|
||||||
}
|
|
||||||
} on Exception catch (error, stacktrace) {
|
|
||||||
log("ERROR: FilcAPI.getSchools: $error $stacktrace");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<Config?> getConfig(SettingsProvider settings) async {
|
|
||||||
final userAgent = SettingsProvider.defaultSettings().config.userAgent;
|
|
||||||
|
|
||||||
Map<String, String> headers = {
|
|
||||||
"x-filc-id": settings.xFilcId,
|
|
||||||
"user-agent": userAgent,
|
|
||||||
};
|
|
||||||
|
|
||||||
log("[CONFIG] x-filc-id: \"${settings.xFilcId}\"");
|
|
||||||
log("[CONFIG] user-agent: \"$userAgent\"");
|
|
||||||
|
|
||||||
try {
|
|
||||||
http.Response res = await http.get(Uri.parse(config), headers: headers);
|
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
if (kDebugMode) {
|
|
||||||
print(jsonDecode(res.body));
|
|
||||||
}
|
|
||||||
return Config.fromJson(jsonDecode(res.body));
|
|
||||||
} else if (res.statusCode == 429) {
|
|
||||||
res = await http.get(Uri.parse(config));
|
|
||||||
if (res.statusCode == 200) return Config.fromJson(jsonDecode(res.body));
|
|
||||||
}
|
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
|
||||||
} on Exception catch (error, stacktrace) {
|
|
||||||
log("ERROR: FilcAPI.getConfig: $error $stacktrace");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<List<News>?> getNews() async {
|
|
||||||
try {
|
|
||||||
http.Response res = await http.get(Uri.parse(news));
|
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
return (jsonDecode(res.body) as List)
|
|
||||||
.cast<Map>()
|
|
||||||
.map((e) => News.fromJson(e))
|
|
||||||
.toList();
|
|
||||||
} else {
|
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
|
||||||
}
|
|
||||||
} on Exception catch (error, stacktrace) {
|
|
||||||
log("ERROR: FilcAPI.getNews: $error $stacktrace");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<Supporters?> getSupporters() async {
|
|
||||||
try {
|
|
||||||
http.Response res = await http.get(Uri.parse(supporters));
|
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
return Supporters.fromJson(jsonDecode(res.body));
|
|
||||||
} else {
|
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
|
||||||
}
|
|
||||||
} on Exception catch (error, stacktrace) {
|
|
||||||
log("ERROR: FilcAPI.getSupporters: $error $stacktrace");
|
|
||||||
}
|
|
||||||
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 {
|
|
||||||
try {
|
|
||||||
http.Response res = await http.get(Uri.parse(releases));
|
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
|
||||||
return (jsonDecode(res.body) as List)
|
|
||||||
.cast<Map>()
|
|
||||||
.map((e) => Release.fromJson(e))
|
|
||||||
.toList();
|
|
||||||
} else {
|
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
|
||||||
}
|
|
||||||
} on Exception catch (error, stacktrace) {
|
|
||||||
log("ERROR: FilcAPI.getReleases: $error $stacktrace");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<http.StreamedResponse?> downloadRelease(
|
|
||||||
ReleaseDownload release) {
|
|
||||||
try {
|
|
||||||
var client = http.Client();
|
|
||||||
var request = http.Request('GET', Uri.parse(release.url));
|
|
||||||
return client.send(request);
|
|
||||||
} on Exception catch (error, stacktrace) {
|
|
||||||
log("ERROR: FilcAPI.downloadRelease: $error $stacktrace");
|
|
||||||
return Future.value(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<void> sendReport(ErrorReport report) async {
|
|
||||||
try {
|
|
||||||
http.Response res = await http.post(Uri.parse(reportApi), body: {
|
|
||||||
"os": report.os,
|
|
||||||
"version": report.version,
|
|
||||||
"error": report.error,
|
|
||||||
"stack_trace": report.stack,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.statusCode != 200) {
|
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
|
||||||
}
|
|
||||||
} on Exception catch (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();
|
|
||||||
|
|
||||||
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.addSharedTheme: $error $stacktrace");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ErrorReport {
|
|
||||||
String stack;
|
|
||||||
String os;
|
|
||||||
String version;
|
|
||||||
String error;
|
|
||||||
|
|
||||||
ErrorReport({
|
|
||||||
required this.stack,
|
|
||||||
required this.os,
|
|
||||||
required this.version,
|
|
||||||
required this.error,
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,133 +0,0 @@
|
|||||||
// ignore_for_file: avoid_print, use_build_context_synchronously
|
|
||||||
|
|
||||||
import 'package:filcnaplo/utils/jwt.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/exam_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/homework_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/message_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/note_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:filcnaplo/models/user.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/student.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:filcnaplo/api/nonce.dart';
|
|
||||||
|
|
||||||
enum LoginState {
|
|
||||||
missingFields,
|
|
||||||
invalidGrant,
|
|
||||||
failed,
|
|
||||||
normal,
|
|
||||||
inProgress,
|
|
||||||
success,
|
|
||||||
}
|
|
||||||
|
|
||||||
Nonce getNonce(String nonce, String username, String instituteCode) {
|
|
||||||
Nonce nonceEncoder = Nonce(
|
|
||||||
key: [98, 97, 83, 115, 120, 79, 119, 108, 85, 49, 106, 77], nonce: nonce);
|
|
||||||
nonceEncoder
|
|
||||||
.encode(instituteCode.toUpperCase() + nonce + username.toUpperCase());
|
|
||||||
|
|
||||||
return nonceEncoder;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future loginAPI({
|
|
||||||
required String username,
|
|
||||||
required String password,
|
|
||||||
required String instituteCode,
|
|
||||||
required BuildContext context,
|
|
||||||
void Function(User)? onLogin,
|
|
||||||
void Function()? onSuccess,
|
|
||||||
}) async {
|
|
||||||
Provider.of<KretaClient>(context, listen: false).userAgent =
|
|
||||||
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
|
||||||
|
|
||||||
Map<String, String> headers = {
|
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
|
||||||
};
|
|
||||||
|
|
||||||
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
|
|
||||||
.getAPI(KretaAPI.nonce, json: false);
|
|
||||||
|
|
||||||
Nonce nonce = getNonce(nonceStr, username, instituteCode);
|
|
||||||
headers.addAll(nonce.header());
|
|
||||||
|
|
||||||
Map? res = await Provider.of<KretaClient>(context, listen: false)
|
|
||||||
.postAPI(KretaAPI.login,
|
|
||||||
headers: headers,
|
|
||||||
body: User.loginBody(
|
|
||||||
username: username,
|
|
||||||
password: password,
|
|
||||||
instituteCode: instituteCode,
|
|
||||||
));
|
|
||||||
if (res != null) {
|
|
||||||
if (res.containsKey("error")) {
|
|
||||||
if (res["error"] == "invalid_grant") {
|
|
||||||
return LoginState.invalidGrant;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (res.containsKey("access_token")) {
|
|
||||||
try {
|
|
||||||
Provider.of<KretaClient>(context, listen: false).accessToken =
|
|
||||||
res["access_token"];
|
|
||||||
Map? studentJson =
|
|
||||||
await Provider.of<KretaClient>(context, listen: false)
|
|
||||||
.getAPI(KretaAPI.student(instituteCode));
|
|
||||||
Student student = Student.fromJson(studentJson!);
|
|
||||||
var user = User(
|
|
||||||
username: username,
|
|
||||||
password: password,
|
|
||||||
instituteCode: instituteCode,
|
|
||||||
name: student.name,
|
|
||||||
student: student,
|
|
||||||
role: JwtUtils.getRoleFromJWT(res["access_token"])!,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (onLogin != null) onLogin(user);
|
|
||||||
|
|
||||||
// Store User in the database
|
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false)
|
|
||||||
.store
|
|
||||||
.storeUser(user);
|
|
||||||
Provider.of<UserProvider>(context, listen: false).addUser(user);
|
|
||||||
Provider.of<UserProvider>(context, listen: false).setUser(user.id);
|
|
||||||
|
|
||||||
// Get user data
|
|
||||||
try {
|
|
||||||
await Future.wait([
|
|
||||||
Provider.of<GradeProvider>(context, listen: false).fetch(),
|
|
||||||
Provider.of<TimetableProvider>(context, listen: false)
|
|
||||||
.fetch(week: Week.current()),
|
|
||||||
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
|
||||||
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
|
||||||
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
|
||||||
Provider.of<EventProvider>(context, listen: false).fetch(),
|
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
|
||||||
]);
|
|
||||||
} catch (error) {
|
|
||||||
print("WARNING: failed to fetch user data: $error");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (onSuccess != null) onSuccess();
|
|
||||||
|
|
||||||
return LoginState.success;
|
|
||||||
} catch (error) {
|
|
||||||
print("ERROR: loginAPI: $error");
|
|
||||||
// maybe check debug mode
|
|
||||||
// ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("ERROR: $error")));
|
|
||||||
return LoginState.failed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return LoginState.failed;
|
|
||||||
}
|
|
@ -1,294 +0,0 @@
|
|||||||
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:filcnaplo/helpers/subject.dart';
|
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:live_activities/live_activities.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/pages/home/live_card/live_card.i18n.dart';
|
|
||||||
|
|
||||||
enum LiveCardState {
|
|
||||||
empty,
|
|
||||||
duringLesson,
|
|
||||||
duringBreak,
|
|
||||||
morning,
|
|
||||||
afternoon,
|
|
||||||
night,
|
|
||||||
summary
|
|
||||||
}
|
|
||||||
|
|
||||||
class LiveCardProvider extends ChangeNotifier {
|
|
||||||
Lesson? currentLesson;
|
|
||||||
Lesson? nextLesson;
|
|
||||||
Lesson? prevLesson;
|
|
||||||
List<Lesson>? nextLessons;
|
|
||||||
|
|
||||||
LiveCardState currentState = LiveCardState.empty;
|
|
||||||
late Timer _timer;
|
|
||||||
late final TimetableProvider _timetable;
|
|
||||||
late final SettingsProvider _settings;
|
|
||||||
|
|
||||||
late Duration _delay;
|
|
||||||
|
|
||||||
final _liveActivitiesPlugin = LiveActivities();
|
|
||||||
String? _latestActivityId;
|
|
||||||
Map<String, String> _lastActivity = {};
|
|
||||||
|
|
||||||
bool _hasCheckedTimetable = false;
|
|
||||||
|
|
||||||
LiveCardProvider({
|
|
||||||
required TimetableProvider timetable,
|
|
||||||
required SettingsProvider settings,
|
|
||||||
}) : _timetable = timetable,
|
|
||||||
_settings = settings {
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
_liveActivitiesPlugin.areActivitiesEnabled().then((value) {
|
|
||||||
// Console log
|
|
||||||
if (kDebugMode) {
|
|
||||||
print("Live card enabled: $value");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value) {
|
|
||||||
_liveActivitiesPlugin.init(appGroupId: "group.refilc.livecard");
|
|
||||||
|
|
||||||
_liveActivitiesPlugin.getAllActivitiesIds().then((value) {
|
|
||||||
_latestActivityId = value.isNotEmpty ? value.first : null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) => update());
|
|
||||||
_delay = settings.bellDelayEnabled
|
|
||||||
? Duration(seconds: settings.bellDelay)
|
|
||||||
: Duration.zero;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_timer.cancel();
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
_liveActivitiesPlugin.areActivitiesEnabled().then((value) {
|
|
||||||
if (value) {
|
|
||||||
if (_latestActivityId != null) {
|
|
||||||
_liveActivitiesPlugin.endActivity(_latestActivityId!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Debugging
|
|
||||||
static DateTime _now() {
|
|
||||||
// return DateTime(2023, 8, 31, 8, 0);
|
|
||||||
return DateTime.now();
|
|
||||||
}
|
|
||||||
|
|
||||||
String getFloorDifference() {
|
|
||||||
final prevFloor = prevLesson!.getFloor();
|
|
||||||
final nextFloor = nextLesson!.getFloor();
|
|
||||||
if (prevFloor == null || nextFloor == null || prevFloor == nextFloor) {
|
|
||||||
return "to room";
|
|
||||||
}
|
|
||||||
if (nextFloor == 0) {
|
|
||||||
return "ground floor";
|
|
||||||
}
|
|
||||||
if (nextFloor > prevFloor) {
|
|
||||||
return "up floor";
|
|
||||||
} else {
|
|
||||||
return "down floor";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, String> toMap() {
|
|
||||||
switch (currentState) {
|
|
||||||
case LiveCardState.duringLesson:
|
|
||||||
return {
|
|
||||||
"color":
|
|
||||||
'#${_settings.liveActivityColor.toString().substring(10, 16)}',
|
|
||||||
"icon": currentLesson != null
|
|
||||||
? SubjectIcon.resolveName(subject: currentLesson?.subject)
|
|
||||||
: "book",
|
|
||||||
"index":
|
|
||||||
currentLesson != null ? '${currentLesson!.lessonIndex}. ' : "",
|
|
||||||
"title": currentLesson != null
|
|
||||||
? ShortSubject.resolve(subject: currentLesson?.subject).capital()
|
|
||||||
: "",
|
|
||||||
"subtitle": currentLesson?.room.replaceAll("_", " ") ?? "",
|
|
||||||
"description": currentLesson?.description ?? "",
|
|
||||||
"startDate": ((currentLesson?.start.millisecondsSinceEpoch ?? 0) -
|
|
||||||
_delay.inMilliseconds)
|
|
||||||
.toString(),
|
|
||||||
"endDate": ((currentLesson?.end.millisecondsSinceEpoch ?? 0) -
|
|
||||||
_delay.inMilliseconds)
|
|
||||||
.toString(),
|
|
||||||
"nextSubject": nextLesson != null
|
|
||||||
? ShortSubject.resolve(subject: nextLesson?.subject).capital()
|
|
||||||
: "",
|
|
||||||
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
|
|
||||||
};
|
|
||||||
case LiveCardState.duringBreak:
|
|
||||||
final iconFloorMap = {
|
|
||||||
"to room": "chevron.right.2",
|
|
||||||
"up floor": "arrow.up.right",
|
|
||||||
"down floor": "arrow.down.left",
|
|
||||||
"ground floor": "arrow.down.left",
|
|
||||||
};
|
|
||||||
|
|
||||||
final diff = getFloorDifference();
|
|
||||||
|
|
||||||
return {
|
|
||||||
"color":
|
|
||||||
'#${_settings.liveActivityColor.toString().substring(10, 16)}',
|
|
||||||
"icon": iconFloorMap[diff] ?? "cup.and.saucer",
|
|
||||||
"title": "Szünet",
|
|
||||||
"description": "go $diff".i18n.fill([
|
|
||||||
diff != "to room" ? (nextLesson!.getFloor() ?? 0) : nextLesson!.room
|
|
||||||
]),
|
|
||||||
"startDate": ((prevLesson?.end.millisecondsSinceEpoch ?? 0) -
|
|
||||||
_delay.inMilliseconds)
|
|
||||||
.toString(),
|
|
||||||
"endDate": ((nextLesson?.start.millisecondsSinceEpoch ?? 0) -
|
|
||||||
_delay.inMilliseconds)
|
|
||||||
.toString(),
|
|
||||||
"nextSubject": (nextLesson != null
|
|
||||||
? ShortSubject.resolve(subject: nextLesson?.subject)
|
|
||||||
: "")
|
|
||||||
.capital(),
|
|
||||||
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
|
|
||||||
"index": "",
|
|
||||||
"subtitle": "",
|
|
||||||
};
|
|
||||||
default:
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void update() async {
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
_liveActivitiesPlugin.areActivitiesEnabled().then((value) {
|
|
||||||
if (value) {
|
|
||||||
final cmap = toMap();
|
|
||||||
if (!mapEquals(cmap, _lastActivity)) {
|
|
||||||
_lastActivity = cmap;
|
|
||||||
try {
|
|
||||||
if (_lastActivity.isNotEmpty) {
|
|
||||||
if (_latestActivityId == null) {
|
|
||||||
_liveActivitiesPlugin
|
|
||||||
.createActivity(_lastActivity)
|
|
||||||
.then((value) => _latestActivityId = value);
|
|
||||||
} else {
|
|
||||||
_liveActivitiesPlugin.updateActivity(
|
|
||||||
_latestActivityId!, _lastActivity);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (_latestActivityId != null) {
|
|
||||||
_liveActivitiesPlugin.endActivity(_latestActivityId!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
if (kDebugMode) {
|
|
||||||
print('ERROR: Unable to create or update iOS LiveCard!');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Lesson> today = _today(_timetable);
|
|
||||||
|
|
||||||
if (today.isEmpty && !_hasCheckedTimetable) {
|
|
||||||
_hasCheckedTimetable = true;
|
|
||||||
await _timetable.fetch(week: Week.current());
|
|
||||||
today = _today(_timetable);
|
|
||||||
}
|
|
||||||
|
|
||||||
_delay = _settings.bellDelayEnabled
|
|
||||||
? Duration(seconds: _settings.bellDelay)
|
|
||||||
: Duration.zero;
|
|
||||||
|
|
||||||
final now = _now().add(_delay);
|
|
||||||
|
|
||||||
// Filter cancelled lessons #20
|
|
||||||
// Filter label lessons #128
|
|
||||||
today = today
|
|
||||||
.where((lesson) =>
|
|
||||||
lesson.status?.name != "Elmaradt" &&
|
|
||||||
lesson.subject.id != '' &&
|
|
||||||
!lesson.isEmpty)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
if (today.isNotEmpty) {
|
|
||||||
// sort
|
|
||||||
today.sort((a, b) => a.start.compareTo(b.start));
|
|
||||||
|
|
||||||
final _lesson = today.firstWhere(
|
|
||||||
(l) => l.start.isBefore(now) && l.end.isAfter(now),
|
|
||||||
orElse: () => Lesson.fromJson({}));
|
|
||||||
|
|
||||||
if (_lesson.start.year != 0) {
|
|
||||||
currentLesson = _lesson;
|
|
||||||
} else {
|
|
||||||
currentLesson = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
final _next = today.firstWhere((l) => l.start.isAfter(now),
|
|
||||||
orElse: () => Lesson.fromJson({}));
|
|
||||||
nextLessons = today.where((l) => l.start.isAfter(now)).toList();
|
|
||||||
|
|
||||||
if (_next.start.year != 0) {
|
|
||||||
nextLesson = _next;
|
|
||||||
} else {
|
|
||||||
nextLesson = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
final _prev = today.lastWhere((l) => l.end.isBefore(now),
|
|
||||||
orElse: () => Lesson.fromJson({}));
|
|
||||||
|
|
||||||
if (_prev.start.year != 0) {
|
|
||||||
prevLesson = _prev;
|
|
||||||
} else {
|
|
||||||
prevLesson = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (now.isBefore(DateTime(now.year, DateTime.august, 31)) &&
|
|
||||||
now.isAfter(DateTime(now.year, DateTime.june, 14))) {
|
|
||||||
currentState = LiveCardState.summary;
|
|
||||||
} else if (currentLesson != null) {
|
|
||||||
currentState = LiveCardState.duringLesson;
|
|
||||||
} else if (nextLesson != null && prevLesson != null) {
|
|
||||||
currentState = LiveCardState.duringBreak;
|
|
||||||
} else if (now.hour >= 12 && now.hour < 20) {
|
|
||||||
currentState = LiveCardState.afternoon;
|
|
||||||
} else if (now.hour >= 20) {
|
|
||||||
currentState = LiveCardState.night;
|
|
||||||
} else if (now.hour >= 5 && now.hour <= 10) {
|
|
||||||
currentState = LiveCardState.morning;
|
|
||||||
} else {
|
|
||||||
currentState = LiveCardState.empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get show => currentState != LiveCardState.empty;
|
|
||||||
|
|
||||||
Duration get delay => _delay;
|
|
||||||
|
|
||||||
bool _sameDate(DateTime a, DateTime b) =>
|
|
||||||
(a.year == b.year && a.month == b.month && a.day == b.day);
|
|
||||||
|
|
||||||
List<Lesson> _today(TimetableProvider p) => (p.getWeek(Week.current()) ?? [])
|
|
||||||
.where((l) => _sameDate(l.date, _now()))
|
|
||||||
.toList();
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
// ignore_for_file: use_build_context_synchronously
|
|
||||||
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/status_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/student.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/week.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/exam_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/homework_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/message_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/note_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:home_widget/home_widget.dart';
|
|
||||||
|
|
||||||
// Mutex
|
|
||||||
bool lock = false;
|
|
||||||
|
|
||||||
Future<void> syncAll(BuildContext context) {
|
|
||||||
if (lock) return Future.value();
|
|
||||||
// Lock
|
|
||||||
lock = true;
|
|
||||||
|
|
||||||
// ignore: avoid_print
|
|
||||||
print("INFO Syncing all");
|
|
||||||
|
|
||||||
UserProvider user = Provider.of<UserProvider>(context, listen: false);
|
|
||||||
StatusProvider statusProvider = Provider.of<StatusProvider>(context, listen: false);
|
|
||||||
|
|
||||||
List<Future<void>> tasks = [];
|
|
||||||
int taski = 0;
|
|
||||||
|
|
||||||
Future<void> syncStatus(Future<void> future) async {
|
|
||||||
await future.onError((error, stackTrace) => null);
|
|
||||||
taski++;
|
|
||||||
statusProvider.triggerSync(current: taski, max: tasks.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks = [
|
|
||||||
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
|
||||||
syncStatus(Provider.of<TimetableProvider>(context, listen: false).fetch(week: Week.current())),
|
|
||||||
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<MessageProvider>(context, listen: false).fetchAll()),
|
|
||||||
syncStatus(Provider.of<NoteProvider>(context, listen: false).fetch()),
|
|
||||||
syncStatus(Provider.of<EventProvider>(context, listen: false).fetch()),
|
|
||||||
syncStatus(Provider.of<AbsenceProvider>(context, listen: false).fetch()),
|
|
||||||
|
|
||||||
// Sync student
|
|
||||||
syncStatus(() async {
|
|
||||||
if (user.user == null) return;
|
|
||||||
Map? studentJson = await Provider.of<KretaClient>(context, listen: false).getAPI(KretaAPI.student(user.instituteCode!));
|
|
||||||
if (studentJson == null) return;
|
|
||||||
Student student = Student.fromJson(studentJson);
|
|
||||||
|
|
||||||
user.user?.name = student.name;
|
|
||||||
|
|
||||||
// Store user
|
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false).store.storeUser(user.user!);
|
|
||||||
}()),
|
|
||||||
];
|
|
||||||
|
|
||||||
Future<bool?> updateWidget() async {
|
|
||||||
try {
|
|
||||||
return HomeWidget.updateWidget(name: 'widget_timetable.WidgetTimetable');
|
|
||||||
} on PlatformException catch (exception) {
|
|
||||||
debugPrint('Error Updating Widget. $exception');
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Future.wait(tasks).then((value) {
|
|
||||||
// Unlock
|
|
||||||
lock = false;
|
|
||||||
|
|
||||||
// Update Widget
|
|
||||||
if (Platform.isAndroid) updateWidget();
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,601 +0,0 @@
|
|||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/status_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:filcnaplo/helpers/notification_helper.i18n.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/absence.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/grade.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
|
|
||||||
hide Message;
|
|
||||||
import 'package:i18n_extension/i18n_widget.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/message.dart';
|
|
||||||
|
|
||||||
class NotificationsHelper {
|
|
||||||
late DatabaseProvider database;
|
|
||||||
late SettingsProvider settingsProvider;
|
|
||||||
late UserProvider userProvider;
|
|
||||||
late KretaClient kretaClient;
|
|
||||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
|
||||||
FlutterLocalNotificationsPlugin();
|
|
||||||
|
|
||||||
List<T> combineLists<T, K>(
|
|
||||||
List<T> list1,
|
|
||||||
List<T> list2,
|
|
||||||
K Function(T) keyExtractor,
|
|
||||||
) {
|
|
||||||
Set<K> uniqueKeys = <K>{};
|
|
||||||
List<T> combinedList = [];
|
|
||||||
|
|
||||||
for (T item in list1) {
|
|
||||||
K key = keyExtractor(item);
|
|
||||||
if (!uniqueKeys.contains(key)) {
|
|
||||||
uniqueKeys.add(key);
|
|
||||||
combinedList.add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (T item in list2) {
|
|
||||||
K key = keyExtractor(item);
|
|
||||||
if (!uniqueKeys.contains(key)) {
|
|
||||||
uniqueKeys.add(key);
|
|
||||||
combinedList.add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return combinedList;
|
|
||||||
}
|
|
||||||
|
|
||||||
String dayTitle(DateTime date) {
|
|
||||||
try {
|
|
||||||
return DateFormat("EEEE", I18n.locale.languageCode).format(date);
|
|
||||||
} catch (e) {
|
|
||||||
return "Unknown";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@pragma('vm:entry-point')
|
|
||||||
void backgroundJob() async {
|
|
||||||
// initialize providers
|
|
||||||
database = DatabaseProvider();
|
|
||||||
await database.init();
|
|
||||||
settingsProvider = await database.query.getSettings(database);
|
|
||||||
userProvider = await database.query.getUsers(settingsProvider);
|
|
||||||
|
|
||||||
if (userProvider.id != null && settingsProvider.notificationsEnabled) {
|
|
||||||
// refresh kreta login
|
|
||||||
final status = StatusProvider();
|
|
||||||
kretaClient = KretaClient(
|
|
||||||
user: userProvider, settings: settingsProvider, status: status);
|
|
||||||
kretaClient.refreshLogin();
|
|
||||||
if (settingsProvider.notificationsGradesEnabled) gradeNotification();
|
|
||||||
if (settingsProvider.notificationsAbsencesEnabled) absenceNotification();
|
|
||||||
if (settingsProvider.notificationsMessagesEnabled) messageNotification();
|
|
||||||
if (settingsProvider.notificationsLessonsEnabled) lessonNotification();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradeNotification() async {
|
|
||||||
// fetch grades
|
|
||||||
GradeProvider gradeProvider = GradeProvider(
|
|
||||||
settings: settingsProvider,
|
|
||||||
user: userProvider,
|
|
||||||
database: database,
|
|
||||||
kreta: kretaClient);
|
|
||||||
gradeProvider.fetch();
|
|
||||||
List<Grade> grades =
|
|
||||||
await database.userQuery.getGrades(userId: userProvider.id ?? "");
|
|
||||||
DateTime lastSeenGrade =
|
|
||||||
await database.userQuery.lastSeenGrade(userId: userProvider.id ?? "");
|
|
||||||
|
|
||||||
// loop through grades and see which hasn't been seen yet
|
|
||||||
for (Grade grade in grades) {
|
|
||||||
// if grade is not a normal grade (1-5), don't show it
|
|
||||||
if ([1, 2, 3, 4, 5].contains(grade.value.value)) {
|
|
||||||
// if the grade was added over a week ago, don't show it to avoid notification spam
|
|
||||||
if (grade.seenDate.isAfter(lastSeenGrade) &&
|
|
||||||
grade.date.difference(DateTime.now()).inDays * -1 < 7) {
|
|
||||||
// send notificiation about new grade
|
|
||||||
AndroidNotificationDetails androidNotificationDetails =
|
|
||||||
AndroidNotificationDetails(
|
|
||||||
'GRADES',
|
|
||||||
'Jegyek',
|
|
||||||
channelDescription: 'Értesítés jegyek beírásakor',
|
|
||||||
importance: Importance.max,
|
|
||||||
priority: Priority.max,
|
|
||||||
color: settingsProvider.customAccentColor,
|
|
||||||
ticker: 'Jegyek',
|
|
||||||
);
|
|
||||||
NotificationDetails notificationDetails =
|
|
||||||
NotificationDetails(android: androidNotificationDetails);
|
|
||||||
if (userProvider.getUsers().length == 1) {
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
grade.id.hashCode,
|
|
||||||
"title_grade".i18n,
|
|
||||||
"body_grade".i18n.fill(
|
|
||||||
[
|
|
||||||
grade.value.value.toString(),
|
|
||||||
grade.subject.isRenamed &&
|
|
||||||
settingsProvider.renamedSubjectsEnabled
|
|
||||||
? grade.subject.renamedTo!
|
|
||||||
: grade.subject.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// multiple users are added, also display student name
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
grade.id.hashCode,
|
|
||||||
"title_grade".i18n,
|
|
||||||
"body_grade_multiuser".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
grade.value.value.toString(),
|
|
||||||
grade.subject.isRenamed &&
|
|
||||||
settingsProvider.renamedSubjectsEnabled
|
|
||||||
? grade.subject.renamedTo!
|
|
||||||
: grade.subject.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// set grade seen status
|
|
||||||
gradeProvider.seenAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
void absenceNotification() async {
|
|
||||||
// get absences from api
|
|
||||||
List? absenceJson = await kretaClient
|
|
||||||
.getAPI(KretaAPI.absences(userProvider.instituteCode ?? ""));
|
|
||||||
List<Absence> storedAbsences =
|
|
||||||
await database.userQuery.getAbsences(userId: userProvider.id!);
|
|
||||||
if (absenceJson == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// format api absences to correct format while preserving isSeen value
|
|
||||||
List<Absence> absences = absenceJson.map((e) {
|
|
||||||
Absence apiAbsence = Absence.fromJson(e);
|
|
||||||
Absence storedAbsence = storedAbsences.firstWhere(
|
|
||||||
(stored) => stored.id == apiAbsence.id,
|
|
||||||
orElse: () => apiAbsence);
|
|
||||||
apiAbsence.isSeen = storedAbsence.isSeen;
|
|
||||||
return apiAbsence;
|
|
||||||
}).toList();
|
|
||||||
List<Absence> modifiedAbsences = [];
|
|
||||||
if (absences != storedAbsences) {
|
|
||||||
// remove absences that are not new
|
|
||||||
absences.removeWhere((element) => storedAbsences.contains(element));
|
|
||||||
for (Absence absence in absences) {
|
|
||||||
if (!absence.isSeen) {
|
|
||||||
absence.isSeen = true;
|
|
||||||
modifiedAbsences.add(absence);
|
|
||||||
AndroidNotificationDetails androidNotificationDetails =
|
|
||||||
AndroidNotificationDetails(
|
|
||||||
'ABSENCES',
|
|
||||||
'Hiányzások',
|
|
||||||
channelDescription: 'Értesítés hiányzások beírásakor',
|
|
||||||
importance: Importance.max,
|
|
||||||
priority: Priority.max,
|
|
||||||
color: settingsProvider.customAccentColor,
|
|
||||||
ticker: 'Hiányzások',
|
|
||||||
);
|
|
||||||
NotificationDetails notificationDetails =
|
|
||||||
NotificationDetails(android: androidNotificationDetails);
|
|
||||||
if (userProvider.getUsers().length == 1) {
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
absence.id.hashCode,
|
|
||||||
"title_absence".i18n,
|
|
||||||
"body_absence".i18n.fill(
|
|
||||||
[
|
|
||||||
DateFormat("yyyy-MM-dd").format(absence.date),
|
|
||||||
absence.subject.isRenamed &&
|
|
||||||
settingsProvider.renamedSubjectsEnabled
|
|
||||||
? absence.subject.renamedTo!
|
|
||||||
: absence.subject.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
absence.id.hashCode,
|
|
||||||
"title_absence".i18n,
|
|
||||||
"body_absence_multiuser".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
DateFormat("yyyy-MM-dd").format(absence.date),
|
|
||||||
absence.subject.isRenamed &&
|
|
||||||
settingsProvider.renamedSubjectsEnabled
|
|
||||||
? absence.subject.renamedTo!
|
|
||||||
: absence.subject.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// combine modified absences and storedabsences list and save them to the database
|
|
||||||
List<Absence> combinedAbsences = combineLists(
|
|
||||||
modifiedAbsences,
|
|
||||||
storedAbsences,
|
|
||||||
(Absence absence) => absence.id,
|
|
||||||
);
|
|
||||||
await database.userStore
|
|
||||||
.storeAbsences(combinedAbsences, userId: userProvider.id!);
|
|
||||||
}
|
|
||||||
|
|
||||||
void messageNotification() async {
|
|
||||||
// get messages from api
|
|
||||||
List? messageJson =
|
|
||||||
await kretaClient.getAPI(KretaAPI.messages("beerkezett"));
|
|
||||||
List<Message> storedmessages =
|
|
||||||
await database.userQuery.getMessages(userId: userProvider.id!);
|
|
||||||
if (messageJson == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// format api messages to correct format while preserving isSeen value
|
|
||||||
// Parse messages
|
|
||||||
List<Message> messages = [];
|
|
||||||
await Future.wait(List.generate(messageJson.length, (index) {
|
|
||||||
return () async {
|
|
||||||
Map message = messageJson.cast<Map>()[index];
|
|
||||||
Map? innerMessageJson = await kretaClient
|
|
||||||
.getAPI(KretaAPI.message(message["azonosito"].toString()));
|
|
||||||
if (innerMessageJson != null) {
|
|
||||||
messages.add(
|
|
||||||
Message.fromJson(innerMessageJson, forceType: MessageType.inbox));
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
}));
|
|
||||||
|
|
||||||
for (Message message in messages) {
|
|
||||||
for (Message storedMessage in storedmessages) {
|
|
||||||
if (message.id == storedMessage.id) {
|
|
||||||
message.isSeen = storedMessage.isSeen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<Message> modifiedmessages = [];
|
|
||||||
if (messages != storedmessages) {
|
|
||||||
// remove messages that are not new
|
|
||||||
messages.removeWhere((element) => storedmessages.contains(element));
|
|
||||||
for (Message message in messages) {
|
|
||||||
if (!message.isSeen) {
|
|
||||||
message.isSeen = true;
|
|
||||||
modifiedmessages.add(message);
|
|
||||||
AndroidNotificationDetails androidNotificationDetails =
|
|
||||||
AndroidNotificationDetails(
|
|
||||||
'MESSAGES',
|
|
||||||
'Üzenetek',
|
|
||||||
channelDescription: 'Értesítés kapott üzenetekkor',
|
|
||||||
importance: Importance.max,
|
|
||||||
priority: Priority.max,
|
|
||||||
color: settingsProvider.customAccentColor,
|
|
||||||
ticker: 'Üzenetek',
|
|
||||||
);
|
|
||||||
NotificationDetails notificationDetails =
|
|
||||||
NotificationDetails(android: androidNotificationDetails);
|
|
||||||
if (userProvider.getUsers().length == 1) {
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
message.id.hashCode,
|
|
||||||
message.author,
|
|
||||||
message.content.replaceAll(RegExp(r'<[^>]*>'), ''),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
message.id.hashCode,
|
|
||||||
"(${userProvider.displayName!}) ${message.author}",
|
|
||||||
message.content.replaceAll(RegExp(r'<[^>]*>'), ''),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// combine modified messages and storedmessages list and save them to the database
|
|
||||||
List<Message> combinedmessages = combineLists(
|
|
||||||
modifiedmessages,
|
|
||||||
storedmessages,
|
|
||||||
(Message message) => message.id,
|
|
||||||
);
|
|
||||||
await database.userStore
|
|
||||||
.storeMessages(combinedmessages, userId: userProvider.id!);
|
|
||||||
}
|
|
||||||
|
|
||||||
void lessonNotification() async {
|
|
||||||
// get lesson from api
|
|
||||||
TimetableProvider timetableProvider = TimetableProvider(
|
|
||||||
user: userProvider, database: database, kreta: kretaClient);
|
|
||||||
List<Lesson> storedlessons =
|
|
||||||
timetableProvider.lessons[Week.current()] ?? [];
|
|
||||||
List? apilessons = timetableProvider.getWeek(Week.current()) ?? [];
|
|
||||||
for (Lesson lesson in apilessons) {
|
|
||||||
for (Lesson storedLesson in storedlessons) {
|
|
||||||
if (lesson.id == storedLesson.id) {
|
|
||||||
lesson.isSeen = storedLesson.isSeen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<Lesson> modifiedlessons = [];
|
|
||||||
if (apilessons != storedlessons) {
|
|
||||||
// remove lessons that are not new
|
|
||||||
apilessons.removeWhere((element) => storedlessons.contains(element));
|
|
||||||
for (Lesson lesson in apilessons) {
|
|
||||||
if (!lesson.isSeen && lesson.isChanged) {
|
|
||||||
lesson.isSeen = true;
|
|
||||||
modifiedlessons.add(lesson);
|
|
||||||
AndroidNotificationDetails androidNotificationDetails =
|
|
||||||
AndroidNotificationDetails(
|
|
||||||
'LESSONS',
|
|
||||||
'Órák',
|
|
||||||
channelDescription:
|
|
||||||
'Értesítés órák elmaradásáról, helyettesítésről',
|
|
||||||
importance: Importance.max,
|
|
||||||
priority: Priority.max,
|
|
||||||
color: settingsProvider.customAccentColor,
|
|
||||||
ticker: 'Órák',
|
|
||||||
);
|
|
||||||
NotificationDetails notificationDetails =
|
|
||||||
NotificationDetails(android: androidNotificationDetails);
|
|
||||||
if (userProvider.getUsers().length == 1) {
|
|
||||||
if (lesson.status?.name == "Elmaradt") {
|
|
||||||
switch (I18n.localeStr) {
|
|
||||||
case "en_en":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_canceled".i18n.fill(
|
|
||||||
[
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "hu_hu":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_canceled".i18n.fill(
|
|
||||||
[
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_canceled".i18n.fill(
|
|
||||||
[
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (lesson.substituteTeacher?.name != "") {
|
|
||||||
switch (I18n.localeStr) {
|
|
||||||
case "en_en":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_substituted".i18n.fill(
|
|
||||||
[
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.substituteTeacher!.isRenamed
|
|
||||||
? lesson.substituteTeacher!.renamedTo!
|
|
||||||
: lesson.substituteTeacher!.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "hu_hu":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_substituted".i18n.fill(
|
|
||||||
[
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
lesson.substituteTeacher!.isRenamed
|
|
||||||
? lesson.substituteTeacher!.renamedTo!
|
|
||||||
: lesson.substituteTeacher!.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_substituted".i18n.fill(
|
|
||||||
[
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.substituteTeacher!.isRenamed
|
|
||||||
? lesson.substituteTeacher!.renamedTo!
|
|
||||||
: lesson.substituteTeacher!.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (lesson.status?.name == "Elmaradt") {
|
|
||||||
switch (I18n.localeStr) {
|
|
||||||
case "en_en":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_canceled".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "hu_hu":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_canceled".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_canceled".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (lesson.substituteTeacher?.name != "") {
|
|
||||||
switch (I18n.localeStr) {
|
|
||||||
case "en_en":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_substituted".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.substituteTeacher!.isRenamed
|
|
||||||
? lesson.substituteTeacher!.renamedTo!
|
|
||||||
: lesson.substituteTeacher!.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "hu_hu":
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_substituted".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
lesson.substituteTeacher!.isRenamed
|
|
||||||
? lesson.substituteTeacher!.renamedTo!
|
|
||||||
: lesson.substituteTeacher!.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
|
||||||
lesson.id.hashCode,
|
|
||||||
"title_lesson".i18n,
|
|
||||||
"body_lesson_substituted".i18n.fill(
|
|
||||||
[
|
|
||||||
userProvider.displayName!,
|
|
||||||
lesson.lessonIndex,
|
|
||||||
lesson.name,
|
|
||||||
dayTitle(lesson.date),
|
|
||||||
lesson.substituteTeacher!.isRenamed
|
|
||||||
? lesson.substituteTeacher!.renamedTo!
|
|
||||||
: lesson.substituteTeacher!.name
|
|
||||||
],
|
|
||||||
),
|
|
||||||
notificationDetails,
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// combine modified lesson and storedlesson list and save them to the database
|
|
||||||
List<Lesson> combinedlessons = combineLists(
|
|
||||||
modifiedlessons,
|
|
||||||
storedlessons,
|
|
||||||
(Lesson message) => message.id,
|
|
||||||
);
|
|
||||||
Map<Week, List<Lesson>> timetableLessons = timetableProvider.lessons;
|
|
||||||
timetableLessons[Week.current()] = combinedlessons;
|
|
||||||
await database.userStore
|
|
||||||
.storeLessons(timetableLessons, userId: userProvider.id!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
import 'package:filcnaplo/helpers/attachment_helper.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/attachment.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
|
||||||
|
|
||||||
class ShareHelper {
|
|
||||||
static Future<void> shareText(String text, {String? subject}) => Share.share(text, subject: subject);
|
|
||||||
// ignore: deprecated_member_use
|
|
||||||
static Future<void> shareFile(String path, {String? text, String? subject}) => Share.shareFiles([path], text: text, subject: subject);
|
|
||||||
|
|
||||||
static Future<void> shareAttachment(Attachment attachment, {required BuildContext context}) async {
|
|
||||||
String path = await attachment.download(context);
|
|
||||||
await shareFile(path);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,144 +0,0 @@
|
|||||||
import 'package:filcnaplo/icons/filc_icons.dart';
|
|
||||||
import 'package:filcnaplo/models/icon_pack.dart';
|
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
typedef SubjectIconVariants = Map<IconPack, IconData>;
|
|
||||||
|
|
||||||
class SubjectIconData {
|
|
||||||
final SubjectIconVariants data;
|
|
||||||
final String name; // for iOS live activities compatibilty
|
|
||||||
|
|
||||||
SubjectIconData({
|
|
||||||
this.data = const {
|
|
||||||
IconPack.material: Icons.widgets_outlined,
|
|
||||||
IconPack.cupertino: CupertinoIcons.rectangle_grid_2x2,
|
|
||||||
},
|
|
||||||
this.name = "square.grid.2x2",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
SubjectIconVariants createIcon({required IconData material, required IconData cupertino}) {
|
|
||||||
return {
|
|
||||||
IconPack.material: material,
|
|
||||||
IconPack.cupertino: cupertino,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
class SubjectIcon {
|
|
||||||
static String resolveName({Subject? subject, String? subjectName}) => _resolve(subject: subject, subjectName: subjectName).name;
|
|
||||||
static IconData resolveVariant({Subject? 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}) {
|
|
||||||
assert(!(subject == null && subjectName == null));
|
|
||||||
|
|
||||||
String name = (subject?.name ?? subjectName ?? "").toLowerCase().specialChars().trim();
|
|
||||||
String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
|
||||||
|
|
||||||
// todo: check for categories
|
|
||||||
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(
|
|
||||||
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)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.heart, material: Icons.favorite_border_outlined), name: "heart");
|
|
||||||
} else if (RegExp("penzugy").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.money_dollar, material: Icons.savings_outlined), name: "dollarsign");
|
|
||||||
} else if (RegExp("informatika|szoftver|iroda|digitalis").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.device_laptop, material: Icons.computer_outlined), name: "laptopcomputer");
|
|
||||||
} else if (RegExp("prog").hasMatch(name)) {
|
|
||||||
return SubjectIconData(
|
|
||||||
data: createIcon(cupertino: CupertinoIcons.chevron_left_slash_chevron_right, material: Icons.code_outlined),
|
|
||||||
name: "chevron.left.forwardslash.chevron.right");
|
|
||||||
} else if (RegExp("halozat").hasMatch(name)) {
|
|
||||||
return SubjectIconData(
|
|
||||||
data: createIcon(cupertino: CupertinoIcons.antenna_radiowaves_left_right, material: Icons.wifi_tethering_outlined),
|
|
||||||
name: "antenna.radiowaves.left.and.right");
|
|
||||||
} else if (RegExp("szinhaz").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.hifispeaker, material: Icons.theater_comedy_outlined), name: "hifispeaker");
|
|
||||||
} else if (RegExp("film|media").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.film, material: Icons.theaters_outlined), name: "film");
|
|
||||||
} else if (RegExp("elektro(tech)?nika").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.bolt, material: Icons.electrical_services_outlined), name: "bolt");
|
|
||||||
} else if (RegExp("gepesz|mernok|ipar").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.wrench, material: Icons.precision_manufacturing_outlined), name: "wrench");
|
|
||||||
} else if (RegExp("technika").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.hammer, material: Icons.build_outlined), name: "hammer");
|
|
||||||
} else if (RegExp("tanc").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.music_mic, material: Icons.speaker_outlined), name: "music.mic");
|
|
||||||
} else if (RegExp("filozofia").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(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)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.chart_pie, material: Icons.account_balance_outlined), name: "chart.pie");
|
|
||||||
} else if (RegExp("szorgalom").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.checkmark_seal, material: Icons.verified_outlined), name: "checkmark.seal");
|
|
||||||
} else if (RegExp("magatartas").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(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)) {
|
|
||||||
return SubjectIconData(data: createIcon(material: FilcIcons.linux, cupertino: FilcIcons.linux));
|
|
||||||
}
|
|
||||||
|
|
||||||
return SubjectIconData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ShortSubject {
|
|
||||||
static String resolve({Subject? subject, String? subjectName}) {
|
|
||||||
assert(!(subject == null && subjectName == null));
|
|
||||||
|
|
||||||
String name = (subject?.name ?? subjectName ?? "").toLowerCase().specialChars().trim();
|
|
||||||
// String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
|
||||||
|
|
||||||
if (RegExp("magyar irodalom").hasMatch(name)) {
|
|
||||||
return "Irodalom";
|
|
||||||
} else if (RegExp("magyar nyelv").hasMatch(name)) {
|
|
||||||
return "Nyelvtan";
|
|
||||||
} else if (RegExp("matematika").hasMatch(name)) {
|
|
||||||
return "Matek";
|
|
||||||
} else if (RegExp("digitalis kultura").hasMatch(name)) {
|
|
||||||
return "Dig. kult.";
|
|
||||||
} else if (RegExp("testneveles").hasMatch(name)) {
|
|
||||||
return "Tesi";
|
|
||||||
} else if (RegExp("tortenelem").hasMatch(name)) {
|
|
||||||
return "Töri";
|
|
||||||
} else if (RegExp("(angol|nemet|francia|olasz|orosz|spanyol|latin|kinai) nyelv").hasMatch(name)) {
|
|
||||||
return (subject?.name ?? subjectName ?? "?").replaceAll(" nyelv", "");
|
|
||||||
} else if (RegExp("informatika").hasMatch(name)) {
|
|
||||||
return "Infó";
|
|
||||||
} else if (RegExp("osztalyfonoki").hasMatch(name)) {
|
|
||||||
return "Ofő";
|
|
||||||
}
|
|
||||||
|
|
||||||
return subject?.name.capital() ?? subjectName?.capital() ?? "?";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,197 +0,0 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:background_fetch/background_fetch.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
|
||||||
import 'package:filcnaplo/database/init.dart';
|
|
||||||
import 'package:filcnaplo/helpers/notification_helper.dart';
|
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:filcnaplo/app.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/screens/error_screen.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/screens/error_report_screen.dart';
|
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|
||||||
|
|
||||||
void main() async {
|
|
||||||
// Initalize
|
|
||||||
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
binding.renderView.automaticSystemUiAdjustment = false;
|
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
||||||
// Startup
|
|
||||||
Startup startup = Startup();
|
|
||||||
await startup.start();
|
|
||||||
|
|
||||||
// Custom error page
|
|
||||||
ErrorWidget.builder = errorBuilder;
|
|
||||||
|
|
||||||
BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask);
|
|
||||||
|
|
||||||
// Run App
|
|
||||||
runApp(App(
|
|
||||||
database: startup.database,
|
|
||||||
settings: startup.settings,
|
|
||||||
user: startup.user,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
class Startup {
|
|
||||||
late SettingsProvider settings;
|
|
||||||
late UserProvider user;
|
|
||||||
late DatabaseProvider database;
|
|
||||||
|
|
||||||
Future<void> start() async {
|
|
||||||
database = DatabaseProvider();
|
|
||||||
var db = await initDB(database);
|
|
||||||
await db.close();
|
|
||||||
await database.init();
|
|
||||||
settings = await database.query.getSettings(database);
|
|
||||||
user = await database.query.getUsers(settings);
|
|
||||||
|
|
||||||
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
|
|
||||||
// Notifications setup
|
|
||||||
if (!kIsWeb) {
|
|
||||||
initPlatformState();
|
|
||||||
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get permission to show notifications
|
|
||||||
if (kIsWeb) {
|
|
||||||
// do nothing
|
|
||||||
} else if (Platform.isAndroid) {
|
|
||||||
await flutterLocalNotificationsPlugin
|
|
||||||
.resolvePlatformSpecificImplementation<
|
|
||||||
AndroidFlutterLocalNotificationsPlugin>()!
|
|
||||||
.requestPermission();
|
|
||||||
} else if (Platform.isIOS) {
|
|
||||||
await flutterLocalNotificationsPlugin
|
|
||||||
.resolvePlatformSpecificImplementation<
|
|
||||||
IOSFlutterLocalNotificationsPlugin>()
|
|
||||||
?.requestPermissions(
|
|
||||||
alert: false,
|
|
||||||
badge: true,
|
|
||||||
sound: true,
|
|
||||||
);
|
|
||||||
} else if (Platform.isMacOS) {
|
|
||||||
await flutterLocalNotificationsPlugin
|
|
||||||
.resolvePlatformSpecificImplementation<
|
|
||||||
MacOSFlutterLocalNotificationsPlugin>()
|
|
||||||
?.requestPermissions(
|
|
||||||
alert: false,
|
|
||||||
badge: true,
|
|
||||||
sound: true,
|
|
||||||
);
|
|
||||||
} else if (Platform.isLinux) {
|
|
||||||
// no permissions are needed on linux
|
|
||||||
}
|
|
||||||
|
|
||||||
// Platform specific settings
|
|
||||||
if (!kIsWeb) {
|
|
||||||
const DarwinInitializationSettings initializationSettingsDarwin =
|
|
||||||
DarwinInitializationSettings(
|
|
||||||
requestSoundPermission: true,
|
|
||||||
requestBadgePermission: true,
|
|
||||||
requestAlertPermission: false,
|
|
||||||
);
|
|
||||||
const AndroidInitializationSettings initializationSettingsAndroid =
|
|
||||||
AndroidInitializationSettings('ic_notification');
|
|
||||||
const LinuxInitializationSettings initializationSettingsLinux =
|
|
||||||
LinuxInitializationSettings(defaultActionName: 'Open notification');
|
|
||||||
const InitializationSettings initializationSettings =
|
|
||||||
InitializationSettings(
|
|
||||||
android: initializationSettingsAndroid,
|
|
||||||
iOS: initializationSettingsDarwin,
|
|
||||||
macOS: initializationSettingsDarwin,
|
|
||||||
linux: initializationSettingsLinux,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Initialize notifications
|
|
||||||
await flutterLocalNotificationsPlugin.initialize(
|
|
||||||
initializationSettings,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool errorShown = false;
|
|
||||||
String lastException = '';
|
|
||||||
|
|
||||||
Widget errorBuilder(FlutterErrorDetails details) {
|
|
||||||
return Builder(builder: (context) {
|
|
||||||
if (Navigator.of(context).canPop()) Navigator.pop(context);
|
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (!errorShown && details.exceptionAsString() != lastException) {
|
|
||||||
errorShown = true;
|
|
||||||
lastException = details.exceptionAsString();
|
|
||||||
Navigator.of(context, rootNavigator: true)
|
|
||||||
.push(MaterialPageRoute(builder: (context) {
|
|
||||||
if (kReleaseMode) {
|
|
||||||
return ErrorReportScreen(details);
|
|
||||||
} else {
|
|
||||||
return ErrorScreen(details);
|
|
||||||
}
|
|
||||||
})).then((_) => errorShown = false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return Container();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> initPlatformState() async {
|
|
||||||
// Configure BackgroundFetch.
|
|
||||||
int status = await BackgroundFetch.configure(
|
|
||||||
BackgroundFetchConfig(
|
|
||||||
minimumFetchInterval: 15,
|
|
||||||
stopOnTerminate: false,
|
|
||||||
enableHeadless: true,
|
|
||||||
requiresBatteryNotLow: false,
|
|
||||||
requiresCharging: false,
|
|
||||||
requiresStorageNotLow: false,
|
|
||||||
requiresDeviceIdle: false,
|
|
||||||
requiredNetworkType: NetworkType.ANY,
|
|
||||||
startOnBoot: true), (String taskId) async {
|
|
||||||
// <-- Event handler
|
|
||||||
if (kDebugMode) {
|
|
||||||
print("[BackgroundFetch] Event received $taskId");
|
|
||||||
}
|
|
||||||
NotificationsHelper().backgroundJob();
|
|
||||||
BackgroundFetch.finish(taskId);
|
|
||||||
}, (String taskId) async {
|
|
||||||
// <-- Task timeout handler.
|
|
||||||
if (kDebugMode) {
|
|
||||||
print("[BackgroundFetch] TASK TIMEOUT taskId: $taskId");
|
|
||||||
}
|
|
||||||
BackgroundFetch.finish(taskId);
|
|
||||||
});
|
|
||||||
if (kDebugMode) {
|
|
||||||
print('[BackgroundFetch] configure success: $status');
|
|
||||||
}
|
|
||||||
BackgroundFetch.scheduleTask(TaskConfig(
|
|
||||||
taskId: "com.transistorsoft.refilcnotification",
|
|
||||||
delay: 900000, // 15 minutes
|
|
||||||
periodic: true,
|
|
||||||
forceAlarmManager: true,
|
|
||||||
stopOnTerminate: false,
|
|
||||||
enableHeadless: true));
|
|
||||||
}
|
|
||||||
|
|
||||||
@pragma('vm:entry-point')
|
|
||||||
void backgroundHeadlessTask(HeadlessTask task) {
|
|
||||||
String taskId = task.taskId;
|
|
||||||
bool isTimeout = task.timeout;
|
|
||||||
if (isTimeout) {
|
|
||||||
if (kDebugMode) {
|
|
||||||
print("[BackgroundFetch] Headless task timed-out: $taskId");
|
|
||||||
}
|
|
||||||
BackgroundFetch.finish(taskId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (kDebugMode) {
|
|
||||||
print('[BackgroundFetch] Headless event received.');
|
|
||||||
}
|
|
||||||
NotificationsHelper().backgroundJob();
|
|
||||||
BackgroundFetch.finish(task.taskId);
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
class SharedTheme {
|
|
||||||
Map json;
|
|
||||||
String id;
|
|
||||||
bool isPublic;
|
|
||||||
String nickname;
|
|
||||||
Color backgroundColor;
|
|
||||||
Color panelsColor;
|
|
||||||
Color accentColor;
|
|
||||||
|
|
||||||
SharedTheme({
|
|
||||||
required this.json,
|
|
||||||
required this.id,
|
|
||||||
this.isPublic = false,
|
|
||||||
this.nickname = 'Anonymous',
|
|
||||||
required this.backgroundColor,
|
|
||||||
required this.panelsColor,
|
|
||||||
required this.accentColor,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory SharedTheme.fromJson(Map json) {
|
|
||||||
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']),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/student.dart';
|
|
||||||
import 'package:uuid/uuid.dart';
|
|
||||||
|
|
||||||
enum Role { student, parent }
|
|
||||||
|
|
||||||
class User {
|
|
||||||
late String id;
|
|
||||||
String username;
|
|
||||||
String password;
|
|
||||||
String instituteCode;
|
|
||||||
String name;
|
|
||||||
Student student;
|
|
||||||
Role role;
|
|
||||||
String nickname;
|
|
||||||
String picture;
|
|
||||||
|
|
||||||
String get displayName => nickname != '' ? nickname : name;
|
|
||||||
|
|
||||||
User({
|
|
||||||
String? id,
|
|
||||||
required this.name,
|
|
||||||
required this.username,
|
|
||||||
required this.password,
|
|
||||||
required this.instituteCode,
|
|
||||||
required this.student,
|
|
||||||
required this.role,
|
|
||||||
this.nickname = "",
|
|
||||||
this.picture = "",
|
|
||||||
}) {
|
|
||||||
if (id != null) {
|
|
||||||
this.id = id;
|
|
||||||
} else {
|
|
||||||
this.id = const Uuid().v4();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
factory User.fromMap(Map map) {
|
|
||||||
return User(
|
|
||||||
id: map["id"],
|
|
||||||
instituteCode: map["institute_code"],
|
|
||||||
username: map["username"],
|
|
||||||
password: map["password"],
|
|
||||||
name: map["name"].trim(),
|
|
||||||
student: Student.fromJson(jsonDecode(map["student"])),
|
|
||||||
role: Role.values[map["role"] ?? 0],
|
|
||||||
nickname: map["nickname"] ?? "",
|
|
||||||
picture: map["picture"] ?? "",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object?> toMap() {
|
|
||||||
return {
|
|
||||||
"id": id,
|
|
||||||
"username": username,
|
|
||||||
"password": password,
|
|
||||||
"institute_code": instituteCode,
|
|
||||||
"name": name,
|
|
||||||
"student": jsonEncode(student.json),
|
|
||||||
"role": role.index,
|
|
||||||
"nickname": nickname,
|
|
||||||
"picture": picture,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() => jsonEncode(toMap());
|
|
||||||
|
|
||||||
static Map<String, Object?> loginBody({
|
|
||||||
required String username,
|
|
||||||
required String password,
|
|
||||||
required String instituteCode,
|
|
||||||
}) {
|
|
||||||
return {
|
|
||||||
"userName": username,
|
|
||||||
"password": password,
|
|
||||||
"institute_code": instituteCode,
|
|
||||||
"grant_type": "password",
|
|
||||||
"client_id": KretaAPI.clientId,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static Map<String, Object?> refreshBody({
|
|
||||||
required String refreshToken,
|
|
||||||
required String instituteCode,
|
|
||||||
}) {
|
|
||||||
return {
|
|
||||||
"refresh_token": refreshToken,
|
|
||||||
"institute_code": instituteCode,
|
|
||||||
"client_id": KretaAPI.clientId,
|
|
||||||
"grant_type": "refresh_token",
|
|
||||||
"refresh_user_data": "false",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
enum AccentColor {
|
|
||||||
filc,
|
|
||||||
blue,
|
|
||||||
green,
|
|
||||||
lime,
|
|
||||||
yellow,
|
|
||||||
orange,
|
|
||||||
red,
|
|
||||||
pink,
|
|
||||||
purple,
|
|
||||||
none,
|
|
||||||
ogfilc,
|
|
||||||
adaptive,
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<AccentColor, Color> accentColorMap = {
|
|
||||||
AccentColor.filc: const Color(0xFF3D7BF4),
|
|
||||||
AccentColor.blue: Colors.blue.shade300,
|
|
||||||
AccentColor.green: Colors.green.shade400,
|
|
||||||
AccentColor.lime: Colors.lightGreen.shade400,
|
|
||||||
AccentColor.yellow: Colors.orange.shade300,
|
|
||||||
AccentColor.orange: Colors.deepOrange.shade300,
|
|
||||||
AccentColor.red: Colors.red.shade300,
|
|
||||||
AccentColor.pink: Colors.pink.shade300,
|
|
||||||
AccentColor.purple: Colors.purple.shade300,
|
|
||||||
//AccentColor.none: Colors.black,
|
|
||||||
AccentColor.ogfilc: const Color(0xff20AC9B),
|
|
||||||
AccentColor.adaptive: const Color(0xFF3D7BF4),
|
|
||||||
AccentColor.custom: const Color(0xFF3D7BF4),
|
|
||||||
};
|
|
@ -1,18 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class ThemeModeObserver extends ChangeNotifier {
|
|
||||||
ThemeMode _themeMode;
|
|
||||||
bool _updateNavbarColor;
|
|
||||||
ThemeMode get themeMode => _themeMode;
|
|
||||||
bool get updateNavbarColor => _updateNavbarColor;
|
|
||||||
|
|
||||||
ThemeModeObserver({ThemeMode initialTheme = ThemeMode.system, bool updateNavbarColor = true})
|
|
||||||
: _themeMode = initialTheme,
|
|
||||||
_updateNavbarColor = updateNavbarColor;
|
|
||||||
|
|
||||||
void changeTheme(ThemeMode mode, {bool updateNavbarColor = true}) {
|
|
||||||
_themeMode = mode;
|
|
||||||
_updateNavbarColor = updateNavbarColor;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,160 +0,0 @@
|
|||||||
import 'package:filcnaplo/models/settings.dart';
|
|
||||||
import 'package:filcnaplo/theme/colors/accent.dart';
|
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
|
||||||
import 'package:filcnaplo/theme/observer.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:material_color_utilities/material_color_utilities.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class AppTheme {
|
|
||||||
// Dev note: All of these could be constant variables, but this is better for
|
|
||||||
// development (you don't have to hot-restart)
|
|
||||||
|
|
||||||
static const String _fontFamily = "Montserrat";
|
|
||||||
|
|
||||||
static Color? _paletteAccentLight(CorePalette? palette) => palette != null ? Color(palette.primary.get(70)) : null;
|
|
||||||
static Color? _paletteHighlightLight(CorePalette? palette) => palette != null ? Color(palette.neutral.get(100)) : null;
|
|
||||||
static Color? _paletteBackgroundLight(CorePalette? palette) => palette != null ? Color(palette.neutral.get(95)) : null;
|
|
||||||
|
|
||||||
static Color? _paletteAccentDark(CorePalette? palette) => palette != null ? Color(palette.primary.get(80)) : null;
|
|
||||||
static Color? _paletteBackgroundDark(CorePalette? palette) => palette != null ? Color(palette.neutralVariant.get(10)) : null;
|
|
||||||
static Color? _paletteHighlightDark(CorePalette? palette) => palette != null ? Color(palette.neutralVariant.get(20)) : null;
|
|
||||||
|
|
||||||
// Light Theme
|
|
||||||
static ThemeData lightTheme(BuildContext context, {CorePalette? palette}) {
|
|
||||||
var lightColors = AppColors.fromBrightness(Brightness.light);
|
|
||||||
final settings = Provider.of<SettingsProvider>(context, listen: false);
|
|
||||||
AccentColor accentColor = settings.accentColor;
|
|
||||||
final customAccentColor = accentColor == AccentColor.custom ? settings.customAccentColor : null;
|
|
||||||
Color accent = customAccentColor ?? accentColorMap[accentColor] ?? const Color(0x00000000);
|
|
||||||
|
|
||||||
if (accentColor == AccentColor.adaptive) {
|
|
||||||
if (palette != null) accent = _paletteAccentLight(palette)!;
|
|
||||||
} else {
|
|
||||||
palette = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Color backgroundColor =
|
|
||||||
(accentColor == AccentColor.custom ? settings.customBackgroundColor : _paletteBackgroundLight(palette)) ?? lightColors.background;
|
|
||||||
Color highlightColor =
|
|
||||||
(accentColor == AccentColor.custom ? settings.customHighlightColor : _paletteHighlightLight(palette)) ?? lightColors.highlight;
|
|
||||||
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.light,
|
|
||||||
useMaterial3: true,
|
|
||||||
fontFamily: _fontFamily,
|
|
||||||
scaffoldBackgroundColor: backgroundColor,
|
|
||||||
primaryColor: lightColors.filc,
|
|
||||||
dividerColor: const Color(0x00000000),
|
|
||||||
colorScheme: ColorScheme(
|
|
||||||
primary: accent,
|
|
||||||
onPrimary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
|
|
||||||
secondary: accent,
|
|
||||||
onSecondary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
|
|
||||||
background: highlightColor,
|
|
||||||
onBackground: Colors.black.withOpacity(.9),
|
|
||||||
brightness: Brightness.light,
|
|
||||||
error: lightColors.red,
|
|
||||||
onError: Colors.white.withOpacity(.9),
|
|
||||||
surface: highlightColor,
|
|
||||||
onSurface: Colors.black.withOpacity(.9),
|
|
||||||
),
|
|
||||||
shadowColor: lightColors.shadow.withOpacity(.5),
|
|
||||||
appBarTheme: AppBarTheme(backgroundColor: backgroundColor),
|
|
||||||
indicatorColor: accent,
|
|
||||||
iconTheme: IconThemeData(color: lightColors.text.withOpacity(.75)),
|
|
||||||
navigationBarTheme: NavigationBarThemeData(
|
|
||||||
indicatorColor: accent.withOpacity(accentColor == AccentColor.adaptive ? 0.4 : 0.8),
|
|
||||||
iconTheme: MaterialStateProperty.all(IconThemeData(color: lightColors.text)),
|
|
||||||
backgroundColor: highlightColor,
|
|
||||||
labelTextStyle: MaterialStateProperty.all(TextStyle(
|
|
||||||
fontSize: 13.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: lightColors.text.withOpacity(0.8),
|
|
||||||
)),
|
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
|
|
||||||
height: 76.0,
|
|
||||||
),
|
|
||||||
sliderTheme: SliderThemeData(
|
|
||||||
inactiveTrackColor: accent.withOpacity(.3),
|
|
||||||
),
|
|
||||||
progressIndicatorTheme: ProgressIndicatorThemeData(color: accent),
|
|
||||||
expansionTileTheme: ExpansionTileThemeData(iconColor: accent),
|
|
||||||
cardColor: highlightColor,
|
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
|
||||||
backgroundColor: Provider.of<ThemeModeObserver>(context, listen: false).updateNavbarColor ? backgroundColor : null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dark Theme
|
|
||||||
static ThemeData darkTheme(BuildContext context, {CorePalette? palette}) {
|
|
||||||
var darkColors = AppColors.fromBrightness(Brightness.dark);
|
|
||||||
final settings = Provider.of<SettingsProvider>(context, listen: false);
|
|
||||||
AccentColor accentColor = settings.accentColor;
|
|
||||||
final customAccentColor = accentColor == AccentColor.custom ? settings.customAccentColor : null;
|
|
||||||
Color accent = customAccentColor ?? accentColorMap[accentColor] ?? const Color(0x00000000);
|
|
||||||
|
|
||||||
if (accentColor == AccentColor.adaptive) {
|
|
||||||
if (palette != null) accent = _paletteAccentDark(palette)!;
|
|
||||||
} else {
|
|
||||||
palette = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Color backgroundColor =
|
|
||||||
(accentColor == AccentColor.custom ? settings.customBackgroundColor : _paletteBackgroundDark(palette)) ?? darkColors.background;
|
|
||||||
Color highlightColor =
|
|
||||||
(accentColor == AccentColor.custom ? settings.customHighlightColor : _paletteHighlightDark(palette)) ?? darkColors.highlight;
|
|
||||||
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
useMaterial3: true,
|
|
||||||
fontFamily: _fontFamily,
|
|
||||||
scaffoldBackgroundColor: backgroundColor,
|
|
||||||
primaryColor: darkColors.filc,
|
|
||||||
dividerColor: const Color(0x00000000),
|
|
||||||
colorScheme: ColorScheme(
|
|
||||||
primary: accent,
|
|
||||||
onPrimary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
|
|
||||||
secondary: accent,
|
|
||||||
onSecondary: (accent.computeLuminance() > 0.5 ? Colors.black : Colors.white).withOpacity(.9),
|
|
||||||
background: highlightColor,
|
|
||||||
onBackground: Colors.white.withOpacity(.9),
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
error: darkColors.red,
|
|
||||||
onError: Colors.black.withOpacity(.9),
|
|
||||||
surface: highlightColor,
|
|
||||||
onSurface: Colors.white.withOpacity(.9),
|
|
||||||
),
|
|
||||||
shadowColor: highlightColor.withOpacity(.5), //darkColors.shadow,
|
|
||||||
appBarTheme: AppBarTheme(backgroundColor: backgroundColor),
|
|
||||||
indicatorColor: accent,
|
|
||||||
iconTheme: IconThemeData(color: darkColors.text.withOpacity(.75)),
|
|
||||||
navigationBarTheme: NavigationBarThemeData(
|
|
||||||
indicatorColor: accent.withOpacity(accentColor == AccentColor.adaptive ? 0.4 : 0.8),
|
|
||||||
iconTheme: MaterialStateProperty.all(IconThemeData(color: darkColors.text)),
|
|
||||||
backgroundColor: highlightColor,
|
|
||||||
labelTextStyle: MaterialStateProperty.all(TextStyle(
|
|
||||||
fontSize: 13.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: darkColors.text.withOpacity(0.8),
|
|
||||||
)),
|
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
|
|
||||||
height: 76.0,
|
|
||||||
),
|
|
||||||
sliderTheme: SliderThemeData(
|
|
||||||
inactiveTrackColor: accent.withOpacity(.3),
|
|
||||||
),
|
|
||||||
progressIndicatorTheme: ProgressIndicatorThemeData(color: accent),
|
|
||||||
expansionTileTheme: ExpansionTileThemeData(iconColor: accent),
|
|
||||||
cardColor: highlightColor,
|
|
||||||
chipTheme: ChipThemeData(
|
|
||||||
backgroundColor: accent.withOpacity(.2),
|
|
||||||
elevation: 1,
|
|
||||||
),
|
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
|
||||||
backgroundColor: Provider.of<ThemeModeObserver>(context, listen: false).updateNavbarColor ? backgroundColor : null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
import 'package:filcnaplo/ui/date_widget.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/absence.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/absence/absence_viewable.dart' as mobile;
|
|
||||||
|
|
||||||
List<DateWidget> getWidgets(List<Absence> providerAbsences, {bool noExcused = false}) {
|
|
||||||
List<DateWidget> items = [];
|
|
||||||
providerAbsences.where((a) => !noExcused || a.state != Justification.excused).forEach((absence) {
|
|
||||||
items.add(DateWidget(
|
|
||||||
key: absence.id,
|
|
||||||
date: absence.date,
|
|
||||||
widget: mobile.AbsenceViewable(absence),
|
|
||||||
));
|
|
||||||
});
|
|
||||||
return items;
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
import 'package:filcnaplo/ui/date_widget.dart';
|
|
||||||
import 'package:filcnaplo/utils/platform.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/grade.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/grade/grade_viewable.dart' as mobile;
|
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/grade/new_grades.dart' as mobile;
|
|
||||||
import 'package:filcnaplo_desktop_ui/common/widgets/grade/grade_viewable.dart' as desktop;
|
|
||||||
|
|
||||||
List<DateWidget> getWidgets(List<Grade> providerGrades, DateTime? lastSeenDate) {
|
|
||||||
List<DateWidget> items = [];
|
|
||||||
for (var grade in providerGrades) {
|
|
||||||
final surprise = (!(lastSeenDate != null && grade.date.isAfter(lastSeenDate)) || grade.value.value == 0);
|
|
||||||
if (grade.type == GradeType.midYear && surprise) {
|
|
||||||
items.add(DateWidget(
|
|
||||||
key: grade.id,
|
|
||||||
date: grade.date,
|
|
||||||
widget: PlatformUtils.isMobile ? mobile.GradeViewable(grade) : desktop.GradeViewable(grade),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<DateWidget> getNewWidgets(List<Grade> providerGrades, DateTime? lastSeenDate) {
|
|
||||||
List<DateWidget> items = [];
|
|
||||||
List<Grade> newGrades = [];
|
|
||||||
for (var grade in providerGrades) {
|
|
||||||
final surprise = !(lastSeenDate != null && !grade.date.isAfter(lastSeenDate)) && grade.value.value != 0;
|
|
||||||
if (grade.type == GradeType.midYear && surprise) {
|
|
||||||
newGrades.add(grade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newGrades.sort((a, b) => a.date.compareTo(b.date));
|
|
||||||
if (newGrades.isNotEmpty) {
|
|
||||||
items.add(DateWidget(
|
|
||||||
key: newGrades.last.id,
|
|
||||||
date: newGrades.last.date,
|
|
||||||
widget: mobile.NewGradesSurprise(newGrades),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
import 'package:filcnaplo/ui/date_widget.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/homework/homework_viewable.dart' as mobile;
|
|
||||||
|
|
||||||
List<DateWidget> getWidgets(List<Homework> providerHomework) {
|
|
||||||
List<DateWidget> items = [];
|
|
||||||
for (var homework in providerHomework) {
|
|
||||||
items.add(DateWidget(
|
|
||||||
key: homework.id,
|
|
||||||
date: homework.deadline.year != 0 ? homework.deadline : homework.date,
|
|
||||||
widget: mobile.HomeworkViewable(homework),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
return items;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
import 'package:filcnaplo/ui/date_widget.dart';
|
|
||||||
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/lesson/changed_lesson_viewable.dart' as mobile;
|
|
||||||
|
|
||||||
List<DateWidget> getWidgets(List<Lesson> providerLessons) {
|
|
||||||
List<DateWidget> items = [];
|
|
||||||
providerLessons.where((l) => l.isChanged && l.start.isAfter(DateTime.now())).forEach((lesson) {
|
|
||||||
items.add(DateWidget(
|
|
||||||
key: lesson.id,
|
|
||||||
date: DateTime(lesson.date.year, lesson.date.month, lesson.date.day, lesson.start.hour, lesson.start.minute),
|
|
||||||
widget: mobile.ChangedLessonViewable(lesson),
|
|
||||||
));
|
|
||||||
});
|
|
||||||
return items;
|
|
||||||
}
|
|