Compare commits
121 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
85
.gitignore
vendored
@@ -1,52 +1,39 @@
|
|||||||
# See https://www.dartlang.org/guides/libraries/private-files
|
|
||||||
|
|
||||||
.gitignore
|
filcnaplo/.flutter-plugins
|
||||||
|
filcnaplo/.flutter-plugins-dependencies
|
||||||
|
filcnaplo/pubspec.lock
|
||||||
|
filcnaplo/.dart_tool/
|
||||||
|
filcnaplo/android/
|
||||||
|
filcnaplo/ios/
|
||||||
|
filcnaplo/windows/
|
||||||
|
filcnaplo/linux/
|
||||||
|
filcnaplo/macos/
|
||||||
|
filcnaplo/build/
|
||||||
|
|
||||||
termek.txt
|
filcnaplo_desktop_ui/.flutter-plugins
|
||||||
|
filcnaplo_desktop_ui/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_desktop_ui/pubspec.lock
|
||||||
|
filcnaplo_desktop_ui/.dart_tool/
|
||||||
|
|
||||||
|
filcnaplo_kreta_api/.flutter-plugins
|
||||||
|
filcnaplo_kreta_api/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_kreta_api/pubspec.lock
|
||||||
|
filcnaplo_kreta_api/.dart_tool/
|
||||||
|
|
||||||
|
filcnaplo_mobile_ui/.flutter-plugins
|
||||||
|
filcnaplo_mobile_ui/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_mobile_ui/pubspec.lock
|
||||||
|
filcnaplo_mobile_ui/.dart_tool/
|
||||||
|
|
||||||
|
filcnaplo_premium/.flutter-plugins
|
||||||
|
filcnaplo_premium/.flutter-plugins-dependencies
|
||||||
|
filcnaplo_premium/pubspec.lock
|
||||||
|
filcnaplo_premium/.dart_tool/
|
||||||
|
|
||||||
|
.vscode
|
||||||
|
.github
|
||||||
|
.idea
|
||||||
|
.gitmodules
|
||||||
|
|
||||||
|
filcnaplo/.DS_Store
|
||||||
.DS_Store
|
.DS_Store
|
||||||
filc3.properties
|
|
||||||
local.properties
|
|
||||||
# Files and directories created by pub
|
|
||||||
.dart_tool/
|
|
||||||
.packages
|
|
||||||
build/
|
|
||||||
# If you're building an application, you may want to check-in your pubspec.lock
|
|
||||||
pubspec.lock
|
|
||||||
|
|
||||||
# Directory created by dartdoc
|
|
||||||
# If you don't generate documentation locally you can remove this line.
|
|
||||||
doc/api/
|
|
||||||
|
|
||||||
# Avoid committing generated Javascript files:
|
|
||||||
*.dart.js
|
|
||||||
*.info.json # Produced by the --dump-info flag.
|
|
||||||
*.js # When generated by dart2js. Don't specify *.js if your
|
|
||||||
# project includes source files written in JavaScript.
|
|
||||||
*.js_
|
|
||||||
*.js.deps
|
|
||||||
*.js.map
|
|
||||||
|
|
||||||
*.txt
|
|
||||||
filcnaplo/macos/Flutter/GeneratedPluginRegistrant.swift
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/connectivity_plus
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/dynamic_color
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/flutter_acrylic
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/permission_handler_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/share_plus_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows
|
|
||||||
filcnaplo/windows/flutter/ephemeral/generated_config.cmake
|
|
||||||
filcnaplo/windows/flutter/generated_plugin_registrant.cc
|
|
||||||
filcnaplo/windows/flutter/generated_plugin_registrant.h
|
|
||||||
filcnaplo/windows/flutter/generated_plugins.cmake
|
|
||||||
filcnaplo/linux/flutter/generated_plugin_registrant.cc
|
|
||||||
filcnaplo/linux/flutter/generated_plugin_registrant.h
|
|
||||||
filcnaplo/linux/flutter/generated_plugins.cmake
|
|
||||||
filcnaplo/macos/Flutter/*
|
|
||||||
filcnaplo/ios/Podfile.lock
|
|
||||||
.vscode/
|
|
||||||
key.properties
|
|
||||||
|
|
||||||
.flutter-plugins*
|
|
||||||
filcnaplo/ios/Flutter/flutter_export_environment 4.sh
|
|
||||||
filcnaplo/ios/Flutter/Generated 4.xcconfig
|
|
||||||
|
|||||||
3
.gitmodules
vendored
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "filcnaplo_premium"]
|
||||||
|
path = filcnaplo_premium
|
||||||
|
url = git@github.com:refilc/naplo-plus.git
|
||||||
|
|||||||
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -43,7 +43,7 @@ Az összes (ugyan azon verzióhoz tartozó) contribution meg fog jelenni a relea
|
|||||||
|
|
||||||
**vrolandd, TMarccci:** head developer
|
**vrolandd, TMarccci:** head developer
|
||||||
|
|
||||||
**dwe., xou, SebRHQ:** designer
|
**dwe., xou:** designer
|
||||||
|
|
||||||
**Péter:** video editor
|
**Péter:** video editor
|
||||||
|
|
||||||
|
|||||||
91
filcnaplo/.gitignore
vendored
@@ -1,47 +1,44 @@
|
|||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
*.class
|
*.class
|
||||||
*.log
|
*.log
|
||||||
*.pyc
|
*.pyc
|
||||||
*.swp
|
*.swp
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.atom/
|
.atom/
|
||||||
.buildlog/
|
.buildlog/
|
||||||
.history
|
.history
|
||||||
.svn/
|
.svn/
|
||||||
|
migrate_working_dir/
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
# IntelliJ related
|
||||||
*.ipr
|
*.iml
|
||||||
*.iws
|
*.ipr
|
||||||
.idea/
|
*.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
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
# is commented out by default.
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
#.vscode/
|
# is commented out by default.
|
||||||
|
#.vscode/
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
# Flutter/Dart/Pub related
|
||||||
**/ios/Flutter/.last_build_id
|
**/doc/api/
|
||||||
.dart_tool/
|
**/ios/Flutter/.last_build_id
|
||||||
.flutter-plugins
|
.dart_tool/
|
||||||
.flutter-plugins-dependencies
|
.flutter-plugins
|
||||||
.packages
|
.flutter-plugins-dependencies
|
||||||
.pub-cache/
|
.packages
|
||||||
.pub/
|
.pub-cache/
|
||||||
/build/
|
.pub/
|
||||||
|
/build/
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
# Symbolication related
|
||||||
|
app.*.symbols
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
# Obfuscation related
|
||||||
|
app.*.map.json
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
# Android Studio will place build artifacts here
|
||||||
|
/android/app/debug
|
||||||
# Android Studio will place build artifacts here
|
/android/app/profile
|
||||||
/android/app/debug
|
/android/app/release
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
key.properties
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# This file tracks properties of this Flutter project.
|
# This file tracks properties of this Flutter project.
|
||||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
#
|
#
|
||||||
# This file should be version controlled.
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
version:
|
version:
|
||||||
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
revision: "b0366e0a3f089e15fd89c97604ab402fe26b724c"
|
||||||
channel: stable
|
channel: "stable"
|
||||||
|
|
||||||
project_type: app
|
project_type: app
|
||||||
|
|
||||||
@@ -13,11 +13,17 @@ project_type: app
|
|||||||
migration:
|
migration:
|
||||||
platforms:
|
platforms:
|
||||||
- platform: root
|
- platform: root
|
||||||
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
- platform: web
|
- platform: linux
|
||||||
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
- platform: macos
|
||||||
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
- platform: windows
|
||||||
|
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
|
||||||
|
|
||||||
# User provided section
|
# User provided section
|
||||||
|
|
||||||
|
|||||||
12
filcnaplo/android/.gitignore
vendored
@@ -1,12 +0,0 @@
|
|||||||
gradle-wrapper.jar
|
|
||||||
/.gradle
|
|
||||||
/captures/
|
|
||||||
/gradlew
|
|
||||||
/gradlew.bat
|
|
||||||
/local.properties
|
|
||||||
GeneratedPluginRegistrant.java
|
|
||||||
|
|
||||||
# Remember to never publicly share your keystore.
|
|
||||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
|
||||||
key.properties
|
|
||||||
.project
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo">
|
xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo">
|
||||||
<application android:name="${applicationName}" android:label="reFilc" tools:replace="android:label" android:icon="@mipmap/ic_launcher"
|
<application android:name="${applicationName}" android:label="reFilc" tools:replace="android:label" android:icon="@mipmap/ic_launcher"
|
||||||
android:requestLegacyExternalStorage="true">
|
android:requestLegacyExternalStorage="true" android:enableOnBackInvokedCallback="false">
|
||||||
<activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
|
<activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
|
||||||
android:launchMode="singleTop" android:theme="@style/LaunchTheme"
|
android:launchMode="singleTop" android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
<meta-data android:name="io.flutter.embedding.android.NormalTheme"
|
<meta-data android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme" />
|
android:resource="@style/NormalTheme" />
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<!-- commented bc of dynamic app icons -->
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter android:autoVerify="true">
|
<intent-filter android:autoVerify="true">
|
||||||
@@ -39,6 +40,69 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
<meta-data android:name="flutterEmbedding" android:value="2" />
|
||||||
|
|
||||||
|
<!-- custom app icon thingies from here -->
|
||||||
|
<!-- <activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_default"
|
||||||
|
android:name=".MainActivityAlias"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_default"
|
||||||
|
android:name=".MainActivityAliasrefilc_default"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_overcomplicated"
|
||||||
|
android:name=".MainActivityAliasrefilc_overcomplicated"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_concept"
|
||||||
|
android:name=".MainActivityAliasrefilc_concept"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias>
|
||||||
|
<activity-alias
|
||||||
|
android:label="reFilc"
|
||||||
|
android:icon="@drawable/launch_ic_refilc_pride"
|
||||||
|
android:name=".MainActivityAliasrefilc_pride"
|
||||||
|
android:enabled="false"
|
||||||
|
android:exported="true"
|
||||||
|
android:targetActivity=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity-alias> -->
|
||||||
|
<!-- end of custom app icon thingies -->
|
||||||
|
|
||||||
<receiver android:name="hu.refilc.naplo.widget_timetable.WidgetTimetable"
|
<receiver android:name="hu.refilc.naplo.widget_timetable.WidgetTimetable"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 13 KiB |
@@ -1,93 +0,0 @@
|
|||||||
Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
||||||
BIN
filcnaplo/assets/launch_icons/refilc_concept.png
Normal file
|
After Width: | Height: | Size: 145 KiB |
BIN
filcnaplo/assets/launch_icons/refilc_default.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
filcnaplo/assets/launch_icons/refilc_overcomplicated.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
filcnaplo/assets/launch_icons/refilc_pride.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
33
filcnaplo/ios/.gitignore
vendored
@@ -1,33 +0,0 @@
|
|||||||
*.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
*.moved-aside
|
|
||||||
*.pbxuser
|
|
||||||
*.perspectivev3
|
|
||||||
**/*sync/
|
|
||||||
.sconsign.dblite
|
|
||||||
.tags*
|
|
||||||
**/.vagrant/
|
|
||||||
**/DerivedData/
|
|
||||||
Icon?
|
|
||||||
**/Pods/
|
|
||||||
**/.symlinks/
|
|
||||||
profile
|
|
||||||
xcuserdata
|
|
||||||
**/.generated/
|
|
||||||
Flutter/App.framework
|
|
||||||
Flutter/Flutter.framework
|
|
||||||
Flutter/Flutter.podspec
|
|
||||||
Flutter/Generated.xcconfig
|
|
||||||
Flutter/ephemeral/
|
|
||||||
Flutter/app.flx
|
|
||||||
Flutter/app.zip
|
|
||||||
Flutter/flutter_assets/
|
|
||||||
Flutter/flutter_export_environment.sh
|
|
||||||
ServiceDefinitions.json
|
|
||||||
Runner/GeneratedPluginRegistrant.*
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
|
||||||
!default.mode1v3
|
|
||||||
!default.mode2v3
|
|
||||||
!default.pbxuser
|
|
||||||
!default.perspectivev3
|
|
||||||
@@ -17,6 +17,14 @@
|
|||||||
3127F7A828EAEE8500C2EFB3 /* lesson_model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */; };
|
3127F7A828EAEE8500C2EFB3 /* lesson_model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */; };
|
||||||
373A6ECB5FC71FE9D8AF2EDB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F0ADD56276103500A3016C8 /* Pods_Runner.framework */; };
|
373A6ECB5FC71FE9D8AF2EDB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F0ADD56276103500A3016C8 /* Pods_Runner.framework */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
3B4461282AE6E0FF00AAE6FD /* refilc_default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461202AE6E0FF00AAE6FD /* refilc_default@2x.png */; };
|
||||||
|
3B4461292AE6E0FF00AAE6FD /* refilc_concept@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461212AE6E0FF00AAE6FD /* refilc_concept@2x.png */; };
|
||||||
|
3B44612A2AE6E0FF00AAE6FD /* refilc_concept@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461222AE6E0FF00AAE6FD /* refilc_concept@3x.png */; };
|
||||||
|
3B44612B2AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461232AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png */; };
|
||||||
|
3B44612C2AE6E0FF00AAE6FD /* refilc_default@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461242AE6E0FF00AAE6FD /* refilc_default@3x.png */; };
|
||||||
|
3B44612D2AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461252AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png */; };
|
||||||
|
3B44612E2AE6E0FF00AAE6FD /* refilc_pride@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461262AE6E0FF00AAE6FD /* refilc_pride@2x.png */; };
|
||||||
|
3B44612F2AE6E0FF00AAE6FD /* refilc_pride@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3B4461272AE6E0FF00AAE6FD /* refilc_pride@3x.png */; };
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
@@ -73,6 +81,14 @@
|
|||||||
3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = lesson_model.swift; sourceTree = "<group>"; };
|
3127F7A728EAEE8500C2EFB3 /* lesson_model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = lesson_model.swift; sourceTree = "<group>"; };
|
||||||
317DE77A294F6FFB002E323E /* livecard.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = livecard.entitlements; sourceTree = "<group>"; };
|
317DE77A294F6FFB002E323E /* livecard.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = livecard.entitlements; sourceTree = "<group>"; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
3B4461202AE6E0FF00AAE6FD /* refilc_default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_default@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_default@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461212AE6E0FF00AAE6FD /* refilc_concept@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_concept@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_concept@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461222AE6E0FF00AAE6FD /* refilc_concept@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_concept@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_concept@3x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461232AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_overcomplicated@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_overcomplicated@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461242AE6E0FF00AAE6FD /* refilc_default@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_default@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_default@3x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461252AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_overcomplicated@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_overcomplicated@3x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461262AE6E0FF00AAE6FD /* refilc_pride@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_pride@2x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized/refilc_pride@2x.png"; sourceTree = "<group>"; };
|
||||||
|
3B4461272AE6E0FF00AAE6FD /* refilc_pride@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "refilc_pride@3x.png"; path = "../../../../../../../../../Downloads/iloveimg-resized (1)/refilc_pride@3x.png"; sourceTree = "<group>"; };
|
||||||
707F8089D970F81C480F73C4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
707F8089D970F81C480F73C4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
@@ -122,6 +138,21 @@
|
|||||||
path = livecard;
|
path = livecard;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
3B44611F2AE6DF7200AAE6FD /* App Icons */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3B4461212AE6E0FF00AAE6FD /* refilc_concept@2x.png */,
|
||||||
|
3B4461222AE6E0FF00AAE6FD /* refilc_concept@3x.png */,
|
||||||
|
3B4461202AE6E0FF00AAE6FD /* refilc_default@2x.png */,
|
||||||
|
3B4461242AE6E0FF00AAE6FD /* refilc_default@3x.png */,
|
||||||
|
3B4461232AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png */,
|
||||||
|
3B4461252AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png */,
|
||||||
|
3B4461262AE6E0FF00AAE6FD /* refilc_pride@2x.png */,
|
||||||
|
3B4461272AE6E0FF00AAE6FD /* refilc_pride@3x.png */,
|
||||||
|
);
|
||||||
|
path = "App Icons";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
6640A963014A9D4F31026053 /* Frameworks */ = {
|
6640A963014A9D4F31026053 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -178,6 +209,7 @@
|
|||||||
97C146F01CF9000F007C117D /* Runner */ = {
|
97C146F01CF9000F007C117D /* Runner */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
3B44611F2AE6DF7200AAE6FD /* App Icons */,
|
||||||
3127F73928EAEC3200C2EFB3 /* Runner.entitlements */,
|
3127F73928EAEC3200C2EFB3 /* Runner.entitlements */,
|
||||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||||
@@ -286,10 +318,18 @@
|
|||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
3B44612A2AE6E0FF00AAE6FD /* refilc_concept@3x.png in Resources */,
|
||||||
|
3B44612F2AE6E0FF00AAE6FD /* refilc_pride@3x.png in Resources */,
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
|
3B44612E2AE6E0FF00AAE6FD /* refilc_pride@2x.png in Resources */,
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
|
3B44612C2AE6E0FF00AAE6FD /* refilc_default@3x.png in Resources */,
|
||||||
|
3B4461292AE6E0FF00AAE6FD /* refilc_concept@2x.png in Resources */,
|
||||||
|
3B4461282AE6E0FF00AAE6FD /* refilc_default@2x.png in Resources */,
|
||||||
|
3B44612D2AE6E0FF00AAE6FD /* refilc_overcomplicated@3x.png in Resources */,
|
||||||
|
3B44612B2AE6E0FF00AAE6FD /* refilc_overcomplicated@2x.png in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,59 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>CFBundleAlternateIcons</key>
|
||||||
|
<dict>
|
||||||
|
<key>refilc_pride</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_pride</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<key>refilc_overcomplicated</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_overcomplicated</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<key>refilc_concept</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_concept</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<key>refilc_default</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>refilc_default</string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>CFBundleIcons</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundlePrimaryIcon</key>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIconName</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string></string>
|
||||||
|
</array>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||||
<array>
|
<array>
|
||||||
<string>com.transistorsoft.fetch</string>
|
<string>com.transistorsoft.fetch</string>
|
||||||
|
|||||||
@@ -190,12 +190,22 @@ class FilcAPI {
|
|||||||
|
|
||||||
static Future<void> sendReport(ErrorReport report) async {
|
static Future<void> sendReport(ErrorReport report) async {
|
||||||
try {
|
try {
|
||||||
http.Response res = await http.post(Uri.parse(reportApi), body: {
|
Map body = {
|
||||||
"os": report.os,
|
"os": report.os,
|
||||||
"version": report.version,
|
"version": report.version,
|
||||||
"error": report.error,
|
"error": report.error,
|
||||||
"stack_trace": report.stack,
|
"stack_trace": report.stack,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
var client = http.Client();
|
||||||
|
|
||||||
|
http.Response res = await client.post(
|
||||||
|
Uri.parse(reportApi),
|
||||||
|
body: body,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
@@ -213,6 +223,8 @@ class FilcAPI {
|
|||||||
theme.json['background_color'] = theme.backgroundColor.value.toString();
|
theme.json['background_color'] = theme.backgroundColor.value.toString();
|
||||||
theme.json['panels_color'] = theme.panelsColor.value.toString();
|
theme.json['panels_color'] = theme.panelsColor.value.toString();
|
||||||
theme.json['accent_color'] = theme.accentColor.value.toString();
|
theme.json['accent_color'] = theme.accentColor.value.toString();
|
||||||
|
theme.json['icon_color'] = theme.iconColor.value.toString();
|
||||||
|
theme.json['shadow_effect'] = theme.shadowEffect.toString();
|
||||||
|
|
||||||
// set linked grade colors
|
// set linked grade colors
|
||||||
theme.json['grade_colors_id'] = theme.gradeColors.id;
|
theme.json['grade_colors_id'] = theme.gradeColors.id;
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ Future loginAPI({
|
|||||||
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
Provider.of<ExamProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false)
|
||||||
|
.fetchAllRecipients(),
|
||||||
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
Provider.of<NoteProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<EventProvider>(context, listen: false).fetch(),
|
Provider.of<EventProvider>(context, listen: false).fetch(),
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ Future<void> syncAll(BuildContext context) {
|
|||||||
print("INFO Syncing all");
|
print("INFO Syncing all");
|
||||||
|
|
||||||
UserProvider user = Provider.of<UserProvider>(context, listen: false);
|
UserProvider user = Provider.of<UserProvider>(context, listen: false);
|
||||||
StatusProvider statusProvider = Provider.of<StatusProvider>(context, listen: false);
|
StatusProvider statusProvider =
|
||||||
|
Provider.of<StatusProvider>(context, listen: false);
|
||||||
|
|
||||||
List<Future<void>> tasks = [];
|
List<Future<void>> tasks = [];
|
||||||
int taski = 0;
|
int taski = 0;
|
||||||
@@ -47,10 +48,14 @@ Future<void> syncAll(BuildContext context) {
|
|||||||
|
|
||||||
tasks = [
|
tasks = [
|
||||||
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<GradeProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<TimetableProvider>(context, listen: false).fetch(week: Week.current())),
|
syncStatus(Provider.of<TimetableProvider>(context, listen: false)
|
||||||
|
.fetch(week: Week.current())),
|
||||||
syncStatus(Provider.of<ExamProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<ExamProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<HomeworkProvider>(context, listen: false).fetch(from: DateTime.now().subtract(const Duration(days: 30)))),
|
syncStatus(Provider.of<HomeworkProvider>(context, listen: false)
|
||||||
|
.fetch(from: DateTime.now().subtract(const Duration(days: 30)))),
|
||||||
syncStatus(Provider.of<MessageProvider>(context, listen: false).fetchAll()),
|
syncStatus(Provider.of<MessageProvider>(context, listen: false).fetchAll()),
|
||||||
|
syncStatus(
|
||||||
|
Provider.of<MessageProvider>(context, listen: false).fetchAllRecipients()),
|
||||||
syncStatus(Provider.of<NoteProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<NoteProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<EventProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<EventProvider>(context, listen: false).fetch()),
|
||||||
syncStatus(Provider.of<AbsenceProvider>(context, listen: false).fetch()),
|
syncStatus(Provider.of<AbsenceProvider>(context, listen: false).fetch()),
|
||||||
@@ -58,14 +63,17 @@ Future<void> syncAll(BuildContext context) {
|
|||||||
// Sync student
|
// Sync student
|
||||||
syncStatus(() async {
|
syncStatus(() async {
|
||||||
if (user.user == null) return;
|
if (user.user == null) return;
|
||||||
Map? studentJson = await Provider.of<KretaClient>(context, listen: false).getAPI(KretaAPI.student(user.instituteCode!));
|
Map? studentJson = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(KretaAPI.student(user.instituteCode!));
|
||||||
if (studentJson == null) return;
|
if (studentJson == null) return;
|
||||||
Student student = Student.fromJson(studentJson);
|
Student student = Student.fromJson(studentJson);
|
||||||
|
|
||||||
user.user?.name = student.name;
|
user.user?.name = student.name;
|
||||||
|
|
||||||
// Store user
|
// Store user
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false).store.storeUser(user.user!);
|
await Provider.of<DatabaseProvider>(context, listen: false)
|
||||||
|
.store
|
||||||
|
.storeUser(user.user!);
|
||||||
}()),
|
}()),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: deprecated_member_use
|
||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
@@ -14,7 +16,7 @@ import 'package:filcnaplo/theme/theme.dart';
|
|||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
||||||
import 'package:filcnaplo_premium/providers/goal_provider.dart';
|
import 'package:filcnaplo_premium/providers/goal_provider.dart';
|
||||||
import 'package:filcnaplo_premium/providers/share_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/share_provider.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -62,11 +64,10 @@ class App extends StatelessWidget {
|
|||||||
final DatabaseProvider database;
|
final DatabaseProvider database;
|
||||||
|
|
||||||
const App(
|
const App(
|
||||||
{Key? key,
|
{super.key,
|
||||||
required this.database,
|
required this.database,
|
||||||
required this.settings,
|
required this.settings,
|
||||||
required this.user})
|
required this.user});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ const settingsDB = DatabaseStruct("settings", {
|
|||||||
"accent_color": int, "news": int, "seen_news": String,
|
"accent_color": int, "news": int, "seen_news": String,
|
||||||
"developer_mode": int,
|
"developer_mode": int,
|
||||||
"update_channel": int, "config": String, "custom_accent_color": int,
|
"update_channel": int, "config": String, "custom_accent_color": int,
|
||||||
"custom_background_color": int, "custom_highlight_color": int, // general
|
"custom_background_color": int, "custom_highlight_color": int,
|
||||||
|
"custom_icon_color": int, "shadow_effect": int, // general
|
||||||
"grade_color1": int, "grade_color2": int, "grade_color3": int,
|
"grade_color1": int, "grade_color2": int, "grade_color3": int,
|
||||||
"grade_color4": int, "grade_color5": int, // grade colors
|
"grade_color4": int, "grade_color5": int, // grade colors
|
||||||
"vibration_strength": int, "ab_weeks": int, "swap_ab_weeks": int,
|
"vibration_strength": int, "ab_weeks": int, "swap_ab_weeks": int,
|
||||||
@@ -33,7 +34,7 @@ const settingsDB = DatabaseStruct("settings", {
|
|||||||
"renamed_subjects_italics": int, "renamed_teachers_enabled": int,
|
"renamed_subjects_italics": int, "renamed_teachers_enabled": int,
|
||||||
"renamed_teachers_italics": int,
|
"renamed_teachers_italics": int,
|
||||||
"live_activity_color": String,
|
"live_activity_color": String,
|
||||||
"welcome_message": String,
|
"welcome_message": String, "app_icon": String,
|
||||||
});
|
});
|
||||||
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
||||||
// YOU'VE BEEN WARNED!!!
|
// YOU'VE BEEN WARNED!!!
|
||||||
@@ -44,7 +45,7 @@ const usersDB = DatabaseStruct("users", {
|
|||||||
});
|
});
|
||||||
const userDataDB = DatabaseStruct("user_data", {
|
const userDataDB = DatabaseStruct("user_data", {
|
||||||
"id": String, "grades": String, "timetable": String, "exams": String,
|
"id": String, "grades": String, "timetable": String, "exams": String,
|
||||||
"homework": String, "messages": String, "notes": String,
|
"homework": String, "messages": String, "recipients": String, "notes": String,
|
||||||
"events": String, "absences": String, "group_averages": String,
|
"events": String, "absences": String, "group_averages": String,
|
||||||
// renamed subjects // non kreta data
|
// renamed subjects // non kreta data
|
||||||
"renamed_subjects": String,
|
"renamed_subjects": String,
|
||||||
@@ -100,7 +101,8 @@ Future<Database> initDB(DatabaseProvider database) async {
|
|||||||
);
|
);
|
||||||
await migrateDB(db, struct: userDataDB, defaultValues: {
|
await migrateDB(db, struct: userDataDB, defaultValues: {
|
||||||
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]",
|
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]",
|
||||||
"messages": "[]", "notes": "[]", "events": "[]", "absences": "[]",
|
"messages": "[]", "recipients": "[]", "notes": "[]", "events": "[]",
|
||||||
|
"absences": "[]",
|
||||||
"group_averages": "[]",
|
"group_averages": "[]",
|
||||||
// renamed subjects // non kreta data
|
// renamed subjects // non kreta data
|
||||||
"renamed_subjects": "{}",
|
"renamed_subjects": "{}",
|
||||||
|
|||||||
@@ -122,6 +122,19 @@ class UserDatabaseQuery {
|
|||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<List<SendRecipient>> getRecipients({required String userId}) async {
|
||||||
|
List<Map> userData =
|
||||||
|
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
||||||
|
if (userData.isEmpty) return [];
|
||||||
|
String? recipientsJson = userData.elementAt(0)["recipients"] as String?;
|
||||||
|
if (recipientsJson == null) return [];
|
||||||
|
List<SendRecipient> recipients = (jsonDecode(recipientsJson) as List)
|
||||||
|
.map((e) =>
|
||||||
|
SendRecipient.fromJson(e, SendRecipientType.fromJson(e['tipus'])))
|
||||||
|
.toList();
|
||||||
|
return recipients;
|
||||||
|
}
|
||||||
|
|
||||||
Future<List<Note>> getNotes({required String userId}) async {
|
Future<List<Note>> getNotes({required String userId}) async {
|
||||||
List<Map> userData =
|
List<Map> userData =
|
||||||
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ class UserDatabaseStore {
|
|||||||
where: "id = ?", whereArgs: [userId]);
|
where: "id = ?", whereArgs: [userId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> storeRecipients(List<SendRecipient> recipients,
|
||||||
|
{required String userId}) async {
|
||||||
|
String recipientsJson = jsonEncode(recipients.map((e) => e.json).toList());
|
||||||
|
await db.update("user_data", {"recipients": recipientsJson},
|
||||||
|
where: "id = ?", whereArgs: [userId]);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> storeNotes(List<Note> notes, {required String userId}) async {
|
Future<void> storeNotes(List<Note> notes, {required String userId}) async {
|
||||||
String notesJson = jsonEncode(notes.map((e) => e.json).toList());
|
String notesJson = jsonEncode(notes.map((e) => e.json).toList());
|
||||||
await db.update("user_data", {"notes": notesJson},
|
await db.update("user_data", {"notes": notesJson},
|
||||||
|
|||||||
@@ -9,16 +9,20 @@ import 'package:filcnaplo_kreta_api/client/client.dart';
|
|||||||
import 'package:filcnaplo_kreta_api/models/attachment.dart';
|
import 'package:filcnaplo_kreta_api/models/attachment.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:open_file/open_file.dart';
|
import 'package:open_filex/open_filex.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
extension AttachmentHelper on Attachment {
|
extension AttachmentHelper on Attachment {
|
||||||
Future<String> download(BuildContext context, {bool overwrite = false}) async {
|
Future<String> download(BuildContext context,
|
||||||
|
{bool overwrite = false}) async {
|
||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!overwrite && await File("$downloads/$name").exists()) return "$downloads/$name";
|
if (!overwrite && await File("$downloads/$name").exists()) {
|
||||||
|
return "$downloads/$name";
|
||||||
|
}
|
||||||
|
|
||||||
Uint8List data = await Provider.of<KretaClient>(context, listen: false).getAPI(downloadUrl, rawResponse: true);
|
Uint8List data = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(downloadUrl, rawResponse: true);
|
||||||
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
||||||
|
|
||||||
return "$downloads/$name";
|
return "$downloads/$name";
|
||||||
@@ -28,19 +32,24 @@ extension AttachmentHelper on Attachment {
|
|||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!await File("$downloads/$name").exists()) await download(context);
|
if (!await File("$downloads/$name").exists()) await download(context);
|
||||||
var result = await OpenFile.open("$downloads/$name");
|
var result = await OpenFilex.open("$downloads/$name");
|
||||||
return result.type == ResultType.done;
|
return result.type == ResultType.done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension HomeworkAttachmentHelper on HomeworkAttachment {
|
extension HomeworkAttachmentHelper on HomeworkAttachment {
|
||||||
Future<String> download(BuildContext context, {bool overwrite = false}) async {
|
Future<String> download(BuildContext context,
|
||||||
|
{bool overwrite = false}) async {
|
||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!overwrite && await File("$downloads/$name").exists()) return "$downloads/$name";
|
if (!overwrite && await File("$downloads/$name").exists()) {
|
||||||
|
return "$downloads/$name";
|
||||||
|
}
|
||||||
|
|
||||||
String url = downloadUrl(Provider.of<UserProvider>(context, listen: false).instituteCode ?? "");
|
String url = downloadUrl(
|
||||||
Uint8List data = await Provider.of<KretaClient>(context, listen: false).getAPI(url, rawResponse: true);
|
Provider.of<UserProvider>(context, listen: false).instituteCode ?? "");
|
||||||
|
Uint8List data = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(url, rawResponse: true);
|
||||||
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
if (!await StorageHelper.write("$downloads/$name", data)) return "";
|
||||||
|
|
||||||
return "$downloads/$name";
|
return "$downloads/$name";
|
||||||
@@ -50,7 +59,7 @@ extension HomeworkAttachmentHelper on HomeworkAttachment {
|
|||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|
||||||
if (!await File("$downloads/$name").exists()) await download(context);
|
if (!await File("$downloads/$name").exists()) await download(context);
|
||||||
var result = await OpenFile.open("$downloads/$name");
|
var result = await OpenFilex.open("$downloads/$name");
|
||||||
return result.type == ResultType.done;
|
return result.type == ResultType.done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ class SubjectIconData {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
SubjectIconVariants createIcon({required IconData material, required IconData cupertino}) {
|
SubjectIconVariants createIcon(
|
||||||
|
{required IconData material, required IconData cupertino}) {
|
||||||
return {
|
return {
|
||||||
IconPack.material: material,
|
IconPack.material: material,
|
||||||
IconPack.cupertino: cupertino,
|
IconPack.cupertino: cupertino,
|
||||||
@@ -30,88 +31,224 @@ SubjectIconVariants createIcon({required IconData material, required IconData cu
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SubjectIcon {
|
class SubjectIcon {
|
||||||
static String resolveName({Subject? subject, String? subjectName}) => _resolve(subject: subject, subjectName: subjectName).name;
|
static String resolveName({GradeSubject? subject, String? subjectName}) =>
|
||||||
static IconData resolveVariant({Subject? subject, String? subjectName, required BuildContext context}) =>
|
_resolve(subject: subject, subjectName: subjectName).name;
|
||||||
_resolve(subject: subject, subjectName: subjectName).data[Provider.of<SettingsProvider>(context, listen: false).iconPack]!;
|
static IconData resolveVariant(
|
||||||
|
{GradeSubject? subject,
|
||||||
|
String? subjectName,
|
||||||
|
required BuildContext context}) =>
|
||||||
|
_resolve(subject: subject, subjectName: subjectName).data[
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false).iconPack]!;
|
||||||
|
|
||||||
static SubjectIconData _resolve({Subject? subject, String? subjectName}) {
|
static SubjectIconData _resolve(
|
||||||
|
{GradeSubject? subject, String? subjectName}) {
|
||||||
assert(!(subject == null && subjectName == null));
|
assert(!(subject == null && subjectName == null));
|
||||||
|
|
||||||
String name = (subject?.name ?? subjectName ?? "").toLowerCase().specialChars().trim();
|
String name = (subject?.name ?? subjectName ?? "")
|
||||||
String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
.toLowerCase()
|
||||||
|
.specialChars()
|
||||||
|
.trim();
|
||||||
|
String category =
|
||||||
|
subject?.category.description.toLowerCase().specialChars() ?? "";
|
||||||
|
|
||||||
// todo: check for categories
|
// todo: check for categories
|
||||||
if (RegExp("mate(k|matika)").hasMatch(name) || category == "matematika") {
|
if (RegExp("mate(k|matika)").hasMatch(name) || category == "matematika") {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.function, material: Icons.calculate_outlined), name: "function");
|
|
||||||
} else if (RegExp("magyar nyelv|nyelvtan").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.textformat_alt, material: Icons.spellcheck_outlined), name: "textformat.alt");
|
|
||||||
} else if (RegExp("irodalom").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.book, material: Icons.menu_book_outlined), name: "book");
|
|
||||||
} else if (RegExp("tor(i|tenelem)").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.compass, material: Icons.hourglass_empty_outlined), name: "safari");
|
|
||||||
} else if (RegExp("foldrajz").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.map, material: Icons.public_outlined), name: "map");
|
|
||||||
} else if (RegExp("rajz|muvtori|muveszet|vizualis").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.paintbrush, material: Icons.palette_outlined), name: "paintbrush");
|
|
||||||
} else if (RegExp("fizika").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.lightbulb, material: Icons.emoji_objects_outlined), name: "lightbulb");
|
|
||||||
} else if (RegExp("^enek|zene|szolfezs|zongora|korus").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.music_note, material: Icons.music_note_outlined), name: "music.note");
|
|
||||||
} else if (RegExp("^tes(i|tneveles)|sport").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.sportscourt, material: Icons.sports_soccer_outlined), name: "sportscourt");
|
|
||||||
} else if (RegExp("kemia").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.lab_flask, material: Icons.science_outlined), name: "testtube.2");
|
|
||||||
} else if (RegExp("biologia").hasMatch(name)) {
|
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.paw, material: Icons.pets_outlined), name: "pawprint");
|
|
||||||
} else if (RegExp("kornyezet|termeszet ?(tudomany|ismeret)|hon( es nep)?ismeret").hasMatch(name)) {
|
|
||||||
return SubjectIconData(
|
return SubjectIconData(
|
||||||
data: createIcon(cupertino: CupertinoIcons.arrow_3_trianglepath, material: Icons.eco_outlined), name: "arrow.3.trianglepath");
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.function,
|
||||||
|
material: Icons.calculate_outlined),
|
||||||
|
name: "function");
|
||||||
|
} else if (RegExp("magyar nyelv|nyelvtan").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.textformat_alt,
|
||||||
|
material: Icons.spellcheck_outlined),
|
||||||
|
name: "textformat.alt");
|
||||||
|
} else if (RegExp("irodalom").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.book,
|
||||||
|
material: Icons.menu_book_outlined),
|
||||||
|
name: "book");
|
||||||
|
} else if (RegExp("tor(i|tenelem)").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.compass,
|
||||||
|
material: Icons.hourglass_empty_outlined),
|
||||||
|
name: "safari");
|
||||||
|
} else if (RegExp("foldrajz").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.map, material: Icons.public_outlined),
|
||||||
|
name: "map");
|
||||||
|
} else if (RegExp("rajz|muvtori|muveszet|vizualis").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.paintbrush,
|
||||||
|
material: Icons.palette_outlined),
|
||||||
|
name: "paintbrush");
|
||||||
|
} else if (RegExp("fizika").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.lightbulb,
|
||||||
|
material: Icons.emoji_objects_outlined),
|
||||||
|
name: "lightbulb");
|
||||||
|
} else if (RegExp("^enek|zene|szolfezs|zongora|korus").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.music_note,
|
||||||
|
material: Icons.music_note_outlined),
|
||||||
|
name: "music.note");
|
||||||
|
} else if (RegExp("^tes(i|tneveles)|sport").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.sportscourt,
|
||||||
|
material: Icons.sports_soccer_outlined),
|
||||||
|
name: "sportscourt");
|
||||||
|
} else if (RegExp("kemia").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.lab_flask,
|
||||||
|
material: Icons.science_outlined),
|
||||||
|
name: "testtube.2");
|
||||||
|
} else if (RegExp("biologia").hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.paw, material: Icons.pets_outlined),
|
||||||
|
name: "pawprint");
|
||||||
|
} else if (RegExp(
|
||||||
|
"kornyezet|termeszet ?(tudomany|ismeret)|hon( es nep)?ismeret")
|
||||||
|
.hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.arrow_3_trianglepath,
|
||||||
|
material: Icons.eco_outlined),
|
||||||
|
name: "arrow.3.trianglepath");
|
||||||
} else if (RegExp("(hit|erkolcs)tan|vallas|etika").hasMatch(name)) {
|
} else if (RegExp("(hit|erkolcs)tan|vallas|etika").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.heart, material: Icons.favorite_border_outlined), name: "heart");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.heart,
|
||||||
|
material: Icons.favorite_border_outlined),
|
||||||
|
name: "heart");
|
||||||
} else if (RegExp("penzugy").hasMatch(name)) {
|
} else if (RegExp("penzugy").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.money_dollar, material: Icons.savings_outlined), name: "dollarsign");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.money_dollar,
|
||||||
|
material: Icons.savings_outlined),
|
||||||
|
name: "dollarsign");
|
||||||
} else if (RegExp("informatika|szoftver|iroda|digitalis").hasMatch(name)) {
|
} else if (RegExp("informatika|szoftver|iroda|digitalis").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.device_laptop, material: Icons.computer_outlined), name: "laptopcomputer");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.device_laptop,
|
||||||
|
material: Icons.computer_outlined),
|
||||||
|
name: "laptopcomputer");
|
||||||
} else if (RegExp("prog").hasMatch(name)) {
|
} else if (RegExp("prog").hasMatch(name)) {
|
||||||
return SubjectIconData(
|
return SubjectIconData(
|
||||||
data: createIcon(cupertino: CupertinoIcons.chevron_left_slash_chevron_right, material: Icons.code_outlined),
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.chevron_left_slash_chevron_right,
|
||||||
|
material: Icons.code_outlined),
|
||||||
name: "chevron.left.forwardslash.chevron.right");
|
name: "chevron.left.forwardslash.chevron.right");
|
||||||
} else if (RegExp("halozat").hasMatch(name)) {
|
} else if (RegExp("halozat").hasMatch(name)) {
|
||||||
return SubjectIconData(
|
return SubjectIconData(
|
||||||
data: createIcon(cupertino: CupertinoIcons.antenna_radiowaves_left_right, material: Icons.wifi_tethering_outlined),
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.antenna_radiowaves_left_right,
|
||||||
|
material: Icons.wifi_tethering_outlined),
|
||||||
name: "antenna.radiowaves.left.and.right");
|
name: "antenna.radiowaves.left.and.right");
|
||||||
} else if (RegExp("szinhaz").hasMatch(name)) {
|
} else if (RegExp("szinhaz").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.hifispeaker, material: Icons.theater_comedy_outlined), name: "hifispeaker");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.hifispeaker,
|
||||||
|
material: Icons.theater_comedy_outlined),
|
||||||
|
name: "hifispeaker");
|
||||||
} else if (RegExp("film|media").hasMatch(name)) {
|
} else if (RegExp("film|media").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.film, material: Icons.theaters_outlined), name: "film");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.film,
|
||||||
|
material: Icons.theaters_outlined),
|
||||||
|
name: "film");
|
||||||
} else if (RegExp("elektro(tech)?nika").hasMatch(name)) {
|
} else if (RegExp("elektro(tech)?nika").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.bolt, material: Icons.electrical_services_outlined), name: "bolt");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.bolt,
|
||||||
|
material: Icons.electrical_services_outlined),
|
||||||
|
name: "bolt");
|
||||||
} else if (RegExp("gepesz|mernok|ipar").hasMatch(name)) {
|
} else if (RegExp("gepesz|mernok|ipar").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.wrench, material: Icons.precision_manufacturing_outlined), name: "wrench");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.wrench,
|
||||||
|
material: Icons.precision_manufacturing_outlined),
|
||||||
|
name: "wrench");
|
||||||
} else if (RegExp("technika").hasMatch(name)) {
|
} else if (RegExp("technika").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.hammer, material: Icons.build_outlined), name: "hammer");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.hammer, material: Icons.build_outlined),
|
||||||
|
name: "hammer");
|
||||||
} else if (RegExp("tanc").hasMatch(name)) {
|
} else if (RegExp("tanc").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.music_mic, material: Icons.speaker_outlined), name: "music.mic");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.music_mic,
|
||||||
|
material: Icons.speaker_outlined),
|
||||||
|
name: "music.mic");
|
||||||
} else if (RegExp("filozofia").hasMatch(name)) {
|
} else if (RegExp("filozofia").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.bubble_left, material: Icons.psychology_outlined), name: "bubble.left");
|
return SubjectIconData(
|
||||||
} else if (RegExp("osztaly(fonoki|kozosseg)").hasMatch(name) || name == "ofo") {
|
data: createIcon(
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.group, material: Icons.groups_outlined), name: "person.3");
|
cupertino: CupertinoIcons.bubble_left,
|
||||||
|
material: Icons.psychology_outlined),
|
||||||
|
name: "bubble.left");
|
||||||
|
} else if (RegExp("osztaly(fonoki|kozosseg)").hasMatch(name) ||
|
||||||
|
name == "ofo") {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.group, material: Icons.groups_outlined),
|
||||||
|
name: "person.3");
|
||||||
} else if (RegExp("gazdasag").hasMatch(name)) {
|
} else if (RegExp("gazdasag").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.chart_pie, material: Icons.account_balance_outlined), name: "chart.pie");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.chart_pie,
|
||||||
|
material: Icons.account_balance_outlined),
|
||||||
|
name: "chart.pie");
|
||||||
} else if (RegExp("szorgalom").hasMatch(name)) {
|
} else if (RegExp("szorgalom").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.checkmark_seal, material: Icons.verified_outlined), name: "checkmark.seal");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.checkmark_seal,
|
||||||
|
material: Icons.verified_outlined),
|
||||||
|
name: "checkmark.seal");
|
||||||
} else if (RegExp("magatartas").hasMatch(name)) {
|
} else if (RegExp("magatartas").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.smiley, material: Icons.emoji_people_outlined), name: "face.smiling");
|
return SubjectIconData(
|
||||||
} else if (RegExp("angol|nemet|francia|olasz|orosz|spanyol|latin|kinai|nyelv").hasMatch(name)) {
|
data: createIcon(
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.globe, material: Icons.translate_outlined), name: "globe");
|
cupertino: CupertinoIcons.smiley,
|
||||||
|
material: Icons.emoji_people_outlined),
|
||||||
|
name: "face.smiling");
|
||||||
|
} else if (RegExp(
|
||||||
|
"angol|nemet|francia|olasz|orosz|spanyol|latin|kinai|nyelv")
|
||||||
|
.hasMatch(name)) {
|
||||||
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.globe,
|
||||||
|
material: Icons.translate_outlined),
|
||||||
|
name: "globe");
|
||||||
} else if (RegExp("linux").hasMatch(name)) {
|
} else if (RegExp("linux").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(material: FilcIcons.linux, cupertino: FilcIcons.linux));
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
material: FilcIcons.linux, cupertino: FilcIcons.linux));
|
||||||
} else if (RegExp("adatbazis").hasMatch(name)) {
|
} else if (RegExp("adatbazis").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.table_badge_more, material: Icons.table_chart), name: "table.badge.more");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.table_badge_more,
|
||||||
|
material: Icons.table_chart),
|
||||||
|
name: "table.badge.more");
|
||||||
} else if (RegExp("asztali alkalmazasok").hasMatch(name)) {
|
} else if (RegExp("asztali alkalmazasok").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.macwindow, material: Icons.desktop_windows_outlined), name: "macwindow");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.macwindow,
|
||||||
|
material: Icons.desktop_windows_outlined),
|
||||||
|
name: "macwindow");
|
||||||
} else if (RegExp("projekt").hasMatch(name)) {
|
} else if (RegExp("projekt").hasMatch(name)) {
|
||||||
return SubjectIconData(data: createIcon(cupertino: CupertinoIcons.person_3_fill, material: Icons.groups_3), name: "person.3.fill");
|
return SubjectIconData(
|
||||||
|
data: createIcon(
|
||||||
|
cupertino: CupertinoIcons.person_3_fill,
|
||||||
|
material: Icons.groups_3),
|
||||||
|
name: "person.3.fill");
|
||||||
}
|
}
|
||||||
|
|
||||||
return SubjectIconData();
|
return SubjectIconData();
|
||||||
@@ -119,10 +256,13 @@ class SubjectIcon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShortSubject {
|
class ShortSubject {
|
||||||
static String resolve({Subject? subject, String? subjectName}) {
|
static String resolve({GradeSubject? subject, String? subjectName}) {
|
||||||
assert(!(subject == null && subjectName == null));
|
assert(!(subject == null && subjectName == null));
|
||||||
|
|
||||||
String name = (subject?.name ?? subjectName ?? "").toLowerCase().specialChars().trim();
|
String name = (subject?.name ?? subjectName ?? "")
|
||||||
|
.toLowerCase()
|
||||||
|
.specialChars()
|
||||||
|
.trim();
|
||||||
// String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
// String category = subject?.category.description.toLowerCase().specialChars() ?? "";
|
||||||
|
|
||||||
if (RegExp("magyar irodalom").hasMatch(name)) {
|
if (RegExp("magyar irodalom").hasMatch(name)) {
|
||||||
@@ -137,7 +277,9 @@ class ShortSubject {
|
|||||||
return "Tesi";
|
return "Tesi";
|
||||||
} else if (RegExp("tortenelem").hasMatch(name)) {
|
} else if (RegExp("tortenelem").hasMatch(name)) {
|
||||||
return "Töri";
|
return "Töri";
|
||||||
} else if (RegExp("(angol|nemet|francia|olasz|orosz|spanyol|latin|kinai) nyelv").hasMatch(name)) {
|
} else if (RegExp(
|
||||||
|
"(angol|nemet|francia|olasz|orosz|spanyol|latin|kinai) nyelv")
|
||||||
|
.hasMatch(name)) {
|
||||||
return (subject?.name ?? subjectName ?? "?").replaceAll(" nyelv", "");
|
return (subject?.name ?? subjectName ?? "?").replaceAll(" nyelv", "");
|
||||||
} else if (RegExp("informatika").hasMatch(name)) {
|
} else if (RegExp("informatika").hasMatch(name)) {
|
||||||
return "Infó";
|
return "Infó";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'dart:typed_data';
|
|||||||
import 'package:filcnaplo/api/client.dart';
|
import 'package:filcnaplo/api/client.dart';
|
||||||
import 'package:filcnaplo/helpers/storage_helper.dart';
|
import 'package:filcnaplo/helpers/storage_helper.dart';
|
||||||
import 'package:filcnaplo/models/release.dart';
|
import 'package:filcnaplo/models/release.dart';
|
||||||
import 'package:open_file/open_file.dart';
|
import 'package:open_filex/open_filex.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
enum UpdateState { none, preparing, downloading, installing }
|
enum UpdateState { none, preparing, downloading, installing }
|
||||||
@@ -37,7 +37,7 @@ extension UpdateHelper on Release {
|
|||||||
(await Permission.manageExternalStorage.request().isGranted &&
|
(await Permission.manageExternalStorage.request().isGranted &&
|
||||||
await Permission.requestInstallPackages.request().isGranted);
|
await Permission.requestInstallPackages.request().isGranted);
|
||||||
if (installPerms) {
|
if (installPerms) {
|
||||||
var result = await OpenFile.open(apk.path);
|
var result = await OpenFilex.open(apk.path);
|
||||||
|
|
||||||
if (result.type != ResultType.done) {
|
if (result.type != ResultType.done) {
|
||||||
// ignore: avoid_print
|
// ignore: avoid_print
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|||||||
void main() async {
|
void main() async {
|
||||||
// Initalize
|
// Initalize
|
||||||
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
|
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
// ignore: deprecated_member_use
|
||||||
binding.renderView.automaticSystemUiAdjustment = false;
|
binding.renderView.automaticSystemUiAdjustment = false;
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
// Startup
|
// Startup
|
||||||
@@ -63,7 +64,7 @@ class Startup {
|
|||||||
await flutterLocalNotificationsPlugin
|
await flutterLocalNotificationsPlugin
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin>()!
|
AndroidFlutterLocalNotificationsPlugin>()!
|
||||||
.requestPermission();
|
.requestNotificationsPermission();
|
||||||
} else if (Platform.isIOS) {
|
} else if (Platform.isIOS) {
|
||||||
await flutterLocalNotificationsPlugin
|
await flutterLocalNotificationsPlugin
|
||||||
.resolvePlatformSpecificImplementation<
|
.resolvePlatformSpecificImplementation<
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
Color _customAccentColor;
|
Color _customAccentColor;
|
||||||
Color _customBackgroundColor;
|
Color _customBackgroundColor;
|
||||||
Color _customHighlightColor;
|
Color _customHighlightColor;
|
||||||
|
Color _customIconColor;
|
||||||
|
bool _shadowEffect;
|
||||||
List<String> _premiumScopes;
|
List<String> _premiumScopes;
|
||||||
String _premiumAccessToken;
|
String _premiumAccessToken;
|
||||||
String _premiumLogin;
|
String _premiumLogin;
|
||||||
@@ -77,6 +79,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool _renamedTeachersItalics;
|
bool _renamedTeachersItalics;
|
||||||
Color _liveActivityColor;
|
Color _liveActivityColor;
|
||||||
String _welcomeMessage;
|
String _welcomeMessage;
|
||||||
|
String _appIcon;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
DatabaseProvider? database,
|
DatabaseProvider? database,
|
||||||
@@ -112,6 +115,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required Color customAccentColor,
|
required Color customAccentColor,
|
||||||
required Color customBackgroundColor,
|
required Color customBackgroundColor,
|
||||||
required Color customHighlightColor,
|
required Color customHighlightColor,
|
||||||
|
required Color customIconColor,
|
||||||
|
required bool shadowEffect,
|
||||||
required List<String> premiumScopes,
|
required List<String> premiumScopes,
|
||||||
required String premiumAccessToken,
|
required String premiumAccessToken,
|
||||||
required String premiumLogin,
|
required String premiumLogin,
|
||||||
@@ -122,6 +127,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required bool renameTeachersItalics,
|
required bool renameTeachersItalics,
|
||||||
required Color liveActivityColor,
|
required Color liveActivityColor,
|
||||||
required String welcomeMessage,
|
required String welcomeMessage,
|
||||||
|
required String appIcon,
|
||||||
}) : _database = database,
|
}) : _database = database,
|
||||||
_language = language,
|
_language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
@@ -155,6 +161,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_customAccentColor = customAccentColor,
|
_customAccentColor = customAccentColor,
|
||||||
_customBackgroundColor = customBackgroundColor,
|
_customBackgroundColor = customBackgroundColor,
|
||||||
_customHighlightColor = customHighlightColor,
|
_customHighlightColor = customHighlightColor,
|
||||||
|
_customIconColor = customIconColor,
|
||||||
|
_shadowEffect = shadowEffect,
|
||||||
_premiumScopes = premiumScopes,
|
_premiumScopes = premiumScopes,
|
||||||
_premiumAccessToken = premiumAccessToken,
|
_premiumAccessToken = premiumAccessToken,
|
||||||
_premiumLogin = premiumLogin,
|
_premiumLogin = premiumLogin,
|
||||||
@@ -164,7 +172,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_renamedTeachersEnabled = renameTeachersEnabled,
|
_renamedTeachersEnabled = renameTeachersEnabled,
|
||||||
_renamedTeachersItalics = renameTeachersItalics,
|
_renamedTeachersItalics = renameTeachersItalics,
|
||||||
_liveActivityColor = liveActivityColor,
|
_liveActivityColor = liveActivityColor,
|
||||||
_welcomeMessage = welcomeMessage;
|
_welcomeMessage = welcomeMessage,
|
||||||
|
_appIcon = appIcon;
|
||||||
|
|
||||||
factory SettingsProvider.fromMap(Map map,
|
factory SettingsProvider.fromMap(Map map,
|
||||||
{required DatabaseProvider database}) {
|
{required DatabaseProvider database}) {
|
||||||
@@ -217,6 +226,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
customAccentColor: Color(map["custom_accent_color"]),
|
customAccentColor: Color(map["custom_accent_color"]),
|
||||||
customBackgroundColor: Color(map["custom_background_color"]),
|
customBackgroundColor: Color(map["custom_background_color"]),
|
||||||
customHighlightColor: Color(map["custom_highlight_color"]),
|
customHighlightColor: Color(map["custom_highlight_color"]),
|
||||||
|
customIconColor: Color(map["custom_icon_color"]),
|
||||||
|
shadowEffect: map["shadow_effect"] == 1,
|
||||||
premiumScopes: jsonDecode(map["premium_scopes"]).cast<String>(),
|
premiumScopes: jsonDecode(map["premium_scopes"]).cast<String>(),
|
||||||
premiumAccessToken: map["premium_token"],
|
premiumAccessToken: map["premium_token"],
|
||||||
premiumLogin: map["premium_login"],
|
premiumLogin: map["premium_login"],
|
||||||
@@ -227,6 +238,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersItalics: map["renamed_teachers_italics"] == 1,
|
renameTeachersItalics: map["renamed_teachers_italics"] == 1,
|
||||||
liveActivityColor: Color(map["live_activity_color"]),
|
liveActivityColor: Color(map["live_activity_color"]),
|
||||||
welcomeMessage: map["welcome_message"],
|
welcomeMessage: map["welcome_message"],
|
||||||
|
appIcon: map["app_icon"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +279,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"custom_accent_color": _customAccentColor.value,
|
"custom_accent_color": _customAccentColor.value,
|
||||||
"custom_background_color": _customBackgroundColor.value,
|
"custom_background_color": _customBackgroundColor.value,
|
||||||
"custom_highlight_color": _customHighlightColor.value,
|
"custom_highlight_color": _customHighlightColor.value,
|
||||||
|
"custom_icon_color": _customIconColor.value,
|
||||||
|
"shadow_effect": _shadowEffect ? 1 : 0,
|
||||||
"premium_scopes": jsonEncode(_premiumScopes),
|
"premium_scopes": jsonEncode(_premiumScopes),
|
||||||
"premium_token": _premiumAccessToken,
|
"premium_token": _premiumAccessToken,
|
||||||
"premium_login": _premiumLogin,
|
"premium_login": _premiumLogin,
|
||||||
@@ -277,6 +291,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"renamed_teachers_italics": _renamedTeachersItalics ? 1 : 0,
|
"renamed_teachers_italics": _renamedTeachersItalics ? 1 : 0,
|
||||||
"live_activity_color": _liveActivityColor.value,
|
"live_activity_color": _liveActivityColor.value,
|
||||||
"welcome_message": _welcomeMessage,
|
"welcome_message": _welcomeMessage,
|
||||||
|
"app_icon": _appIcon,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,6 +336,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
customAccentColor: const Color(0xff3D7BF4),
|
customAccentColor: const Color(0xff3D7BF4),
|
||||||
customBackgroundColor: const Color(0xff000000),
|
customBackgroundColor: const Color(0xff000000),
|
||||||
customHighlightColor: const Color(0xff222222),
|
customHighlightColor: const Color(0xff222222),
|
||||||
|
customIconColor: const Color(0x00000000),
|
||||||
|
shadowEffect: true,
|
||||||
premiumScopes: [PremiumScopes.all],
|
premiumScopes: [PremiumScopes.all],
|
||||||
premiumAccessToken: "igen",
|
premiumAccessToken: "igen",
|
||||||
premiumLogin: "igen",
|
premiumLogin: "igen",
|
||||||
@@ -331,6 +348,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
renameTeachersItalics: false,
|
renameTeachersItalics: false,
|
||||||
liveActivityColor: const Color(0xFF676767),
|
liveActivityColor: const Color(0xFF676767),
|
||||||
welcomeMessage: '',
|
welcomeMessage: '',
|
||||||
|
appIcon: 'refilc_default',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,6 +388,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
: _customAccentColor;
|
: _customAccentColor;
|
||||||
Color? get customBackgroundColor => _customBackgroundColor;
|
Color? get customBackgroundColor => _customBackgroundColor;
|
||||||
Color? get customHighlightColor => _customHighlightColor;
|
Color? get customHighlightColor => _customHighlightColor;
|
||||||
|
Color? get customIconColor => _customIconColor;
|
||||||
|
bool get shadowEffect => _shadowEffect;
|
||||||
List<String> get premiumScopes => _premiumScopes;
|
List<String> get premiumScopes => _premiumScopes;
|
||||||
String get premiumAccessToken => _premiumAccessToken;
|
String get premiumAccessToken => _premiumAccessToken;
|
||||||
String get premiumLogin => _premiumLogin;
|
String get premiumLogin => _premiumLogin;
|
||||||
@@ -380,6 +400,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool get renamedTeachersItalics => _renamedTeachersItalics;
|
bool get renamedTeachersItalics => _renamedTeachersItalics;
|
||||||
Color get liveActivityColor => _liveActivityColor;
|
Color get liveActivityColor => _liveActivityColor;
|
||||||
String get welcomeMessage => _welcomeMessage;
|
String get welcomeMessage => _welcomeMessage;
|
||||||
|
String get appIcon => _appIcon;
|
||||||
|
|
||||||
Future<void> update({
|
Future<void> update({
|
||||||
bool store = true,
|
bool store = true,
|
||||||
@@ -415,6 +436,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
Color? customAccentColor,
|
Color? customAccentColor,
|
||||||
Color? customBackgroundColor,
|
Color? customBackgroundColor,
|
||||||
Color? customHighlightColor,
|
Color? customHighlightColor,
|
||||||
|
Color? customIconColor,
|
||||||
|
bool? shadowEffect,
|
||||||
List<String>? premiumScopes,
|
List<String>? premiumScopes,
|
||||||
String? premiumAccessToken,
|
String? premiumAccessToken,
|
||||||
String? premiumLogin,
|
String? premiumLogin,
|
||||||
@@ -425,6 +448,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool? renamedTeachersItalics,
|
bool? renamedTeachersItalics,
|
||||||
Color? liveActivityColor,
|
Color? liveActivityColor,
|
||||||
String? welcomeMessage,
|
String? welcomeMessage,
|
||||||
|
String? appIcon,
|
||||||
}) async {
|
}) async {
|
||||||
if (language != null && language != _language) _language = language;
|
if (language != null && language != _language) _language = language;
|
||||||
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
||||||
@@ -511,6 +535,12 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
customHighlightColor != _customHighlightColor) {
|
customHighlightColor != _customHighlightColor) {
|
||||||
_customHighlightColor = customHighlightColor;
|
_customHighlightColor = customHighlightColor;
|
||||||
}
|
}
|
||||||
|
if (customIconColor != null && customIconColor != _customIconColor) {
|
||||||
|
_customIconColor = customIconColor;
|
||||||
|
}
|
||||||
|
if (shadowEffect != null && shadowEffect != _shadowEffect) {
|
||||||
|
_shadowEffect = shadowEffect;
|
||||||
|
}
|
||||||
if (premiumScopes != null && premiumScopes != _premiumScopes) {
|
if (premiumScopes != null && premiumScopes != _premiumScopes) {
|
||||||
_premiumScopes = premiumScopes;
|
_premiumScopes = premiumScopes;
|
||||||
}
|
}
|
||||||
@@ -546,6 +576,10 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
if (welcomeMessage != null && welcomeMessage != _welcomeMessage) {
|
if (welcomeMessage != null && welcomeMessage != _welcomeMessage) {
|
||||||
_welcomeMessage = welcomeMessage;
|
_welcomeMessage = welcomeMessage;
|
||||||
}
|
}
|
||||||
|
if (appIcon != null && appIcon != _appIcon) {
|
||||||
|
_appIcon = appIcon;
|
||||||
|
}
|
||||||
|
// store or not
|
||||||
if (store) await _database?.store.storeSettings(this);
|
if (store) await _database?.store.storeSettings(this);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ class SharedTheme {
|
|||||||
Color backgroundColor;
|
Color backgroundColor;
|
||||||
Color panelsColor;
|
Color panelsColor;
|
||||||
Color accentColor;
|
Color accentColor;
|
||||||
|
Color iconColor;
|
||||||
|
bool shadowEffect;
|
||||||
SharedGradeColors gradeColors;
|
SharedGradeColors gradeColors;
|
||||||
|
|
||||||
SharedTheme({
|
SharedTheme({
|
||||||
@@ -18,6 +20,8 @@ class SharedTheme {
|
|||||||
required this.backgroundColor,
|
required this.backgroundColor,
|
||||||
required this.panelsColor,
|
required this.panelsColor,
|
||||||
required this.accentColor,
|
required this.accentColor,
|
||||||
|
required this.iconColor,
|
||||||
|
required this.shadowEffect,
|
||||||
required this.gradeColors,
|
required this.gradeColors,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -30,6 +34,8 @@ class SharedTheme {
|
|||||||
backgroundColor: Color(json['background_color']),
|
backgroundColor: Color(json['background_color']),
|
||||||
panelsColor: Color(json['panels_color']),
|
panelsColor: Color(json['panels_color']),
|
||||||
accentColor: Color(json['accent_color']),
|
accentColor: Color(json['accent_color']),
|
||||||
|
iconColor: Color(json['icon_color']),
|
||||||
|
shadowEffect: json['shadow_effect'] ?? true,
|
||||||
gradeColors: gradeColors,
|
gradeColors: gradeColors,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,21 @@ enum SubjectLessonCountUpdateState { ready, updating }
|
|||||||
|
|
||||||
class SubjectLessonCount {
|
class SubjectLessonCount {
|
||||||
DateTime lastUpdated;
|
DateTime lastUpdated;
|
||||||
Map<Subject, int> subjects;
|
Map<GradeSubject, int> subjects;
|
||||||
SubjectLessonCountUpdateState state;
|
SubjectLessonCountUpdateState state;
|
||||||
|
|
||||||
SubjectLessonCount({required this.lastUpdated, required this.subjects, this.state = SubjectLessonCountUpdateState.ready});
|
SubjectLessonCount(
|
||||||
|
{required this.lastUpdated,
|
||||||
|
required this.subjects,
|
||||||
|
this.state = SubjectLessonCountUpdateState.ready});
|
||||||
|
|
||||||
factory SubjectLessonCount.fromMap(Map json) {
|
factory SubjectLessonCount.fromMap(Map json) {
|
||||||
return SubjectLessonCount(
|
return SubjectLessonCount(
|
||||||
lastUpdated: DateTime.fromMillisecondsSinceEpoch(json["last_updated"] ?? 0),
|
lastUpdated:
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(json["last_updated"] ?? 0),
|
||||||
subjects: ((json["subjects"] as Map?) ?? {}).map(
|
subjects: ((json["subjects"] as Map?) ?? {}).map(
|
||||||
(key, value) => MapEntry(
|
(key, value) => MapEntry(
|
||||||
Subject(id: key, name: "", category: Category.fromJson({})),
|
GradeSubject(id: key, name: "", category: Category.fromJson({})),
|
||||||
value,
|
value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import 'package:provider/provider.dart';
|
|||||||
const List<FilterType> homeFilters = [
|
const List<FilterType> homeFilters = [
|
||||||
FilterType.all,
|
FilterType.all,
|
||||||
FilterType.grades,
|
FilterType.grades,
|
||||||
|
FilterType.exams,
|
||||||
FilterType.messages,
|
FilterType.messages,
|
||||||
FilterType.absences
|
FilterType.absences
|
||||||
];
|
];
|
||||||
@@ -214,19 +215,21 @@ Widget filterItemBuilder(
|
|||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor.withOpacity(
|
offset: const Offset(0, 21),
|
||||||
Theme.of(context).shadowColor.opacity *
|
blurRadius: 23.0,
|
||||||
CurvedAnimation(
|
color: Theme.of(context).shadowColor.withOpacity(
|
||||||
parent: CurvedAnimation(
|
Theme.of(context).shadowColor.opacity *
|
||||||
parent: animation,
|
CurvedAnimation(
|
||||||
curve: Curves.easeInOutCubic),
|
parent: CurvedAnimation(
|
||||||
curve: const Interval(2 / 3, 1.0),
|
parent: animation,
|
||||||
).value,
|
curve: Curves.easeInOutCubic),
|
||||||
),
|
curve: const Interval(2 / 3, 1.0),
|
||||||
),
|
).value,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: child,
|
child: child,
|
||||||
|
|||||||
@@ -87,13 +87,13 @@ Widget _defaultItemBuilder(Color color, bool isCurrentColor, void Function() cha
|
|||||||
// The blocky color picker you can alter the layout and shape.
|
// The blocky color picker you can alter the layout and shape.
|
||||||
class BlockPicker extends StatefulWidget {
|
class BlockPicker extends StatefulWidget {
|
||||||
BlockPicker({
|
BlockPicker({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.pickerColor,
|
required this.pickerColor,
|
||||||
required this.onColorChanged,
|
required this.onColorChanged,
|
||||||
this.useInShowDialog = true,
|
this.useInShowDialog = true,
|
||||||
this.layoutBuilder = _defaultLayoutBuilder,
|
this.layoutBuilder = _defaultLayoutBuilder,
|
||||||
this.itemBuilder = _defaultItemBuilder,
|
this.itemBuilder = _defaultItemBuilder,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Color? pickerColor;
|
final Color? pickerColor;
|
||||||
final ValueChanged<Color> onColorChanged;
|
final ValueChanged<Color> onColorChanged;
|
||||||
@@ -7,16 +7,18 @@
|
|||||||
///
|
///
|
||||||
/// You can create your own layout by importing `picker.dart`.
|
/// You can create your own layout by importing `picker.dart`.
|
||||||
|
|
||||||
|
// ignore_for_file: use_build_context_synchronously
|
||||||
|
|
||||||
library hsv_picker;
|
library hsv_picker;
|
||||||
|
|
||||||
import 'package:filcnaplo/models/shared_theme.dart';
|
import 'package:filcnaplo/models/shared_theme.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/custom_snack_bar.dart';
|
import 'package:filcnaplo_mobile_ui/common/custom_snack_bar.dart';
|
||||||
import 'package:filcnaplo_premium/providers/share_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/share_provider.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/flutter_colorpicker/block_picker.dart';
|
import 'package:filcnaplo/ui/flutter_colorpicker/block_picker.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/flutter_colorpicker/palette.dart';
|
import 'package:filcnaplo/ui/flutter_colorpicker/palette.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/flutter_colorpicker/utils.dart';
|
import 'package:filcnaplo/ui/flutter_colorpicker/utils.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/theme.dart';
|
import 'package:filcnaplo_mobile_ui/screens/settings/theme_screen.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/theme.i18n.dart';
|
import 'package:filcnaplo_mobile_ui/screens/settings/theme_screen.i18n.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
@@ -24,7 +26,7 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
class FilcColorPicker extends StatefulWidget {
|
class FilcColorPicker extends StatefulWidget {
|
||||||
const FilcColorPicker({
|
const FilcColorPicker({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.colorMode,
|
required this.colorMode,
|
||||||
required this.pickerColor,
|
required this.pickerColor,
|
||||||
required this.onColorChanged,
|
required this.onColorChanged,
|
||||||
@@ -53,7 +55,7 @@ class FilcColorPicker extends StatefulWidget {
|
|||||||
this.colorHistory,
|
this.colorHistory,
|
||||||
this.onHistoryChanged,
|
this.onHistoryChanged,
|
||||||
required this.onThemeIdProvided,
|
required this.onThemeIdProvided,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final CustomColorMode colorMode;
|
final CustomColorMode colorMode;
|
||||||
final Color pickerColor;
|
final Color pickerColor;
|
||||||
@@ -78,10 +80,10 @@ class FilcColorPicker extends StatefulWidget {
|
|||||||
final void Function(SharedTheme theme) onThemeIdProvided;
|
final void Function(SharedTheme theme) onThemeIdProvided;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_FilcColorPickerState createState() => _FilcColorPickerState();
|
FilcColorPickerState createState() => FilcColorPickerState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FilcColorPickerState extends State<FilcColorPicker> {
|
class FilcColorPickerState extends State<FilcColorPicker> {
|
||||||
final idController = TextEditingController();
|
final idController = TextEditingController();
|
||||||
|
|
||||||
late final ShareProvider shareProvider;
|
late final ShareProvider shareProvider;
|
||||||
@@ -262,6 +264,7 @@ class _FilcColorPickerState extends State<FilcColorPicker> {
|
|||||||
|
|
||||||
if (theme != null) {
|
if (theme != null) {
|
||||||
widget.onThemeIdProvided(theme);
|
widget.onThemeIdProvided(theme);
|
||||||
|
idController.clear();
|
||||||
} else {
|
} else {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
CustomSnackBar(
|
CustomSnackBar(
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
|
|
||||||
|
// ignore: dangling_library_doc_comments
|
||||||
/// The components of HSV Color Picker
|
/// The components of HSV Color Picker
|
||||||
///
|
///
|
||||||
/// Try to create a Color Picker with other layout on your own :)
|
/// Try to create a Color Picker with other layout on your own :)
|
||||||
@@ -317,11 +318,11 @@ class ColorPickerInput extends StatefulWidget {
|
|||||||
const ColorPickerInput(
|
const ColorPickerInput(
|
||||||
this.color,
|
this.color,
|
||||||
this.onColorChanged, {
|
this.onColorChanged, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.enableAlpha = true,
|
this.enableAlpha = true,
|
||||||
this.embeddedText = false,
|
this.embeddedText = false,
|
||||||
this.disable = false,
|
this.disable = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Color color;
|
final Color color;
|
||||||
final ValueChanged<Color> onColorChanged;
|
final ValueChanged<Color> onColorChanged;
|
||||||
@@ -330,10 +331,10 @@ class ColorPickerInput extends StatefulWidget {
|
|||||||
final bool disable;
|
final bool disable;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ColorPickerInputState createState() => _ColorPickerInputState();
|
ColorPickerInputState createState() => ColorPickerInputState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ColorPickerInputState extends State<ColorPickerInput> {
|
class ColorPickerInputState extends State<ColorPickerInput> {
|
||||||
TextEditingController textEditingController = TextEditingController();
|
TextEditingController textEditingController = TextEditingController();
|
||||||
int inputColor = 0;
|
int inputColor = 0;
|
||||||
|
|
||||||
@@ -346,11 +347,7 @@ class _ColorPickerInputState extends State<ColorPickerInput> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (inputColor != widget.color.value) {
|
if (inputColor != widget.color.value) {
|
||||||
textEditingController.text = '#' +
|
textEditingController.text = '#${widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0')}${widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : ''}';
|
||||||
widget.color.red.toRadixString(16).toUpperCase().padLeft(2, '0') +
|
|
||||||
widget.color.green.toRadixString(16).toUpperCase().padLeft(2, '0') +
|
|
||||||
widget.color.blue.toRadixString(16).toUpperCase().padLeft(2, '0') +
|
|
||||||
(widget.enableAlpha ? widget.color.alpha.toRadixString(16).toUpperCase().padLeft(2, '0') : '');
|
|
||||||
}
|
}
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 6.0, left: 12.0, right: 12.0),
|
padding: const EdgeInsets.only(top: 6.0, left: 12.0, right: 12.0),
|
||||||
@@ -516,10 +513,10 @@ class ColorPickerSlider extends StatelessWidget {
|
|||||||
this.onColorChanged,
|
this.onColorChanged,
|
||||||
this.onColorChangeEnd,
|
this.onColorChangeEnd,
|
||||||
this.onProblem, {
|
this.onProblem, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.displayThumbColor = false,
|
this.displayThumbColor = false,
|
||||||
this.fullThumbColor = false,
|
this.fullThumbColor = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final TrackType trackType;
|
final TrackType trackType;
|
||||||
final HSVColor hsvColor;
|
final HSVColor hsvColor;
|
||||||
@@ -657,13 +654,13 @@ class ColorPickerSlider extends StatelessWidget {
|
|||||||
class ColorIndicator extends StatelessWidget {
|
class ColorIndicator extends StatelessWidget {
|
||||||
const ColorIndicator(
|
const ColorIndicator(
|
||||||
this.hsvColor, {
|
this.hsvColor, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.currentHsvColor,
|
this.currentHsvColor,
|
||||||
this.icon,
|
this.icon,
|
||||||
this.width = 50.0,
|
this.width = 50.0,
|
||||||
this.height = 50.0,
|
this.height = 50.0,
|
||||||
this.adaptive = false,
|
this.adaptive = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final HSVColor hsvColor;
|
final HSVColor hsvColor;
|
||||||
final HSVColor? currentHsvColor;
|
final HSVColor? currentHsvColor;
|
||||||
@@ -711,8 +708,8 @@ class ColorPickerArea extends StatelessWidget {
|
|||||||
this.onColorChanged,
|
this.onColorChanged,
|
||||||
this.onChangeEnd,
|
this.onChangeEnd,
|
||||||
this.paletteType, {
|
this.paletteType, {
|
||||||
Key? key,
|
super.key,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final HSVColor hsvColor;
|
final HSVColor hsvColor;
|
||||||
final ValueChanged<HSVColor> onColorChanged;
|
final ValueChanged<HSVColor> onColorChanged;
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
// FROM: https://pub.dev/packages/flutter_colorpicker
|
// FROM: https://pub.dev/packages/flutter_colorpicker
|
||||||
|
|
||||||
|
// ignore: dangling_library_doc_comments
|
||||||
/// Common function lib
|
/// Common function lib
|
||||||
|
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
@@ -10,14 +10,20 @@ import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class GradeTile extends StatelessWidget {
|
class GradeTile extends StatelessWidget {
|
||||||
const GradeTile(this.grade,
|
const GradeTile(
|
||||||
{Key? key, this.onTap, this.padding, this.censored = false})
|
this.grade, {
|
||||||
: super(key: key);
|
super.key,
|
||||||
|
this.onTap,
|
||||||
|
this.padding,
|
||||||
|
this.censored = false,
|
||||||
|
this.viewOverride = false,
|
||||||
|
});
|
||||||
|
|
||||||
final Grade grade;
|
final Grade grade;
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
final EdgeInsetsGeometry? padding;
|
final EdgeInsetsGeometry? padding;
|
||||||
final bool censored;
|
final bool censored;
|
||||||
|
final bool viewOverride;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -26,7 +32,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
bool isTitleItalic = false;
|
bool isTitleItalic = false;
|
||||||
bool isSubtitleItalic = false;
|
bool isSubtitleItalic = false;
|
||||||
EdgeInsets leadingPadding = EdgeInsets.zero;
|
EdgeInsets leadingPadding = EdgeInsets.zero;
|
||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView =
|
||||||
|
SubjectGradesContainer.of(context) != null || viewOverride;
|
||||||
String subjectName =
|
String subjectName =
|
||||||
grade.subject.renamedTo ?? grade.subject.name.capital();
|
grade.subject.renamedTo ?? grade.subject.name.capital();
|
||||||
String modeDescription = grade.mode.description.capital();
|
String modeDescription = grade.mode.description.capital();
|
||||||
@@ -34,8 +41,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
|
|
||||||
GradeCalculatorProvider calculatorProvider =
|
GradeCalculatorProvider calculatorProvider =
|
||||||
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
||||||
SettingsProvider settingsProvider =
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
Provider.of<SettingsProvider>(context);
|
|
||||||
// Test order:
|
// Test order:
|
||||||
// description
|
// description
|
||||||
// mode
|
// mode
|
||||||
@@ -50,7 +56,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = subjectName;
|
title = subjectName;
|
||||||
isTitleItalic = grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
isTitleItalic =
|
||||||
|
grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test order:
|
// Test order:
|
||||||
@@ -62,7 +69,9 @@ class GradeTile extends StatelessWidget {
|
|||||||
? modeDescription
|
? modeDescription
|
||||||
: ""
|
: ""
|
||||||
: subjectName;
|
: subjectName;
|
||||||
isSubtitleItalic = isSubjectView ? false : grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
isSubtitleItalic = isSubjectView
|
||||||
|
? false
|
||||||
|
: grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
} else {
|
} else {
|
||||||
subtitle = grade.value.valueName.split("(")[0];
|
subtitle = grade.value.valueName.split("(")[0];
|
||||||
}
|
}
|
||||||
@@ -127,9 +136,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontStyle: isTitleItalic
|
fontStyle: isTitleItalic ? FontStyle.italic : null),
|
||||||
? FontStyle.italic
|
|
||||||
: null),
|
|
||||||
),
|
),
|
||||||
subtitle: subtitle != ""
|
subtitle: subtitle != ""
|
||||||
? censored
|
? censored
|
||||||
@@ -149,7 +156,10 @@ class GradeTile extends StatelessWidget {
|
|||||||
subtitle,
|
subtitle,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w500, fontStyle: isSubtitleItalic ? FontStyle.italic : null),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontStyle:
|
||||||
|
isSubtitleItalic ? FontStyle.italic : null),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
trailing: isSubjectView
|
trailing: isSubjectView
|
||||||
@@ -184,7 +194,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
class GradeValueWidget extends StatelessWidget {
|
class GradeValueWidget extends StatelessWidget {
|
||||||
const GradeValueWidget(
|
const GradeValueWidget(
|
||||||
this.value, {
|
this.value, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.size = 38.0,
|
this.size = 38.0,
|
||||||
this.fill = false,
|
this.fill = false,
|
||||||
this.contrast = false,
|
this.contrast = false,
|
||||||
@@ -193,7 +203,7 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
this.complemented = false,
|
this.complemented = false,
|
||||||
this.nocolor = false,
|
this.nocolor = false,
|
||||||
this.color,
|
this.color,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final GradeValue value;
|
final GradeValue value;
|
||||||
final double size;
|
final double size;
|
||||||
@@ -210,8 +220,8 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
GradeValue value = this.value;
|
GradeValue value = this.value;
|
||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
||||||
|
|
||||||
Color color =
|
Color color = this.color ??
|
||||||
this.color ?? gradeColor(context: context, value: value.value, nocolor: nocolor);
|
gradeColor(context: context, value: value.value, nocolor: nocolor);
|
||||||
Widget valueText;
|
Widget valueText;
|
||||||
final percentage = value.percentage;
|
final percentage = value.percentage;
|
||||||
|
|
||||||
@@ -283,7 +293,9 @@ class GradeValueWidget extends StatelessWidget {
|
|||||||
color: color.withOpacity(contrast ? 1.0 : .25),
|
color: color.withOpacity(contrast ? 1.0 : .25),
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
if (shadow)
|
if (shadow &&
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false)
|
||||||
|
.shadowEffect)
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: color,
|
color: color,
|
||||||
blurRadius: 62.0,
|
blurRadius: 62.0,
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'lesson_tile.i18n.dart';
|
import 'lesson_tile.i18n.dart';
|
||||||
|
|
||||||
class LessonTile extends StatelessWidget {
|
class LessonTile extends StatelessWidget {
|
||||||
const LessonTile(this.lesson, {Key? key, this.onTap, this.swapDesc = false})
|
const LessonTile(this.lesson, {super.key, this.onTap, this.swapDesc = false});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final Lesson lesson;
|
final Lesson lesson;
|
||||||
final bool swapDesc;
|
final bool swapDesc;
|
||||||
@@ -287,8 +286,7 @@ enum LessonSubtileType { homework, exam, absence }
|
|||||||
|
|
||||||
class LessonSubtile extends StatelessWidget {
|
class LessonSubtile extends StatelessWidget {
|
||||||
const LessonSubtile(
|
const LessonSubtile(
|
||||||
{Key? key, this.onPressed, required this.title, required this.type})
|
{super.key, this.onPressed, required this.title, required this.type});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final Function()? onPressed;
|
final Function()? onPressed;
|
||||||
final String title;
|
final String title;
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import 'package:provider/provider.dart';
|
|||||||
class MessageTile extends StatelessWidget {
|
class MessageTile extends StatelessWidget {
|
||||||
const MessageTile(
|
const MessageTile(
|
||||||
this.message, {
|
this.message, {
|
||||||
Key? key,
|
super.key,
|
||||||
this.messages,
|
this.messages,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.censored = false,
|
this.censored = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Message message;
|
final Message message;
|
||||||
final List<Message>? messages;
|
final List<Message>? messages;
|
||||||
|
|||||||
1
filcnaplo/linux/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
flutter/ephemeral
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
project(runner LANGUAGES CXX)
|
|
||||||
|
|
||||||
set(BINARY_NAME "filcnaplo")
|
|
||||||
set(APPLICATION_ID "hu.filc.filcnaplo")
|
|
||||||
|
|
||||||
cmake_policy(SET CMP0063 NEW)
|
|
||||||
|
|
||||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
|
||||||
|
|
||||||
# Root filesystem for cross-building.
|
|
||||||
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
|
||||||
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
|
|
||||||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Configure build options.
|
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
||||||
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
|
||||||
STRING "Flutter build mode" FORCE)
|
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
||||||
"Debug" "Profile" "Release")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Compilation settings that should be applied to most targets.
|
|
||||||
function(APPLY_STANDARD_SETTINGS TARGET)
|
|
||||||
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
|
||||||
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
|
||||||
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
|
||||||
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
|
||||||
|
|
||||||
# Flutter library and tool build rules.
|
|
||||||
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
|
||||||
|
|
||||||
# System-level dependencies.
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
|
||||||
|
|
||||||
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
|
||||||
|
|
||||||
# Application build
|
|
||||||
add_executable(${BINARY_NAME}
|
|
||||||
"main.cc"
|
|
||||||
"my_application.cc"
|
|
||||||
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
|
||||||
)
|
|
||||||
apply_standard_settings(${BINARY_NAME})
|
|
||||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
|
||||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
|
||||||
add_dependencies(${BINARY_NAME} flutter_assemble)
|
|
||||||
# Only the install-generated bundle's copy of the executable will launch
|
|
||||||
# correctly, since the resources must in the right relative locations. To avoid
|
|
||||||
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
|
||||||
# the default top-level location.
|
|
||||||
set_target_properties(${BINARY_NAME}
|
|
||||||
PROPERTIES
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Generated plugin build rules, which manage building the plugins and adding
|
|
||||||
# them to the application.
|
|
||||||
include(flutter/generated_plugins.cmake)
|
|
||||||
|
|
||||||
|
|
||||||
# === Installation ===
|
|
||||||
# By default, "installing" just makes a relocatable bundle in the build
|
|
||||||
# directory.
|
|
||||||
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
|
|
||||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
||||||
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Start with a clean build bundle directory every time.
|
|
||||||
install(CODE "
|
|
||||||
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
|
|
||||||
" COMPONENT Runtime)
|
|
||||||
|
|
||||||
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
|
||||||
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
|
||||||
|
|
||||||
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
|
|
||||||
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
|
|
||||||
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
|
|
||||||
if(PLUGIN_BUNDLED_LIBRARIES)
|
|
||||||
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
|
|
||||||
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Fully re-copy the assets directory on each build to avoid having stale files
|
|
||||||
# from a previous install.
|
|
||||||
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
|
||||||
install(CODE "
|
|
||||||
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
|
||||||
" COMPONENT Runtime)
|
|
||||||
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
|
||||||
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
|
||||||
|
|
||||||
# Install the AOT library on non-Debug builds only.
|
|
||||||
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
||||||
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
||||||
COMPONENT Runtime)
|
|
||||||
endif()
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
|
||||||
|
|
||||||
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
|
||||||
|
|
||||||
# Configuration provided via flutter tool.
|
|
||||||
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
|
||||||
|
|
||||||
# TODO: Move the rest of this into files in ephemeral. See
|
|
||||||
# https://github.com/flutter/flutter/issues/57146.
|
|
||||||
|
|
||||||
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
|
||||||
# which isn't available in 3.10.
|
|
||||||
function(list_prepend LIST_NAME PREFIX)
|
|
||||||
set(NEW_LIST "")
|
|
||||||
foreach(element ${${LIST_NAME}})
|
|
||||||
list(APPEND NEW_LIST "${PREFIX}${element}")
|
|
||||||
endforeach(element)
|
|
||||||
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# === Flutter Library ===
|
|
||||||
# System-level dependencies.
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
|
||||||
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
|
||||||
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
|
||||||
|
|
||||||
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
|
||||||
|
|
||||||
# Published to parent scope for install step.
|
|
||||||
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
|
||||||
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
|
||||||
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
|
||||||
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
|
||||||
|
|
||||||
list(APPEND FLUTTER_LIBRARY_HEADERS
|
|
||||||
"fl_basic_message_channel.h"
|
|
||||||
"fl_binary_codec.h"
|
|
||||||
"fl_binary_messenger.h"
|
|
||||||
"fl_dart_project.h"
|
|
||||||
"fl_engine.h"
|
|
||||||
"fl_json_message_codec.h"
|
|
||||||
"fl_json_method_codec.h"
|
|
||||||
"fl_message_codec.h"
|
|
||||||
"fl_method_call.h"
|
|
||||||
"fl_method_channel.h"
|
|
||||||
"fl_method_codec.h"
|
|
||||||
"fl_method_response.h"
|
|
||||||
"fl_plugin_registrar.h"
|
|
||||||
"fl_plugin_registry.h"
|
|
||||||
"fl_standard_message_codec.h"
|
|
||||||
"fl_standard_method_codec.h"
|
|
||||||
"fl_string_codec.h"
|
|
||||||
"fl_value.h"
|
|
||||||
"fl_view.h"
|
|
||||||
"flutter_linux.h"
|
|
||||||
)
|
|
||||||
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
|
||||||
add_library(flutter INTERFACE)
|
|
||||||
target_include_directories(flutter INTERFACE
|
|
||||||
"${EPHEMERAL_DIR}"
|
|
||||||
)
|
|
||||||
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
|
||||||
target_link_libraries(flutter INTERFACE
|
|
||||||
PkgConfig::GTK
|
|
||||||
PkgConfig::GLIB
|
|
||||||
PkgConfig::GIO
|
|
||||||
)
|
|
||||||
add_dependencies(flutter flutter_assemble)
|
|
||||||
|
|
||||||
# === Flutter tool backend ===
|
|
||||||
# _phony_ is a non-existent file to force this command to run every time,
|
|
||||||
# since currently there's no way to get a full input/output list from the
|
|
||||||
# flutter tool.
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E env
|
|
||||||
${FLUTTER_TOOL_ENVIRONMENT}
|
|
||||||
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
|
||||||
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
add_custom_target(flutter_assemble DEPENDS
|
|
||||||
"${FLUTTER_LIBRARY}"
|
|
||||||
${FLUTTER_LIBRARY_HEADERS}
|
|
||||||
)
|
|
||||||
7
filcnaplo/macos/.gitignore
vendored
@@ -1,7 +0,0 @@
|
|||||||
# Flutter-related
|
|
||||||
**/Flutter/ephemeral/
|
|
||||||
**/Pods/
|
|
||||||
|
|
||||||
# Xcode-related
|
|
||||||
**/dgph
|
|
||||||
**/xcuserdata/
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
|
||||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
|
||||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
|
||||||
@@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
|
|||||||
homepage: https://refilc.hu
|
homepage: https://refilc.hu
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 4.3.1+230
|
version: 4.5.0+236
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.17.0 <3.0.0"
|
||||||
@@ -25,21 +25,22 @@ dependencies:
|
|||||||
|
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
i18n_extension: ^9.0.0
|
i18n_extension: ^10.0.1
|
||||||
sqflite: ^2.2.0+2
|
sqflite: ^2.2.0+2
|
||||||
intl: ^0.18.0
|
intl: ^0.18.0
|
||||||
provider: ^5.0.0
|
provider: ^5.0.0
|
||||||
http: ^0.13.3
|
http: ^0.13.3
|
||||||
uuid: ^3.0.4
|
uuid: ^4.2.1
|
||||||
html: ^0.15.0
|
html: ^0.15.0
|
||||||
open_file:
|
open_filex: ^4.3.4
|
||||||
git:
|
# open_file:
|
||||||
url: https://github.com/crazecoder/open_file
|
# git:
|
||||||
ref: master
|
# url: https://github.com/crazecoder/open_file
|
||||||
|
# ref: master
|
||||||
path_provider: ^2.0.2
|
path_provider: ^2.0.2
|
||||||
permission_handler: ^10.2.0
|
permission_handler: ^11.0.1
|
||||||
share_plus: ^7.0.2
|
share_plus: ^7.0.2
|
||||||
connectivity_plus: ^4.0.1
|
connectivity_plus: ^5.0.2
|
||||||
flutter_displaymode: ^0.6.0
|
flutter_displaymode: ^0.6.0
|
||||||
quick_actions: ^1.0.1
|
quick_actions: ^1.0.1
|
||||||
animated_list_plus: ^0.5.0
|
animated_list_plus: ^0.5.0
|
||||||
@@ -53,9 +54,9 @@ dependencies:
|
|||||||
lottie: ^1.4.3
|
lottie: ^1.4.3
|
||||||
rive: ^0.9.1
|
rive: ^0.9.1
|
||||||
animated_background: ^2.0.0
|
animated_background: ^2.0.0
|
||||||
dropdown_button2: ^1.8.9
|
dropdown_button2: ^1.9.4
|
||||||
home_widget: ^0.1.6
|
home_widget: ^0.1.6
|
||||||
flutter_expandable_fab: ^1.8.1
|
flutter_expandable_fab: ^2.0.0
|
||||||
uni_links: ^0.5.1
|
uni_links: ^0.5.1
|
||||||
url_launcher: ^6.1.6
|
url_launcher: ^6.1.6
|
||||||
workmanager: ^0.5.1
|
workmanager: ^0.5.1
|
||||||
@@ -63,7 +64,7 @@ dependencies:
|
|||||||
image_picker: ^0.8.6
|
image_picker: ^0.8.6
|
||||||
animations: ^2.0.1
|
animations: ^2.0.1
|
||||||
background_fetch: ^1.1.5
|
background_fetch: ^1.1.5
|
||||||
flutter_local_notifications: ^14.1.0
|
flutter_local_notifications: ^16.2.0
|
||||||
package_info_plus: ^4.0.2
|
package_info_plus: ^4.0.2
|
||||||
screenshot: ^2.1.0
|
screenshot: ^2.1.0
|
||||||
flutter_staggered_grid_view: ^0.7.0
|
flutter_staggered_grid_view: ^0.7.0
|
||||||
@@ -73,7 +74,7 @@ dependencies:
|
|||||||
url: https://github.com/kimaah/image_crop.git
|
url: https://github.com/kimaah/image_crop.git
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^2.0.1
|
flutter_lints: ^3.0.1
|
||||||
flutter_launcher_icons: "^0.13.1"
|
flutter_launcher_icons: "^0.13.1"
|
||||||
flutter_native_splash: "^2.3.0"
|
flutter_native_splash: "^2.3.0"
|
||||||
sqflite_common_ffi: ^2.0.0+3
|
sqflite_common_ffi: ^2.0.0+3
|
||||||
@@ -87,6 +88,7 @@ flutter:
|
|||||||
- assets/animations/
|
- assets/animations/
|
||||||
- assets/images/
|
- assets/images/
|
||||||
- assets/images/subject_covers/
|
- assets/images/subject_covers/
|
||||||
|
- assets/launch_icons/
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
- family: FilcIcons
|
- family: FilcIcons
|
||||||
|
|||||||
17
filcnaplo/windows/.gitignore
vendored
@@ -1,17 +0,0 @@
|
|||||||
flutter/ephemeral/
|
|
||||||
|
|
||||||
# Visual Studio user-specific files.
|
|
||||||
*.suo
|
|
||||||
*.user
|
|
||||||
*.userosscache
|
|
||||||
*.sln.docstates
|
|
||||||
|
|
||||||
# Visual Studio build-related files.
|
|
||||||
x64/
|
|
||||||
x86/
|
|
||||||
|
|
||||||
# Visual Studio cache files
|
|
||||||
# files ending in .cache can be ignored
|
|
||||||
*.[Cc]ache
|
|
||||||
# but keep track of directories ending in .cache
|
|
||||||
!*.[Cc]ache/
|
|
||||||
@@ -31,6 +31,11 @@ bool FlutterWindow::OnCreate() {
|
|||||||
this->Show();
|
this->Show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Flutter can complete the first frame before the "show window" callback is
|
||||||
|
// registered. The following call ensures a frame is pending to ensure the
|
||||||
|
// window is shown. It is a no-op if the first frame hasn't completed yet.
|
||||||
|
flutter_controller_->ForceRedraw();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
47
filcnaplo_desktop_ui/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
pubspec.lock
|
|
||||||
@@ -61,19 +61,26 @@ class FilterBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
// avoid fading over selected tab
|
// avoid fading over selected tab
|
||||||
return ShaderMask(
|
return ShaderMask(
|
||||||
shaderCallback: (Rect bounds) {
|
shaderCallback: (Rect bounds) {
|
||||||
final Color bg = Theme.of(context).scaffoldBackgroundColor;
|
final Color bg =
|
||||||
|
Theme.of(context).scaffoldBackgroundColor;
|
||||||
final double index = controller.animation!.value;
|
final double index = controller.animation!.value;
|
||||||
return LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [
|
return LinearGradient(
|
||||||
index < 0.2 ? Colors.transparent : bg,
|
begin: Alignment.topLeft,
|
||||||
Colors.transparent,
|
end: Alignment.bottomRight,
|
||||||
Colors.transparent,
|
colors: [
|
||||||
index > controller.length - 1.2 ? Colors.transparent : bg
|
index < 0.2 ? Colors.transparent : bg,
|
||||||
], stops: const [
|
Colors.transparent,
|
||||||
0,
|
Colors.transparent,
|
||||||
0.1,
|
index > controller.length - 1.2
|
||||||
0.9,
|
? Colors.transparent
|
||||||
1
|
: bg
|
||||||
]).createShader(bounds);
|
],
|
||||||
|
stops: const [
|
||||||
|
0,
|
||||||
|
0.1,
|
||||||
|
0.9,
|
||||||
|
1
|
||||||
|
]).createShader(bounds);
|
||||||
},
|
},
|
||||||
blendMode: BlendMode.dstOut,
|
blendMode: BlendMode.dstOut,
|
||||||
child: child);
|
child: child);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import 'absences_page.i18n.dart';
|
|||||||
enum AbsenceFilter { absences, delays, misses }
|
enum AbsenceFilter { absences, delays, misses }
|
||||||
|
|
||||||
class SubjectAbsence {
|
class SubjectAbsence {
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
List<Absence> absences;
|
List<Absence> absences;
|
||||||
double percentage;
|
double percentage;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
late String firstName;
|
late String firstName;
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
late List<SubjectAbsence> absences = [];
|
late List<SubjectAbsence> absences = [];
|
||||||
final Map<Subject, Lesson> _lessonCount = {};
|
final Map<GradeSubject, Lesson> _lessonCount = {};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -87,7 +87,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void buildSubjectAbsences() {
|
void buildSubjectAbsences() {
|
||||||
Map<Subject, SubjectAbsence> _absences = {};
|
Map<GradeSubject, SubjectAbsence> _absences = {};
|
||||||
|
|
||||||
for (final absence in absenceProvider.absences) {
|
for (final absence in absenceProvider.absences) {
|
||||||
if (absence.delay != 0) continue;
|
if (absence.delay != 0) continue;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
||||||
import 'package:filcnaplo/helpers/average_helper.dart';
|
import 'package:filcnaplo/helpers/average_helper.dart';
|
||||||
@@ -32,7 +33,7 @@ class GradeSubjectView extends StatefulWidget {
|
|||||||
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
final Subject subject;
|
final GradeSubject subject;
|
||||||
final double groupAverage;
|
final double groupAverage;
|
||||||
|
|
||||||
void push(BuildContext context, {bool root = false}) {
|
void push(BuildContext context, {bool root = false}) {
|
||||||
@@ -56,13 +57,14 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
// Providers
|
// Providers
|
||||||
late GradeProvider gradeProvider;
|
late GradeProvider gradeProvider;
|
||||||
late GradeCalculatorProvider calculatorProvider;
|
late GradeCalculatorProvider calculatorProvider;
|
||||||
|
late SettingsProvider settingsProvider;
|
||||||
|
|
||||||
late double average;
|
late double average;
|
||||||
late Widget gradeGraph;
|
late Widget gradeGraph;
|
||||||
|
|
||||||
bool gradeCalcMode = false;
|
bool gradeCalcMode = false;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject) => !gradeCalcMode
|
List<Grade> getSubjectGrades(GradeSubject subject) => !gradeCalcMode
|
||||||
? gradeProvider.grades.where((e) => e.subject == subject).toList()
|
? gradeProvider.grades.where((e) => e.subject == subject).toList()
|
||||||
: calculatorProvider.grades.where((e) => e.subject == subject).toList();
|
: calculatorProvider.grades.where((e) => e.subject == subject).toList();
|
||||||
|
|
||||||
@@ -142,6 +144,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
gradeProvider = Provider.of<GradeProvider>(context);
|
gradeProvider = Provider.of<GradeProvider>(context);
|
||||||
calculatorProvider = Provider.of<GradeCalculatorProvider>(context);
|
calculatorProvider = Provider.of<GradeCalculatorProvider>(context);
|
||||||
|
settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
List<Grade> subjectGrades = getSubjectGrades(widget.subject).toList();
|
List<Grade> subjectGrades = getSubjectGrades(widget.subject).toList();
|
||||||
average = AverageHelper.averageEvals(subjectGrades);
|
average = AverageHelper.averageEvals(subjectGrades);
|
||||||
@@ -244,7 +247,8 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
subject: widget.subject, context: context),
|
subject: widget.subject, context: context),
|
||||||
scrollController: _scrollController,
|
scrollController: _scrollController,
|
||||||
title: widget.subject.renamedTo ?? widget.subject.name.capital(),
|
title: widget.subject.renamedTo ?? widget.subject.name.capital(),
|
||||||
italic: widget.subject.isRenamed,
|
italic: widget.subject.isRenamed &&
|
||||||
|
settingsProvider.renamedSubjectsItalics,
|
||||||
child: SubjectGradesContainer(
|
child: SubjectGradesContainer(
|
||||||
child: CupertinoScrollbar(
|
child: CupertinoScrollbar(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import 'package:filcnaplo_desktop_ui/pages/grades/grade_subject_view.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:filcnaplo/helpers/average_helper.dart';
|
import 'package:filcnaplo/helpers/average_helper.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/grades/average_selector.dart';
|
import 'package:filcnaplo_mobile_ui/pages/grades/average_selector.dart';
|
||||||
import 'grades_page.i18n.dart';
|
import 'grades_page.i18n.dart';
|
||||||
|
|
||||||
class GradesPage extends StatefulWidget {
|
class GradesPage extends StatefulWidget {
|
||||||
@@ -41,24 +41,25 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
|
|
||||||
int avgDropValue = 0;
|
int avgDropValue = 0;
|
||||||
|
|
||||||
List<Grade> getSubjectGrades(Subject subject, {int days = 0}) => gradeProvider
|
List<Grade> getSubjectGrades(GradeSubject subject, {int days = 0}) =>
|
||||||
.grades
|
gradeProvider.grades
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
e.subject == subject &&
|
e.subject == subject &&
|
||||||
e.type == GradeType.midYear &&
|
e.type == GradeType.midYear &&
|
||||||
(days == 0 ||
|
(days == 0 ||
|
||||||
e.date.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
e.date
|
||||||
.toList();
|
.isBefore(DateTime.now().subtract(Duration(days: days)))))
|
||||||
|
.toList();
|
||||||
|
|
||||||
void generateTiles() {
|
void generateTiles() {
|
||||||
List<Subject> subjects = gradeProvider.grades
|
List<GradeSubject> subjects = gradeProvider.grades
|
||||||
.map((e) => e.subject)
|
.map((e) => e.subject)
|
||||||
.toSet()
|
.toSet()
|
||||||
.toList()
|
.toList()
|
||||||
..sort((a, b) => a.name.compareTo(b.name));
|
..sort((a, b) => a.name.compareTo(b.name));
|
||||||
List<Widget> tiles = [];
|
List<Widget> tiles = [];
|
||||||
|
|
||||||
Map<Subject, double> subjectAvgs = {};
|
Map<GradeSubject, double> subjectAvgs = {};
|
||||||
|
|
||||||
tiles.addAll(subjects.map((subject) {
|
tiles.addAll(subjects.map((subject) {
|
||||||
List<Grade> subjectGrades = getSubjectGrades(subject);
|
List<Grade> subjectGrades = getSubjectGrades(subject);
|
||||||
@@ -144,8 +145,9 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: StatisticsTile(
|
child: StatisticsTile(
|
||||||
outline: true,
|
outline: true,
|
||||||
title: AutoSizeText( // https://discord.com/channels/1111649116020285532/1153397476578050130
|
title: AutoSizeText(
|
||||||
"classavg".i18n,
|
// https://discord.com/channels/1111649116020285532/1153397476578050130
|
||||||
|
"classavg".i18n,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
wrapWords: false,
|
wrapWords: false,
|
||||||
@@ -208,7 +210,7 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
title: Row(
|
title: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
PremiumAverageSelector(
|
AverageSelector(
|
||||||
value: avgDropValue,
|
value: avgDropValue,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ extension Localization on String {
|
|||||||
"7_days_average": "Weekly Average",
|
"7_days_average": "Weekly Average",
|
||||||
"subjectavg": "Subject Average",
|
"subjectavg": "Subject Average",
|
||||||
"classavg": "Class Average",
|
"classavg": "Class Average",
|
||||||
"fail_warning": "Faliure warning",
|
"fail_warning": "Failure warning",
|
||||||
"fail_warning_description": "You are failing %d subject(s)",
|
"fail_warning_description": "You are failing %d subject(s)",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import 'package:filcnaplo/api/client.dart';
|
|||||||
import 'package:filcnaplo/api/login.dart';
|
import 'package:filcnaplo/api/login.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/login/login_button.dart';
|
import 'package:filcnaplo_mobile_ui/screens/login/login_button.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/login/login_input.dart';
|
import 'package:filcnaplo_mobile_ui/screens/login/login_input.dart';
|
||||||
// import 'package:filcnaplo_desktop_ui/screens/login/school_input/school_input.dart';
|
import 'package:filcnaplo_desktop_ui/screens/login/school_input/school_input.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||||
@@ -36,8 +36,8 @@ class LoginScreen extends StatefulWidget {
|
|||||||
class _LoginScreenState extends State<LoginScreen> {
|
class _LoginScreenState extends State<LoginScreen> {
|
||||||
final usernameController = TextEditingController();
|
final usernameController = TextEditingController();
|
||||||
final passwordController = TextEditingController();
|
final passwordController = TextEditingController();
|
||||||
// final schoolController = SchoolInputController();
|
final schoolController = SchoolInputController();
|
||||||
// final _scrollController = ScrollController();
|
final _scrollController = ScrollController();
|
||||||
|
|
||||||
LoginState _loginState = LoginState.normal;
|
LoginState _loginState = LoginState.normal;
|
||||||
bool showBack = false;
|
bool showBack = false;
|
||||||
@@ -57,9 +57,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
FilcAPI.getSchools().then((schools) {
|
FilcAPI.getSchools().then((schools) {
|
||||||
if (schools != null) {
|
if (schools != null) {
|
||||||
// schoolController.update(() {
|
schoolController.update(() {
|
||||||
// schoolController.schools = schools;
|
schoolController.schools = schools;
|
||||||
// });
|
});
|
||||||
} else {
|
} else {
|
||||||
ElegantNotification.error(
|
ElegantNotification.error(
|
||||||
background: Colors.white,
|
background: Colors.white,
|
||||||
@@ -238,10 +238,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// SchoolInput(
|
SchoolInput(
|
||||||
// scroll: _scrollController,
|
scroll: _scrollController,
|
||||||
// controller: schoolController,
|
controller: schoolController,
|
||||||
// ),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -321,8 +321,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
if (username == "" ||
|
if (username == "" ||
|
||||||
password ==
|
password ==
|
||||||
"" /*||
|
"" ||
|
||||||
schoolController.selectedSchool == null*/
|
schoolController.selectedSchool == null
|
||||||
) {
|
) {
|
||||||
return setState(() => _loginState = LoginState.missingFields);
|
return setState(() => _loginState = LoginState.missingFields);
|
||||||
}
|
}
|
||||||
@@ -332,8 +332,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
loginAPI(
|
loginAPI(
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password,
|
||||||
instituteCode: 'shit',
|
instituteCode: schoolController.selectedSchool!.instituteCode,
|
||||||
// instituteCode: schoolController.selectedSchool!.instituteCode,
|
|
||||||
context: context,
|
context: context,
|
||||||
onLogin: (user) {
|
onLogin: (user) {
|
||||||
ElegantNotification.success(
|
ElegantNotification.success(
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class _SidebarState extends State<Sidebar> {
|
|||||||
Provider.of<ExamProvider>(context, listen: false).restore(),
|
Provider.of<ExamProvider>(context, listen: false).restore(),
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
||||||
Provider.of<MessageProvider>(context, listen: false).restore(),
|
Provider.of<MessageProvider>(context, listen: false).restore(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false)
|
||||||
|
.restoreRecipients(),
|
||||||
Provider.of<NoteProvider>(context, listen: false).restore(),
|
Provider.of<NoteProvider>(context, listen: false).restore(),
|
||||||
Provider.of<EventProvider>(context, listen: false).restore(),
|
Provider.of<EventProvider>(context, listen: false).restore(),
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'settings_screen.i18n.dart';
|
import 'settings_screen.i18n.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/nickname.dart';
|
import 'package:filcnaplo_mobile_ui/screens/settings/user/nickname.dart';
|
||||||
import 'package:filcnaplo_premium/ui/mobile/settings/icon_pack.dart';
|
|
||||||
|
|
||||||
class SettingsScreen extends StatefulWidget {
|
class SettingsScreen extends StatefulWidget {
|
||||||
const SettingsScreen({Key? key}) : super(key: key);
|
const SettingsScreen({Key? key}) : super(key: key);
|
||||||
@@ -68,6 +67,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
Provider.of<ExamProvider>(context, listen: false).restore(),
|
Provider.of<ExamProvider>(context, listen: false).restore(),
|
||||||
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
Provider.of<HomeworkProvider>(context, listen: false).restore(),
|
||||||
Provider.of<MessageProvider>(context, listen: false).restore(),
|
Provider.of<MessageProvider>(context, listen: false).restore(),
|
||||||
|
Provider.of<MessageProvider>(context, listen: false)
|
||||||
|
.restoreRecipients(),
|
||||||
Provider.of<NoteProvider>(context, listen: false).restore(),
|
Provider.of<NoteProvider>(context, listen: false).restore(),
|
||||||
Provider.of<EventProvider>(context, listen: false).restore(),
|
Provider.of<EventProvider>(context, listen: false).restore(),
|
||||||
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
Provider.of<AbsenceProvider>(context, listen: false).restore(),
|
||||||
@@ -400,9 +401,9 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
if (v) {
|
if (v) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) => PopScope(
|
||||||
WillPopScope(
|
onPopInvoked: (didPop) =>
|
||||||
onWillPop: () async => false,
|
false,
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
shape:
|
shape:
|
||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
@@ -586,7 +587,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
.secondary,
|
.secondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const PremiumIconPackSelector(),
|
// we need icon pack selector here
|
||||||
|
// const PremiumIconPackSelector(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
47
filcnaplo_kreta_api/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
pubspec.lock
|
|
||||||
@@ -21,23 +21,14 @@ class KretaAPI {
|
|||||||
static String groups(String iss) =>
|
static String groups(String iss) =>
|
||||||
BaseKreta.kreta(iss) + KretaApiEndpoints.groups;
|
BaseKreta.kreta(iss) + KretaApiEndpoints.groups;
|
||||||
static String groupAverages(String iss, String uid) =>
|
static String groupAverages(String iss, String uid) =>
|
||||||
BaseKreta.kreta(iss) +
|
"${BaseKreta.kreta(iss)}${KretaApiEndpoints.groupAverages}?oktatasiNevelesiFeladatUid=$uid";
|
||||||
KretaApiEndpoints.groupAverages +
|
|
||||||
"?oktatasiNevelesiFeladatUid=" +
|
|
||||||
uid;
|
|
||||||
static String averages(String iss, String uid) =>
|
static String averages(String iss, String uid) =>
|
||||||
BaseKreta.kreta(iss) +
|
"${BaseKreta.kreta(iss)}${KretaApiEndpoints.averages}?oktatasiNevelesiFeladatUid=$uid";
|
||||||
KretaApiEndpoints.averages +
|
|
||||||
"?oktatasiNevelesiFeladatUid=" +
|
|
||||||
uid;
|
|
||||||
static String timetable(String iss, {DateTime? start, DateTime? end}) =>
|
static String timetable(String iss, {DateTime? start, DateTime? end}) =>
|
||||||
BaseKreta.kreta(iss) +
|
BaseKreta.kreta(iss) +
|
||||||
KretaApiEndpoints.timetable +
|
KretaApiEndpoints.timetable +
|
||||||
(start != null && end != null
|
(start != null && end != null
|
||||||
? "?datumTol=" +
|
? "?datumTol=${start.toUtc().toIso8601String()}&datumIg=${end.toUtc().toIso8601String()}"
|
||||||
start.toUtc().toIso8601String() +
|
|
||||||
"&datumIg=" +
|
|
||||||
end.toUtc().toIso8601String()
|
|
||||||
: "");
|
: "");
|
||||||
static String exams(String iss) =>
|
static String exams(String iss) =>
|
||||||
BaseKreta.kreta(iss) + KretaApiEndpoints.exams;
|
BaseKreta.kreta(iss) + KretaApiEndpoints.exams;
|
||||||
@@ -46,7 +37,7 @@ class KretaAPI {
|
|||||||
KretaApiEndpoints.homework +
|
KretaApiEndpoints.homework +
|
||||||
(id != null ? "/$id" : "") +
|
(id != null ? "/$id" : "") +
|
||||||
(id == null && start != null
|
(id == null && start != null
|
||||||
? "?datumTol=" + DateFormat('yyyy-MM-dd').format(start)
|
? "?datumTol=${DateFormat('yyyy-MM-dd').format(start)}"
|
||||||
: "");
|
: "");
|
||||||
static String capabilities(String iss) =>
|
static String capabilities(String iss) =>
|
||||||
BaseKreta.kreta(iss) + KretaApiEndpoints.capabilities;
|
BaseKreta.kreta(iss) + KretaApiEndpoints.capabilities;
|
||||||
@@ -54,6 +45,28 @@ class KretaAPI {
|
|||||||
String iss, String uid, String type) =>
|
String iss, String uid, String type) =>
|
||||||
BaseKreta.kreta(iss) +
|
BaseKreta.kreta(iss) +
|
||||||
KretaApiEndpoints.downloadHomeworkAttachments(uid, type);
|
KretaApiEndpoints.downloadHomeworkAttachments(uid, type);
|
||||||
|
static String subjects(String iss, String uid) =>
|
||||||
|
"${BaseKreta.kreta(iss)}${KretaApiEndpoints.subjects}?oktatasiNevelesiFeladatUid=$uid";
|
||||||
|
// Structure:
|
||||||
|
// {
|
||||||
|
// "Uid": 000,
|
||||||
|
// "Tantargy": {
|
||||||
|
// "Uid": 000,
|
||||||
|
// "Nev": "Irodalom",
|
||||||
|
// "Kategoria": {
|
||||||
|
// "Uid": "000,magyar_nyelv_es_irodalom",
|
||||||
|
// "Nev": "magyar_nyelv_es_irodalom",
|
||||||
|
// "Leiras": "Magyar nyelv és irodalom"
|
||||||
|
// },
|
||||||
|
// "SortIndex": 0,
|
||||||
|
// },
|
||||||
|
// "Atlag": null, // float
|
||||||
|
// "AtlagAlakulasaIdoFuggvenyeben": Array[], // no idea what this is
|
||||||
|
// "SulyozottOsztalyzatOsszege": null, // int | float
|
||||||
|
// "SulyozottOsztalyzatSzama": null, // int | float
|
||||||
|
// "SortIndex": 0
|
||||||
|
// }
|
||||||
|
// refer to https://discord.com/channels/1111649116020285532/1111798771513303102/1148368925969612920
|
||||||
|
|
||||||
// ADMIN API
|
// ADMIN API
|
||||||
static const sendMessage =
|
static const sendMessage =
|
||||||
@@ -66,8 +79,10 @@ class KretaAPI {
|
|||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientCategories;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientCategories;
|
||||||
static const availableCategories =
|
static const availableCategories =
|
||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.availableCategories;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.availableCategories;
|
||||||
static const recipientsTeacher =
|
static const recipientTeachers =
|
||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientsTeacher;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientTeachers;
|
||||||
|
static const recipientDirectorate =
|
||||||
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.recipientDirectorate;
|
||||||
static const uploadAttachment =
|
static const uploadAttachment =
|
||||||
BaseKreta.kretaAdmin + KretaAdminEndpoints.uploadAttachment;
|
BaseKreta.kretaAdmin + KretaAdminEndpoints.uploadAttachment;
|
||||||
static String downloadAttachment(String id) =>
|
static String downloadAttachment(String id) =>
|
||||||
@@ -105,6 +120,8 @@ class KretaApiEndpoints {
|
|||||||
static const capabilities = "/ellenorzo/V3/Sajat/Intezmenyek";
|
static const capabilities = "/ellenorzo/V3/Sajat/Intezmenyek";
|
||||||
static String downloadHomeworkAttachments(String uid, String type) =>
|
static String downloadHomeworkAttachments(String uid, String type) =>
|
||||||
"/ellenorzo/V3/Sajat/Csatolmany/$uid";
|
"/ellenorzo/V3/Sajat/Csatolmany/$uid";
|
||||||
|
static const subjects =
|
||||||
|
"/ellenorzo/V3/Sajat/Ertekelesek/Atlagok/TantargyiAtlagok";
|
||||||
}
|
}
|
||||||
|
|
||||||
class KretaAdminEndpoints {
|
class KretaAdminEndpoints {
|
||||||
@@ -116,7 +133,8 @@ class KretaAdminEndpoints {
|
|||||||
"/api/v1/kommunikacio/postaladaelemek/$id";
|
"/api/v1/kommunikacio/postaladaelemek/$id";
|
||||||
static const recipientCategories = "/api/v1/adatszotarak/cimzetttipusok";
|
static const recipientCategories = "/api/v1/adatszotarak/cimzetttipusok";
|
||||||
static const availableCategories = "/api/v1/kommunikacio/cimezhetotipusok";
|
static const availableCategories = "/api/v1/kommunikacio/cimezhetotipusok";
|
||||||
static const recipientsTeacher = "/api/v1/kreta/alkalmazottak/tanar";
|
static const recipientTeachers = "/api/v1/kreta/alkalmazottak/tanar";
|
||||||
|
static const recipientDirectorate = "/api/v1/kreta/alkalmazottak/igazgatosag";
|
||||||
static const uploadAttachment = "/ideiglenesfajlok";
|
static const uploadAttachment = "/ideiglenesfajlok";
|
||||||
static String downloadAttachment(String id) =>
|
static String downloadAttachment(String id) =>
|
||||||
"/api/v1/dokumentumok/uzenetek/$id";
|
"/api/v1/dokumentumok/uzenetek/$id";
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ class KretaClient {
|
|||||||
if (!headerMap.containsKey("content-type")) {
|
if (!headerMap.containsKey("content-type")) {
|
||||||
headerMap["content-type"] = "application/json";
|
headerMap["content-type"] = "application/json";
|
||||||
}
|
}
|
||||||
|
if (url.contains('kommunikacio/uzenetek')) {
|
||||||
|
headerMap["X-Uzenet-Lokalizacio"] = "hu-HU";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = await client.post(Uri.parse(url), headers: headerMap, body: body);
|
res = await client.post(Uri.parse(url), headers: headerMap, body: body);
|
||||||
@@ -153,6 +156,7 @@ class KretaClient {
|
|||||||
if (res == null) throw "Login error";
|
if (res == null) throw "Login error";
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
|
print(jsonDecode(res.body));
|
||||||
return jsonDecode(res.body);
|
return jsonDecode(res.body);
|
||||||
} else {
|
} else {
|
||||||
return res.body;
|
return res.body;
|
||||||
@@ -165,6 +169,69 @@ class KretaClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> sendFilesAPI(
|
||||||
|
String url, {
|
||||||
|
Map<String, String>? headers,
|
||||||
|
bool autoHeader = true,
|
||||||
|
Map<String, String>? body,
|
||||||
|
}) async {
|
||||||
|
Map<String, String> headerMap;
|
||||||
|
|
||||||
|
if (headers != null) {
|
||||||
|
headerMap = headers;
|
||||||
|
} else {
|
||||||
|
headerMap = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
http.StreamedResponse? res;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
if (autoHeader) {
|
||||||
|
if (!headerMap.containsKey("authorization") && accessToken != null) {
|
||||||
|
headerMap["authorization"] = "Bearer $accessToken";
|
||||||
|
}
|
||||||
|
if (!headerMap.containsKey("user-agent") && userAgent != null) {
|
||||||
|
headerMap["user-agent"] = "$userAgent";
|
||||||
|
}
|
||||||
|
if (!headerMap.containsKey("content-type")) {
|
||||||
|
headerMap["content-type"] = "multipart/form-data";
|
||||||
|
}
|
||||||
|
if (url.contains('kommunikacio/uzenetek')) {
|
||||||
|
headerMap["X-Uzenet-Lokalizacio"] = "hu-HU";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var request = http.MultipartRequest("POST", Uri.parse(url));
|
||||||
|
|
||||||
|
// request.files.add(value)
|
||||||
|
|
||||||
|
request.fields.addAll(body ?? {});
|
||||||
|
request.headers.addAll(headers ?? {});
|
||||||
|
|
||||||
|
res = await request.send();
|
||||||
|
|
||||||
|
if (res.statusCode == 401) {
|
||||||
|
await refreshLogin();
|
||||||
|
headerMap.remove("authorization");
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res == null) throw "Login error";
|
||||||
|
|
||||||
|
print(res.statusCode);
|
||||||
|
|
||||||
|
return res.statusCode;
|
||||||
|
} on http.ClientException catch (error) {
|
||||||
|
print(
|
||||||
|
"ERROR: KretaClient.postAPI ($url) ClientException: ${error.message}");
|
||||||
|
} catch (error) {
|
||||||
|
print("ERROR: KretaClient.postAPI ($url) ${error.runtimeType}: $error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> refreshLogin() async {
|
Future<void> refreshLogin() async {
|
||||||
if (_loginRefreshing) return;
|
if (_loginRefreshing) return;
|
||||||
_loginRefreshing = true;
|
_loginRefreshing = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// ignore_for_file: avoid_print
|
// ignore_for_file: avoid_print, use_build_context_synchronously
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
@@ -154,9 +154,9 @@ class TimetableController extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < days.length; i++) {
|
for (int i = 0; i < days.length; i++) {
|
||||||
List<Lesson> _day = List.castFrom(days[i]);
|
List<Lesson> day0 = List.castFrom(days[i]);
|
||||||
|
|
||||||
List<int> lessonIndexes = _getIndexes(_day);
|
List<int> lessonIndexes = _getIndexes(day0);
|
||||||
int minIndex = 0, maxIndex = 0;
|
int minIndex = 0, maxIndex = 0;
|
||||||
|
|
||||||
if (lessonIndexes.isNotEmpty) {
|
if (lessonIndexes.isNotEmpty) {
|
||||||
@@ -170,7 +170,7 @@ class TimetableController extends ChangeNotifier {
|
|||||||
// Fill missing indexes with empty spaces
|
// Fill missing indexes with empty spaces
|
||||||
for (var i in List<int>.generate(
|
for (var i in List<int>.generate(
|
||||||
maxIndex - minIndex + 1, (int i) => minIndex + i)) {
|
maxIndex - minIndex + 1, (int i) => minIndex + i)) {
|
||||||
List<Lesson> indexLessons = _getLessonsByIndex(_day, i);
|
List<Lesson> indexLessons = _getLessonsByIndex(day0, i);
|
||||||
|
|
||||||
// Empty lesson
|
// Empty lesson
|
||||||
if (indexLessons.isEmpty) {
|
if (indexLessons.isEmpty) {
|
||||||
@@ -193,13 +193,13 @@ class TimetableController extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Additional lessons
|
// Additional lessons
|
||||||
day.addAll(_day.where((l) =>
|
day.addAll(day0.where((l) =>
|
||||||
int.tryParse(l.lessonIndex) == null && l.subject.id != ''));
|
int.tryParse(l.lessonIndex) == null && l.subject.id != ''));
|
||||||
|
|
||||||
day.sort((a, b) => a.start.compareTo(b.start));
|
day.sort((a, b) => a.start.compareTo(b.start));
|
||||||
|
|
||||||
// Special Dates
|
// Special Dates
|
||||||
for (var l in _day) {
|
for (var l in day0) {
|
||||||
l.subject.id == '' ? day.insert(0, l) : null;
|
l.subject.id == '' ? day.insert(0, l) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Absence {
|
|||||||
Category? justification;
|
Category? justification;
|
||||||
Category? type;
|
Category? type;
|
||||||
Category? mode;
|
Category? mode;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
DateTime lessonStart;
|
DateTime lessonStart;
|
||||||
DateTime lessonEnd;
|
DateTime lessonEnd;
|
||||||
int? lessonIndex;
|
int? lessonIndex;
|
||||||
@@ -83,7 +83,7 @@ class Absence {
|
|||||||
: null,
|
: null,
|
||||||
type: json["Tipus"] != null ? Category.fromJson(json["Tipus"]) : null,
|
type: json["Tipus"] != null ? Category.fromJson(json["Tipus"]) : null,
|
||||||
mode: json["Mod"] != null ? Category.fromJson(json["Mod"]) : null,
|
mode: json["Mod"] != null ? Category.fromJson(json["Mod"]) : null,
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
lessonStart: lessonStart,
|
lessonStart: lessonStart,
|
||||||
lessonEnd: lessonEnd,
|
lessonEnd: lessonEnd,
|
||||||
lessonIndex: lessonIndex,
|
lessonIndex: lessonIndex,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
||||||
|
|
||||||
import 'category.dart';
|
import 'category.dart';
|
||||||
import 'teacher.dart';
|
import 'teacher.dart';
|
||||||
|
|
||||||
@@ -6,8 +8,9 @@ class Exam {
|
|||||||
DateTime date;
|
DateTime date;
|
||||||
DateTime writeDate;
|
DateTime writeDate;
|
||||||
Category? mode;
|
Category? mode;
|
||||||
int? subjectIndex;
|
// int? subjectIndex;
|
||||||
String subjectName;
|
// String subjectName;
|
||||||
|
GradeSubject subject;
|
||||||
Teacher teacher;
|
Teacher teacher;
|
||||||
String description;
|
String description;
|
||||||
String group;
|
String group;
|
||||||
@@ -18,8 +21,9 @@ class Exam {
|
|||||||
required this.date,
|
required this.date,
|
||||||
required this.writeDate,
|
required this.writeDate,
|
||||||
this.mode,
|
this.mode,
|
||||||
this.subjectIndex,
|
// this.subjectIndex,
|
||||||
required this.subjectName,
|
// required this.subjectName,
|
||||||
|
required this.subject,
|
||||||
required this.teacher,
|
required this.teacher,
|
||||||
required this.description,
|
required this.description,
|
||||||
required this.group,
|
required this.group,
|
||||||
@@ -36,8 +40,9 @@ class Exam {
|
|||||||
? DateTime.parse(json["Datum"]).toLocal()
|
? DateTime.parse(json["Datum"]).toLocal()
|
||||||
: DateTime(0),
|
: DateTime(0),
|
||||||
mode: json["Modja"] != null ? Category.fromJson(json["Modja"]) : null,
|
mode: json["Modja"] != null ? Category.fromJson(json["Modja"]) : null,
|
||||||
subjectIndex: json["OrarendiOraOraszama"],
|
// subjectIndex: json["OrarendiOraOraszama"],
|
||||||
subjectName: json["TantargyNeve"] ?? "",
|
// subjectName: json["TantargyNeve"] ?? "",
|
||||||
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
||||||
description: (json["Temaja"] ?? "").trim(),
|
description: (json["Temaja"] ?? "").trim(),
|
||||||
group: json["OsztalyCsoport"] != null
|
group: json["OsztalyCsoport"] != null
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
||||||
|
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'category.dart';
|
import 'category.dart';
|
||||||
import 'subject.dart';
|
import 'subject.dart';
|
||||||
@@ -12,7 +14,7 @@ class Grade {
|
|||||||
String description;
|
String description;
|
||||||
GradeType type;
|
GradeType type;
|
||||||
String groupId;
|
String groupId;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
Category? gradeType;
|
Category? gradeType;
|
||||||
Category mode;
|
Category mode;
|
||||||
DateTime writeDate;
|
DateTime writeDate;
|
||||||
@@ -57,7 +59,7 @@ class Grade {
|
|||||||
? Category.getGradeType(json["Tipus"]["Nev"])
|
? Category.getGradeType(json["Tipus"]["Nev"])
|
||||||
: GradeType.unknown,
|
: GradeType.unknown,
|
||||||
groupId: (json["OsztalyCsoport"] ?? {})["Uid"] ?? "",
|
groupId: (json["OsztalyCsoport"] ?? {})["Uid"] ?? "",
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
gradeType: json["ErtekFajta"] != null
|
gradeType: json["ErtekFajta"] != null
|
||||||
? Category.fromJson(json["ErtekFajta"])
|
? Category.fromJson(json["ErtekFajta"])
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:filcnaplo_kreta_api/models/subject.dart';
|
|||||||
class GroupAverage {
|
class GroupAverage {
|
||||||
String uid;
|
String uid;
|
||||||
double average;
|
double average;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
Map json;
|
Map json;
|
||||||
|
|
||||||
GroupAverage({required this.uid, required this.average, required this.subject, this.json = const {}});
|
GroupAverage({required this.uid, required this.average, required this.subject, this.json = const {}});
|
||||||
@@ -12,7 +12,7 @@ class GroupAverage {
|
|||||||
return GroupAverage(
|
return GroupAverage(
|
||||||
uid: json["Uid"] ?? "",
|
uid: json["Uid"] ?? "",
|
||||||
average: json["OsztalyCsoportAtlag"] ?? 0,
|
average: json["OsztalyCsoportAtlag"] ?? 0,
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
json: json,
|
json: json,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Homework {
|
|||||||
bool homeworkEnabled;
|
bool homeworkEnabled;
|
||||||
Teacher teacher;
|
Teacher teacher;
|
||||||
String content;
|
String content;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
String group;
|
String group;
|
||||||
List<HomeworkAttachment> attachments;
|
List<HomeworkAttachment> attachments;
|
||||||
String id;
|
String id;
|
||||||
@@ -48,7 +48,7 @@ class Homework {
|
|||||||
homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false,
|
homeworkEnabled: json["IsTanuloHaziFeladatEnabled"] ?? false,
|
||||||
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
teacher: Teacher.fromString((json["RogzitoTanarNeve"] ?? "").trim()),
|
||||||
content: (json["Szoveg"] ?? "").trim(),
|
content: (json["Szoveg"] ?? "").trim(),
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
group: json["OsztalyCsoport"] != null
|
group: json["OsztalyCsoport"] != null
|
||||||
? json["OsztalyCsoport"]["Uid"] ?? ""
|
? json["OsztalyCsoport"]["Uid"] ?? ""
|
||||||
: "",
|
: "",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Lesson {
|
|||||||
Map? json;
|
Map? json;
|
||||||
Category? status;
|
Category? status;
|
||||||
DateTime date;
|
DateTime date;
|
||||||
Subject subject;
|
GradeSubject subject;
|
||||||
String lessonIndex;
|
String lessonIndex;
|
||||||
int? lessonYearIndex;
|
int? lessonYearIndex;
|
||||||
Teacher? substituteTeacher;
|
Teacher? substituteTeacher;
|
||||||
@@ -68,7 +68,7 @@ class Lesson {
|
|||||||
date: json["Datum"] != null
|
date: json["Datum"] != null
|
||||||
? DateTime.parse(json["Datum"]).toLocal()
|
? DateTime.parse(json["Datum"]).toLocal()
|
||||||
: DateTime(0),
|
: DateTime(0),
|
||||||
subject: Subject.fromJson(json["Tantargy"] ?? {}),
|
subject: GradeSubject.fromJson(json["Tantargy"] ?? {}),
|
||||||
lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+",
|
lessonIndex: json["Oraszam"] != null ? json["Oraszam"].toString() : "+",
|
||||||
lessonYearIndex: json["OraEvesSorszama"],
|
lessonYearIndex: json["OraEvesSorszama"],
|
||||||
substituteTeacher: json["HelyettesTanarNeve"] != null
|
substituteTeacher: json["HelyettesTanarNeve"] != null
|
||||||
|
|||||||
@@ -68,13 +68,21 @@ class Message {
|
|||||||
messageId: message["azonosito"],
|
messageId: message["azonosito"],
|
||||||
seen: json["isElolvasva"] ?? false,
|
seen: json["isElolvasva"] ?? false,
|
||||||
deleted: json["isToroltElem"] ?? false,
|
deleted: json["isToroltElem"] ?? false,
|
||||||
date: message["kuldesDatum"] != null ? DateTime.parse(message["kuldesDatum"]).toLocal() : DateTime(0),
|
date: message["kuldesDatum"] != null
|
||||||
|
? DateTime.parse(message["kuldesDatum"]).toLocal()
|
||||||
|
: DateTime(0),
|
||||||
author: (message["feladoNev"] ?? "").trim(),
|
author: (message["feladoNev"] ?? "").trim(),
|
||||||
content: message["szoveg"].replaceAll("\r", "") ?? "",
|
content: message["szoveg"].replaceAll("\r", "") ?? "",
|
||||||
subject: message["targy"] ?? "",
|
subject: message["targy"] ?? "",
|
||||||
type: type,
|
type: type,
|
||||||
recipients: (message["cimzettLista"] as List).cast<Map>().map((Map recipient) => Recipient.fromJson(recipient)).toList(),
|
recipients: (message["cimzettLista"] as List)
|
||||||
attachments: (message["csatolmanyok"] as List).cast<Map>().map((Map attachment) => Attachment.fromJson(attachment)).toList(),
|
.cast<Map>()
|
||||||
|
.map((Map recipient) => Recipient.fromJson(recipient))
|
||||||
|
.toList(),
|
||||||
|
attachments: (message["csatolmanyok"] as List)
|
||||||
|
.cast<Map>()
|
||||||
|
.map((Map attachment) => Attachment.fromJson(attachment))
|
||||||
|
.toList(),
|
||||||
replyId: message["elozoUzenetAzonosito"],
|
replyId: message["elozoUzenetAzonosito"],
|
||||||
conversationId: message["beszelgetesAzonosito"],
|
conversationId: message["beszelgetesAzonosito"],
|
||||||
json: json,
|
json: json,
|
||||||
@@ -105,3 +113,100 @@ class Conversation {
|
|||||||
|
|
||||||
Message get newest => _messages.first;
|
Message get newest => _messages.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sendable message object and it's things
|
||||||
|
class SendMessage {
|
||||||
|
Map? json;
|
||||||
|
int id;
|
||||||
|
int lastMessageId;
|
||||||
|
String? subject;
|
||||||
|
String text;
|
||||||
|
DateTime sentDate;
|
||||||
|
String senderRank;
|
||||||
|
String senderName;
|
||||||
|
List<Attachment>? attachments;
|
||||||
|
List<SendRecipient> recipients;
|
||||||
|
|
||||||
|
SendMessage({
|
||||||
|
required this.id,
|
||||||
|
required this.lastMessageId,
|
||||||
|
this.subject,
|
||||||
|
required this.text,
|
||||||
|
required this.sentDate,
|
||||||
|
required this.senderRank,
|
||||||
|
required this.senderName,
|
||||||
|
this.attachments,
|
||||||
|
required this.recipients,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
class SendRecipient {
|
||||||
|
Map? json;
|
||||||
|
int? id;
|
||||||
|
int? kretaId;
|
||||||
|
String? name;
|
||||||
|
SendRecipientType type;
|
||||||
|
|
||||||
|
SendRecipient({
|
||||||
|
required this.id,
|
||||||
|
required this.kretaId,
|
||||||
|
required this.name,
|
||||||
|
required this.type,
|
||||||
|
this.json,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SendRecipient.fromJson(Map json, SendRecipientType type) {
|
||||||
|
print(json);
|
||||||
|
return SendRecipient(
|
||||||
|
id: int.parse(json['kretaAzonosito'] ?? '0'),
|
||||||
|
kretaId: json['kretaAzonosito'],
|
||||||
|
name: json['nev'],
|
||||||
|
type: type,
|
||||||
|
json: json,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Object get kretaJson => {
|
||||||
|
'azonosito': kretaId ?? 0,
|
||||||
|
'kretaAzonosito': kretaId ?? 0,
|
||||||
|
'nev': name ?? 'Teszt Lajos',
|
||||||
|
'tipus': {
|
||||||
|
'azonosito': type.id,
|
||||||
|
'kod': type.code,
|
||||||
|
'leiras': type.description,
|
||||||
|
'nev': type.name,
|
||||||
|
'rovidNev': type.shortName,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class SendRecipientType {
|
||||||
|
Map? json;
|
||||||
|
int id;
|
||||||
|
String code;
|
||||||
|
String description;
|
||||||
|
String name;
|
||||||
|
String shortName;
|
||||||
|
|
||||||
|
SendRecipientType({
|
||||||
|
required this.id,
|
||||||
|
required this.code,
|
||||||
|
required this.description,
|
||||||
|
required this.name,
|
||||||
|
required this.shortName,
|
||||||
|
this.json,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SendRecipientType.fromJson(Map json) {
|
||||||
|
return SendRecipientType(
|
||||||
|
id: json['azonosito'],
|
||||||
|
code: json['kod'],
|
||||||
|
description: json['leiras'],
|
||||||
|
name: json['nev'],
|
||||||
|
shortName: json['rovidNev'],
|
||||||
|
json: json,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum AddresseeType { teachers, directorate }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'category.dart';
|
import 'category.dart';
|
||||||
|
|
||||||
class Subject {
|
class GradeSubject {
|
||||||
String id;
|
String id;
|
||||||
Category category;
|
Category category;
|
||||||
String name;
|
String name;
|
||||||
@@ -8,11 +8,16 @@ class Subject {
|
|||||||
|
|
||||||
bool get isRenamed => renamedTo != null;
|
bool get isRenamed => renamedTo != null;
|
||||||
|
|
||||||
Subject({required this.id, required this.category, required this.name, this.renamedTo});
|
GradeSubject({
|
||||||
|
required this.id,
|
||||||
|
required this.category,
|
||||||
|
required this.name,
|
||||||
|
this.renamedTo,
|
||||||
|
});
|
||||||
|
|
||||||
factory Subject.fromJson(Map json) {
|
factory GradeSubject.fromJson(Map json) {
|
||||||
final id = json["Uid"] ?? "";
|
final id = json["Uid"] ?? "";
|
||||||
return Subject(
|
return GradeSubject(
|
||||||
id: id,
|
id: id,
|
||||||
category: Category.fromJson(json["Kategoria"] ?? {}),
|
category: Category.fromJson(json["Kategoria"] ?? {}),
|
||||||
name: (json["Nev"] ?? "").trim(),
|
name: (json["Nev"] ?? "").trim(),
|
||||||
@@ -21,7 +26,7 @@ class Subject {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(other) {
|
bool operator ==(other) {
|
||||||
if (other is! Subject) return false;
|
if (other is! GradeSubject) return false;
|
||||||
return id == other.id;
|
return id == other.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
||||||
|
|
||||||
import 'package:filcnaplo_kreta_api/controllers/timetable_controller.dart';
|
import 'package:filcnaplo_kreta_api/controllers/timetable_controller.dart';
|
||||||
|
|
||||||
class Week {
|
class Week {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
||||||
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
import 'package:filcnaplo/models/user.dart';
|
import 'package:filcnaplo/models/user.dart';
|
||||||
@@ -43,12 +45,14 @@ class AbsenceProvider with ChangeNotifier {
|
|||||||
(await _database.query.getSettings(_database)).renamedSubjectsEnabled
|
(await _database.query.getSettings(_database)).renamedSubjectsEnabled
|
||||||
? await _database.userQuery.renamedSubjects(
|
? await _database.userQuery.renamedSubjects(
|
||||||
userId:
|
userId:
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
: {};
|
: {};
|
||||||
Map<String, String> renamedTeachers =
|
Map<String, String> renamedTeachers =
|
||||||
(await _database.query.getSettings(_database)).renamedTeachersEnabled
|
(await _database.query.getSettings(_database)).renamedTeachersEnabled
|
||||||
? await _database.userQuery.renamedTeachers(
|
? await _database.userQuery.renamedTeachers(
|
||||||
userId:
|
userId:
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
|
|||||||
@@ -27,19 +27,51 @@ class ExamProvider with ChangeNotifier {
|
|||||||
|
|
||||||
// Load exams from the database
|
// Load exams from the database
|
||||||
if (userId != null) {
|
if (userId != null) {
|
||||||
var dbExams = await Provider.of<DatabaseProvider>(_context, listen: false).userQuery.getExams(userId: userId);
|
var dbExams = await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userQuery
|
||||||
|
.getExams(userId: userId);
|
||||||
_exams = dbExams;
|
_exams = dbExams;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
await convertBySettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for renamed subjects
|
||||||
|
Future<void> convertBySettings() async {
|
||||||
|
final database = Provider.of<DatabaseProvider>(_context, listen: false);
|
||||||
|
Map<String, String> renamedSubjects =
|
||||||
|
(await database.query.getSettings(database)).renamedSubjectsEnabled
|
||||||
|
? await database.userQuery.renamedSubjects(
|
||||||
|
userId:
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
|
: {};
|
||||||
|
Map<String, String> renamedTeachers =
|
||||||
|
(await database.query.getSettings(database)).renamedTeachersEnabled
|
||||||
|
? await database.userQuery.renamedTeachers(
|
||||||
|
userId:
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
|
: {};
|
||||||
|
|
||||||
|
for (Exam exam in _exams) {
|
||||||
|
exam.subject.renamedTo =
|
||||||
|
renamedSubjects.isNotEmpty ? renamedSubjects[exam.subject.id] : null;
|
||||||
|
exam.teacher.renamedTo =
|
||||||
|
renamedTeachers.isNotEmpty ? renamedTeachers[exam.teacher.id] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
// Fetches Exams from the Kreta API then stores them in the database
|
// Fetches Exams from the Kreta API then stores them in the database
|
||||||
Future<void> fetch() async {
|
Future<void> fetch() async {
|
||||||
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
||||||
if (user == null) throw "Cannot fetch Exams for User null";
|
if (user == null) throw "Cannot fetch Exams for User null";
|
||||||
String iss = user.instituteCode;
|
String iss = user.instituteCode;
|
||||||
|
|
||||||
List? examsJson = await Provider.of<KretaClient>(_context, listen: false).getAPI(KretaAPI.exams(iss));
|
List? examsJson = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.exams(iss));
|
||||||
if (examsJson == null) throw "Cannot fetch Exams for User ${user.id}";
|
if (examsJson == null) throw "Cannot fetch Exams for User ${user.id}";
|
||||||
List<Exam> exams = examsJson.map((e) => Exam.fromJson(e)).toList();
|
List<Exam> exams = examsJson.map((e) => Exam.fromJson(e)).toList();
|
||||||
|
|
||||||
@@ -52,8 +84,11 @@ class ExamProvider with ChangeNotifier {
|
|||||||
if (user == null) throw "Cannot store Exams for User null";
|
if (user == null) throw "Cannot store Exams for User null";
|
||||||
String userId = user.id;
|
String userId = user.id;
|
||||||
|
|
||||||
await Provider.of<DatabaseProvider>(_context, listen: false).userStore.storeExams(exams, userId: userId);
|
await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userStore
|
||||||
|
.storeExams(exams, userId: userId);
|
||||||
_exams = exams;
|
_exams = exams;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
await convertBySettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
// import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/models/user.dart';
|
import 'package:filcnaplo/models/user.dart';
|
||||||
import 'package:filcnaplo_kreta_api/client/api.dart';
|
import 'package:filcnaplo_kreta_api/client/api.dart';
|
||||||
import 'package:filcnaplo_kreta_api/client/client.dart';
|
import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
@@ -11,7 +11,7 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
class HomeworkProvider with ChangeNotifier {
|
class HomeworkProvider with ChangeNotifier {
|
||||||
// Private
|
// Private
|
||||||
late final SettingsProvider _settings;
|
// late final SettingsProvider _settings;
|
||||||
late final UserProvider _user;
|
late final UserProvider _user;
|
||||||
late final DatabaseProvider _database;
|
late final DatabaseProvider _database;
|
||||||
|
|
||||||
@@ -80,9 +80,11 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
List? homeworkJson = [];
|
List? homeworkJson = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
homeworkJson = await Provider.of<KretaClient>(_context, listen: false)
|
Iterable hwjson = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
.getAPI(KretaAPI.homework(iss, start: from));
|
.getAPI(KretaAPI.homework(iss, start: from));
|
||||||
|
homeworkJson = List.from(hwjson.map((model) => model));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (kDebugMode) print(e);
|
||||||
// error fetcing homework (unknown error)
|
// error fetcing homework (unknown error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,15 +97,15 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
await Future.forEach(homeworkJson.cast<Map>(), (Map hw) async {
|
await Future.forEach(homeworkJson.cast<Map>(), (Map hw) async {
|
||||||
Map? e = await Provider.of<KretaClient>(_context, listen: false)
|
Map? e = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
.getAPI(KretaAPI.homework(iss, id: hw["Uid"]));
|
.getAPI(KretaAPI.homework(iss, id: hw["Uid"]));
|
||||||
Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled
|
// Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled
|
||||||
? await _database.userQuery.renamedSubjects(userId: _user.user!.id)
|
// ? await _database.userQuery.renamedSubjects(userId: _user.user!.id)
|
||||||
: {};
|
// : {};
|
||||||
|
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
Homework hw = Homework.fromJson(e);
|
Homework hmwrk = Homework.fromJson(e);
|
||||||
hw.subject.renamedTo =
|
// hw.subject.renamedTo =
|
||||||
renamedSubjects.isNotEmpty ? renamedSubjects[hw.subject.id] : null;
|
// renamedSubjects.isNotEmpty ? renamedSubjects[hw.subject.id] : null;
|
||||||
homework.add(hw);
|
homework.add(hmwrk);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ class HomeworkProvider with ChangeNotifier {
|
|||||||
if (db) await store(homework);
|
if (db) await store(homework);
|
||||||
_homework = homework;
|
_homework = homework;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
await convertBySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stores Homework in the database
|
// Stores Homework in the database
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// ignore_for_file: use_build_context_synchronously
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
import 'package:filcnaplo/models/user.dart';
|
import 'package:filcnaplo/models/user.dart';
|
||||||
@@ -9,17 +13,22 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
class MessageProvider with ChangeNotifier {
|
class MessageProvider with ChangeNotifier {
|
||||||
late List<Message> _messages;
|
late List<Message> _messages;
|
||||||
|
late List<SendRecipient> _recipients;
|
||||||
late BuildContext _context;
|
late BuildContext _context;
|
||||||
|
|
||||||
List<Message> get messages => _messages;
|
List<Message> get messages => _messages;
|
||||||
|
List<SendRecipient> get recipients => _recipients;
|
||||||
|
|
||||||
MessageProvider({
|
MessageProvider({
|
||||||
List<Message> initialMessages = const [],
|
List<Message> initialMessages = const [],
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
}) {
|
}) {
|
||||||
_messages = List.castFrom(initialMessages);
|
_messages = List.castFrom(initialMessages);
|
||||||
|
_recipients = [];
|
||||||
_context = context;
|
_context = context;
|
||||||
|
|
||||||
if (_messages.isEmpty) restore();
|
if (_messages.isEmpty) restore();
|
||||||
|
if (_recipients.isEmpty) restoreRecipients();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> restore() async {
|
Future<void> restore() async {
|
||||||
@@ -27,27 +36,33 @@ class MessageProvider with ChangeNotifier {
|
|||||||
|
|
||||||
// Load messages from the database
|
// Load messages from the database
|
||||||
if (userId != null) {
|
if (userId != null) {
|
||||||
var dbMessages = await Provider.of<DatabaseProvider>(_context, listen: false).userQuery.getMessages(userId: userId);
|
var dbMessages =
|
||||||
|
await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userQuery
|
||||||
|
.getMessages(userId: userId);
|
||||||
_messages = dbMessages;
|
_messages = dbMessages;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetches all types of Messages
|
// Fetches all types of Messages
|
||||||
Future<void> fetchAll() => Future.forEach(MessageType.values, (MessageType v) => fetch(type: v));
|
Future<void> fetchAll() =>
|
||||||
|
Future.forEach(MessageType.values, (MessageType v) => fetch(type: v));
|
||||||
|
|
||||||
// Fetches Messages from the Kreta API then stores them in the database
|
// Fetches Messages from the Kreta API then stores them in the database
|
||||||
Future<void> fetch({MessageType type = MessageType.inbox}) async {
|
Future<void> fetch({MessageType type = MessageType.inbox}) async {
|
||||||
// Check Message Type
|
// Check Message Type
|
||||||
if (type == MessageType.draft) return;
|
if (type == MessageType.draft) return;
|
||||||
String messageType = ["beerkezett", "elkuldott", "torolt"].elementAt(type.index);
|
String messageType =
|
||||||
|
["beerkezett", "elkuldott", "torolt"].elementAt(type.index);
|
||||||
|
|
||||||
// Check User
|
// Check User
|
||||||
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
||||||
if (user == null) throw "Cannot fetch Messages for User null";
|
if (user == null) throw "Cannot fetch Messages for User null";
|
||||||
|
|
||||||
// Get messages
|
// Get messages
|
||||||
List? messagesJson = await Provider.of<KretaClient>(_context, listen: false).getAPI(KretaAPI.messages(messageType));
|
List? messagesJson = await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.messages(messageType));
|
||||||
if (messagesJson == null) throw "Cannot fetch Messages for User ${user.id}";
|
if (messagesJson == null) throw "Cannot fetch Messages for User ${user.id}";
|
||||||
|
|
||||||
// Parse messages
|
// Parse messages
|
||||||
@@ -55,8 +70,12 @@ class MessageProvider with ChangeNotifier {
|
|||||||
await Future.wait(List.generate(messagesJson.length, (index) {
|
await Future.wait(List.generate(messagesJson.length, (index) {
|
||||||
return () async {
|
return () async {
|
||||||
Map message = messagesJson.cast<Map>()[index];
|
Map message = messagesJson.cast<Map>()[index];
|
||||||
Map? messageJson = await Provider.of<KretaClient>(_context, listen: false).getAPI(KretaAPI.message(message["azonosito"].toString()));
|
Map? messageJson =
|
||||||
if (messageJson != null) messages.add(Message.fromJson(messageJson, forceType: type));
|
await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.message(message["azonosito"].toString()));
|
||||||
|
if (messageJson != null) {
|
||||||
|
messages.add(Message.fromJson(messageJson, forceType: type));
|
||||||
|
}
|
||||||
}();
|
}();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -73,8 +92,177 @@ class MessageProvider with ChangeNotifier {
|
|||||||
if (user == null) throw "Cannot store Messages for User null";
|
if (user == null) throw "Cannot store Messages for User null";
|
||||||
|
|
||||||
String userId = user.id;
|
String userId = user.id;
|
||||||
await Provider.of<DatabaseProvider>(_context, listen: false).userStore.storeMessages(_messages, userId: userId);
|
await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userStore
|
||||||
|
.storeMessages(_messages, userId: userId);
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restore recipients
|
||||||
|
Future<void> restoreRecipients() async {
|
||||||
|
String? userId = Provider.of<UserProvider>(_context, listen: false).id;
|
||||||
|
|
||||||
|
// Load messages from the database
|
||||||
|
if (userId != null) {
|
||||||
|
var dbRecipients =
|
||||||
|
await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userQuery
|
||||||
|
.getRecipients(userId: userId);
|
||||||
|
_recipients = dbRecipients;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// fetch all recipients
|
||||||
|
Future<void> fetchAllRecipients() => Future.forEach(
|
||||||
|
AddresseeType.values, (AddresseeType v) => fetchRecipients(type: v));
|
||||||
|
|
||||||
|
// fetch recipients
|
||||||
|
Future<void> fetchRecipients(
|
||||||
|
{AddresseeType type = AddresseeType.teachers}) async {
|
||||||
|
Map<AddresseeType, SendRecipientType> addressable = {};
|
||||||
|
|
||||||
|
// check user
|
||||||
|
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
||||||
|
if (user == null) throw "Cannot fetch Messages for User null";
|
||||||
|
|
||||||
|
// get categories
|
||||||
|
List? availableCategoriesJson =
|
||||||
|
await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.recipientCategories);
|
||||||
|
|
||||||
|
// print(availableCategoriesJson);
|
||||||
|
|
||||||
|
// get recipients
|
||||||
|
List? recipientTeachersJson =
|
||||||
|
await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.recipientTeachers);
|
||||||
|
List? recipientDirectorateJson =
|
||||||
|
await Provider.of<KretaClient>(_context, listen: false)
|
||||||
|
.getAPI(KretaAPI.recipientDirectorate);
|
||||||
|
|
||||||
|
if (availableCategoriesJson == null ||
|
||||||
|
recipientTeachersJson == null ||
|
||||||
|
recipientDirectorateJson == null) {
|
||||||
|
throw "Cannot fetch Recipients for User ${user.id}";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var e in availableCategoriesJson) {
|
||||||
|
// print(e);
|
||||||
|
switch (e['kod']) {
|
||||||
|
case 'TANAR':
|
||||||
|
addressable
|
||||||
|
.addAll({AddresseeType.teachers: SendRecipientType.fromJson(e)});
|
||||||
|
break;
|
||||||
|
case 'IGAZGATOSAG':
|
||||||
|
addressable.addAll(
|
||||||
|
{AddresseeType.directorate: SendRecipientType.fromJson(e)});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// parse recipients
|
||||||
|
List<SendRecipient> recipients = [];
|
||||||
|
|
||||||
|
if (addressable.containsKey(AddresseeType.teachers) &&
|
||||||
|
type == AddresseeType.teachers) {
|
||||||
|
recipients.addAll(recipientTeachersJson.map((e) =>
|
||||||
|
SendRecipient.fromJson(e, addressable[AddresseeType.teachers]!)));
|
||||||
|
}
|
||||||
|
if (addressable.containsKey(AddresseeType.directorate) &&
|
||||||
|
type == AddresseeType.directorate) {
|
||||||
|
recipients.addAll(recipientDirectorateJson.map((e) =>
|
||||||
|
SendRecipient.fromJson(e, addressable[AddresseeType.directorate]!)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (kDebugMode) {
|
||||||
|
// print(addressable);
|
||||||
|
// print(recipients);
|
||||||
|
// print(recipients.first.json);
|
||||||
|
// }
|
||||||
|
|
||||||
|
await storeRecipients(recipients, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
// store recipients
|
||||||
|
Future<void> storeRecipients(
|
||||||
|
List<SendRecipient> recipients, AddresseeType type) async {
|
||||||
|
_recipients.removeWhere((r) => (type == AddresseeType.teachers
|
||||||
|
? (r.type.code == 'TANAR')
|
||||||
|
: (type == AddresseeType.directorate
|
||||||
|
? (r.type.code == 'IGAZGATOSAG')
|
||||||
|
: r.type.code != '')));
|
||||||
|
_recipients.addAll(recipients);
|
||||||
|
|
||||||
|
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
||||||
|
if (user == null) throw "Cannot store Recipients for User null";
|
||||||
|
|
||||||
|
String userId = user.id;
|
||||||
|
await Provider.of<DatabaseProvider>(_context, listen: false)
|
||||||
|
.userStore
|
||||||
|
.storeRecipients(_recipients, userId: userId);
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
// send message
|
||||||
|
Future<String?> sendMessage({
|
||||||
|
required List<SendRecipient> recipients,
|
||||||
|
String subject = "Nincs tárgy",
|
||||||
|
required String messageText,
|
||||||
|
}) async {
|
||||||
|
List<Object> recipientList = [];
|
||||||
|
|
||||||
|
User? user = Provider.of<UserProvider>(_context, listen: false).user;
|
||||||
|
if (user == null) throw "Cannot send Message as User null";
|
||||||
|
|
||||||
|
// for (var r in recipients) {
|
||||||
|
// recipientList.add({
|
||||||
|
// "azonosito": r.id ?? "",
|
||||||
|
// "kretaAzonosito": r.kretaId ?? "",
|
||||||
|
// "nev": r.name ?? "Teszt Lajos",
|
||||||
|
// "tipus": {
|
||||||
|
// "kod": r.type.code,
|
||||||
|
// "leiras": r.type.description,
|
||||||
|
// "azonosito": r.type.id,
|
||||||
|
// "nev": r.type.name,
|
||||||
|
// "rovidNev": r.type.shortName,
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
recipientList.addAll(recipients.map((e) => e.kretaJson));
|
||||||
|
|
||||||
|
Map body = {
|
||||||
|
"cimzettLista": recipientList,
|
||||||
|
"csatolmanyok": [],
|
||||||
|
"azonosito": (Random().nextInt(10000) + 10000),
|
||||||
|
"feladoNev": user.name,
|
||||||
|
"feladoTitulus": user.role == Role.parent ? "Szülő" : "Diák",
|
||||||
|
"kuldesDatum": DateTime.now().toIso8601String(),
|
||||||
|
"targy": subject,
|
||||||
|
"szoveg": messageText,
|
||||||
|
// "elozoUzenetAzonosito": 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
Map<String, String> headers = {
|
||||||
|
"content-type": "application/json",
|
||||||
|
};
|
||||||
|
|
||||||
|
var res = await Provider.of<KretaClient>(_context, listen: false).postAPI(
|
||||||
|
KretaAPI.sendMessage,
|
||||||
|
autoHeader: true,
|
||||||
|
json: true,
|
||||||
|
body: json.encode(body),
|
||||||
|
headers: headers,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (res!['hibakod'] == 'UzenetKuldesEngedelyRule') {
|
||||||
|
return 'send_permission_error';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'successfully_sent';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ class ShareProvider extends ChangeNotifier {
|
|||||||
SettingsProvider.defaultSettings().customAccentColor)
|
SettingsProvider.defaultSettings().customAccentColor)
|
||||||
?.value ??
|
?.value ??
|
||||||
const Color(0xFF3D7BF4).value,
|
const Color(0xFF3D7BF4).value,
|
||||||
|
'icon_color': (settings.customIconColor ??
|
||||||
|
SettingsProvider.defaultSettings().customIconColor)
|
||||||
|
?.value ??
|
||||||
|
const Color(0x00000000).value,
|
||||||
|
'shadow_effect': settings.shadowEffect,
|
||||||
};
|
};
|
||||||
|
|
||||||
SharedTheme theme = SharedTheme.fromJson(themeJson, gradeColors);
|
SharedTheme theme = SharedTheme.fromJson(themeJson, gradeColors);
|
||||||
165
filcnaplo_kreta_api/lib/providers/subject_provider.dart
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
// import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
|
// import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
|
// import 'package:filcnaplo/models/settings.dart';
|
||||||
|
// import 'package:filcnaplo/models/user.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/client/api.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/client/client.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/models/grade.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/models/group_average.dart';
|
||||||
|
// import 'package:filcnaplo_kreta_api/providers/grade_provider.i18n.dart';
|
||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// class SubjectProvider with ChangeNotifier {
|
||||||
|
// // Private
|
||||||
|
// late List<Grade> _grades;
|
||||||
|
// late DateTime _lastSeen;
|
||||||
|
// late String _groups;
|
||||||
|
// List<GroupAverage> _groupAvg = [];
|
||||||
|
// late final SettingsProvider _settings;
|
||||||
|
// late final UserProvider _user;
|
||||||
|
// late final DatabaseProvider _database;
|
||||||
|
// late final KretaClient _kreta;
|
||||||
|
|
||||||
|
// // Public
|
||||||
|
// List<Grade> get grades => _grades;
|
||||||
|
// DateTime get lastSeenDate =>
|
||||||
|
// _settings.gradeOpeningFun ? _lastSeen : DateTime(3000);
|
||||||
|
// String get groups => _groups;
|
||||||
|
// List<GroupAverage> get groupAverages => _groupAvg;
|
||||||
|
|
||||||
|
// SubjectProvider({
|
||||||
|
// List<Grade> initialGrades = const [],
|
||||||
|
// required SettingsProvider settings,
|
||||||
|
// required UserProvider user,
|
||||||
|
// required DatabaseProvider database,
|
||||||
|
// required KretaClient kreta,
|
||||||
|
// }) {
|
||||||
|
// _settings = settings;
|
||||||
|
// _user = user;
|
||||||
|
// _database = database;
|
||||||
|
// _kreta = kreta;
|
||||||
|
|
||||||
|
// _grades = List.castFrom(initialGrades);
|
||||||
|
// _lastSeen = DateTime.now();
|
||||||
|
|
||||||
|
// if (_grades.isEmpty) restore();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> seenAll() async {
|
||||||
|
// String? userId = _user.id;
|
||||||
|
// if (userId != null) {
|
||||||
|
// final userStore = _database.userStore;
|
||||||
|
// userStore.storeLastSeenGrade(DateTime.now(), userId: userId);
|
||||||
|
// _lastSeen = DateTime.now();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> restore() async {
|
||||||
|
// String? userId = _user.id;
|
||||||
|
|
||||||
|
// // Load grades from the database
|
||||||
|
// if (userId != null) {
|
||||||
|
// final userQuery = _database.userQuery;
|
||||||
|
|
||||||
|
// _grades = await userQuery.getGrades(userId: userId);
|
||||||
|
// await convertBySettings();
|
||||||
|
// _groupAvg = await userQuery.getGroupAverages(userId: userId);
|
||||||
|
// notifyListeners();
|
||||||
|
// DateTime lastSeenDB = await userQuery.lastSeenGrade(userId: userId);
|
||||||
|
// if (lastSeenDB.millisecondsSinceEpoch == 0 ||
|
||||||
|
// lastSeenDB.year == 0 ||
|
||||||
|
// !_settings.gradeOpeningFun) {
|
||||||
|
// _lastSeen = DateTime.now();
|
||||||
|
// await seenAll();
|
||||||
|
// } else {
|
||||||
|
// _lastSeen = lastSeenDB;
|
||||||
|
// }
|
||||||
|
// notifyListeners();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // good student mode, renamed subjects
|
||||||
|
// Future<void> convertBySettings() async {
|
||||||
|
// Map<String, String> renamedSubjects = _settings.renamedSubjectsEnabled
|
||||||
|
// ? await _database.userQuery.renamedSubjects(userId: _user.user!.id)
|
||||||
|
// : {};
|
||||||
|
// Map<String, String> renamedTeachers = _settings.renamedTeachersEnabled
|
||||||
|
// ? await _database.userQuery.renamedTeachers(userId: _user.user!.id)
|
||||||
|
// : {};
|
||||||
|
|
||||||
|
// for (Grade grade in _grades) {
|
||||||
|
// grade.subject.renamedTo =
|
||||||
|
// renamedSubjects.isNotEmpty ? renamedSubjects[grade.subject.id] : null;
|
||||||
|
// grade.teacher.renamedTo =
|
||||||
|
// renamedTeachers.isNotEmpty ? renamedTeachers[grade.teacher.id] : null;
|
||||||
|
|
||||||
|
// grade.value.value =
|
||||||
|
// _settings.goodStudent ? 5 : grade.json!["SzamErtek"] ?? 0;
|
||||||
|
// grade.value.valueName = _settings.goodStudent
|
||||||
|
// ? "Jeles".i18n
|
||||||
|
// : '${grade.json!["SzovegesErtek"]}'
|
||||||
|
// .replaceAll(RegExp(r'[(]+[12345]?[)]'), '')
|
||||||
|
// .i18n;
|
||||||
|
// grade.value.shortName = _settings.goodStudent
|
||||||
|
// ? "Jeles".i18n
|
||||||
|
// : '${grade.json!["SzovegesErtekelesRovidNev"]}' != "null" &&
|
||||||
|
// '${grade.json!["SzovegesErtekelesRovidNev"]}' != "-" &&
|
||||||
|
// '${grade.json!["SzovegesErtekelesRovidNev"]}'
|
||||||
|
// .replaceAll(RegExp(r'[0123456789]+[%]?'), '') !=
|
||||||
|
// ""
|
||||||
|
// ? '${grade.json!["SzovegesErtekelesRovidNev"]}'.i18n
|
||||||
|
// : grade.value.valueName;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// notifyListeners();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // fetch subjects from kreten then store them
|
||||||
|
// Future<void> fetch() async {
|
||||||
|
// User? user = _user.user;
|
||||||
|
// if (user == null) throw "Cannot fetch Subjects for User null";
|
||||||
|
// String iss = user.instituteCode;
|
||||||
|
|
||||||
|
// List? gradesJson = await _kreta.getAPI(KretaAPI.subjects(iss, ""));
|
||||||
|
// if (gradesJson == null) throw "Cannot fetch Subjects for User ${user.id}";
|
||||||
|
// List<Grade> grades = gradesJson.map((e) => Grade.fromJson(e)).toList();
|
||||||
|
|
||||||
|
// if (grades.isNotEmpty || _grades.isNotEmpty) await store(grades);
|
||||||
|
|
||||||
|
// List? groupsJson = await _kreta.getAPI(KretaAPI.groups(iss));
|
||||||
|
// if (groupsJson == null || groupsJson.isEmpty) {
|
||||||
|
// throw "Cannot fetch Groups for User ${user.id}";
|
||||||
|
// }
|
||||||
|
// _groups = (groupsJson[0]["OktatasNevelesiFeladat"] ?? {})["Uid"] ?? "";
|
||||||
|
|
||||||
|
// List? groupAvgJson =
|
||||||
|
// await _kreta.getAPI(KretaAPI.groupAverages(iss, _groups));
|
||||||
|
// if (groupAvgJson == null) {
|
||||||
|
// throw "Cannot fetch Class Averages for User ${user.id}";
|
||||||
|
// }
|
||||||
|
// final groupAvgs =
|
||||||
|
// groupAvgJson.map((e) => GroupAverage.fromJson(e)).toList();
|
||||||
|
// await storeGroupAvg(groupAvgs);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // store subjects in db
|
||||||
|
// Future<void> store(List<Grade> grades) async {
|
||||||
|
// User? user = _user.user;
|
||||||
|
// if (user == null) throw "Cannot store Grades for User null";
|
||||||
|
// String userId = user.id;
|
||||||
|
|
||||||
|
// await _database.userStore.storeGrades(grades, userId: userId);
|
||||||
|
// _grades = grades;
|
||||||
|
// await convertBySettings();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> storeGroupAvg(List<GroupAverage> groupAvgs) async {
|
||||||
|
// _groupAvg = groupAvgs;
|
||||||
|
|
||||||
|
// User? user = _user.user;
|
||||||
|
// if (user == null) throw "Cannot store Grades for User null";
|
||||||
|
// String userId = user.id;
|
||||||
|
// await _database.userStore.storeGroupAverages(groupAvgs, userId: userId);
|
||||||
|
// notifyListeners();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
@@ -65,8 +65,14 @@ class TimetableProvider with ChangeNotifier {
|
|||||||
User? user = _user.user;
|
User? user = _user.user;
|
||||||
if (user == null) throw "Cannot fetch Lessons for User null";
|
if (user == null) throw "Cannot fetch Lessons for User null";
|
||||||
String iss = user.instituteCode;
|
String iss = user.instituteCode;
|
||||||
List? lessonsJson = await _kreta
|
|
||||||
.getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end));
|
List? lessonsJson;
|
||||||
|
try {
|
||||||
|
lessonsJson = await _kreta
|
||||||
|
.getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end));
|
||||||
|
} catch (e) {
|
||||||
|
lessonsJson = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (lessonsJson == null) {
|
if (lessonsJson == null) {
|
||||||
if (kDebugMode) print('Cannot fetch Lessons for User ${user.id}');
|
if (kDebugMode) print('Cannot fetch Lessons for User ${user.id}');
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ dependencies:
|
|||||||
path: ../filcnaplo/
|
path: ../filcnaplo/
|
||||||
http: ^0.13.3
|
http: ^0.13.3
|
||||||
provider: ^5.0.0
|
provider: ^5.0.0
|
||||||
file_picker: ^5.3.2
|
file_picker: ^6.1.1
|
||||||
|
intl: ^0.18.1
|
||||||
|
i18n_extension: ^10.0.1
|
||||||
|
uuid: ^4.2.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^1.0.0
|
flutter_lints: ^3.0.1
|
||||||
|
|||||||
47
filcnaplo_mobile_ui/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
*.class
|
|
||||||
*.log
|
|
||||||
*.pyc
|
|
||||||
*.swp
|
|
||||||
.DS_Store
|
|
||||||
.atom/
|
|
||||||
.buildlog/
|
|
||||||
.history
|
|
||||||
.svn/
|
|
||||||
|
|
||||||
# IntelliJ related
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# The .vscode folder contains launch configuration and tasks you configure in
|
|
||||||
# VS Code which you may wish to be included in version control, so this line
|
|
||||||
# is commented out by default.
|
|
||||||
#.vscode/
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
|
||||||
**/doc/api/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
.dart_tool/
|
|
||||||
.flutter-plugins
|
|
||||||
.flutter-plugins-dependencies
|
|
||||||
.packages
|
|
||||||
.pub-cache/
|
|
||||||
.pub/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Web related
|
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Obfuscation related
|
|
||||||
app.*.map.json
|
|
||||||
|
|
||||||
# Android Studio will place build artifacts here
|
|
||||||
/android/app/debug
|
|
||||||
/android/app/profile
|
|
||||||
/android/app/release
|
|
||||||
pubspec.lock
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ActionButton extends StatelessWidget {
|
class ActionButton extends StatelessWidget {
|
||||||
const ActionButton({Key? key, required this.label, this.activeColor, this.onTap}) : super(key: key);
|
const ActionButton({super.key, required this.label, this.activeColor, this.onTap});
|
||||||
|
|
||||||
final Color? activeColor;
|
final Color? activeColor;
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:i18n_extension/i18n_widget.dart';
|
import 'package:i18n_extension/i18n_widget.dart';
|
||||||
|
|
||||||
class AverageDisplay extends StatelessWidget {
|
class AverageDisplay extends StatelessWidget {
|
||||||
const AverageDisplay({Key? key, this.average = 0.0, this.border = false})
|
const AverageDisplay({super.key, this.average = 0.0, this.border = false});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final double average;
|
final double average;
|
||||||
final bool border;
|
final bool border;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BetaChip extends StatelessWidget {
|
class BetaChip extends StatelessWidget {
|
||||||
const BetaChip({Key? key, this.disabled = false}) : super(key: key);
|
const BetaChip({super.key, this.disabled = false});
|
||||||
|
|
||||||
final bool disabled;
|
final bool disabled;
|
||||||
|
|
||||||
@@ -12,6 +12,12 @@ class BetaChip extends StatelessWidget {
|
|||||||
height: 25,
|
height: 25,
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 200),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: !disabled
|
||||||
|
? Theme.of(context).colorScheme.secondary
|
||||||
|
: AppColors.of(context).text.withOpacity(.25),
|
||||||
|
borderRadius: BorderRadius.circular(40),
|
||||||
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 8, right: 8),
|
padding: const EdgeInsets.only(left: 8, right: 8),
|
||||||
child: Center(
|
child: Center(
|
||||||
@@ -29,12 +35,6 @@ class BetaChip extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: !disabled
|
|
||||||
? Theme.of(context).colorScheme.secondary
|
|
||||||
: AppColors.of(context).text.withOpacity(.25),
|
|
||||||
borderRadius: BorderRadius.circular(40),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BottomCard extends StatelessWidget {
|
class BottomCard extends StatelessWidget {
|
||||||
const BottomCard({Key? key, this.child}) : super(key: key);
|
const BottomCard({super.key, this.child});
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/rounded_bottom_shee
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BottomSheetMenu extends StatelessWidget {
|
class BottomSheetMenu extends StatelessWidget {
|
||||||
const BottomSheetMenu({Key? key, this.items = const []}) : super(key: key);
|
const BottomSheetMenu({super.key, this.items = const []});
|
||||||
|
|
||||||
final List<Widget> items;
|
final List<Widget> items;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class BottomSheetMenuItem extends StatelessWidget {
|
class BottomSheetMenuItem extends StatelessWidget {
|
||||||
const BottomSheetMenuItem({Key? key, required this.onPressed, required this.title, this.icon}) : super(key: key);
|
const BottomSheetMenuItem({super.key, required this.onPressed, required this.title, this.icon});
|
||||||
|
|
||||||
final void Function()? onPressed;
|
final void Function()? onPressed;
|
||||||
final Widget? title;
|
final Widget? title;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class RoundedBottomSheet extends StatelessWidget {
|
class RoundedBottomSheet extends StatelessWidget {
|
||||||
const RoundedBottomSheet({Key? key, this.child, this.borderRadius = 12.0, this.shrink = true, this.showHandle = true}) : super(key: key);
|
const RoundedBottomSheet({super.key, this.child, this.borderRadius = 12.0, this.shrink = true, this.showHandle = true});
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final double borderRadius;
|
final double borderRadius;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ SnackBar CustomSnackBar({
|
|||||||
Duration? duration,
|
Duration? duration,
|
||||||
}) {
|
}) {
|
||||||
// backgroundColor > Brightness > Theme Background
|
// backgroundColor > Brightness > Theme Background
|
||||||
|
// ignore: no_leading_underscores_for_local_identifiers
|
||||||
Color _backgroundColor = backgroundColor ?? (AppColors.fromBrightness(brightness ?? Theme.of(context).brightness).highlight);
|
Color _backgroundColor = backgroundColor ?? (AppColors.fromBrightness(brightness ?? Theme.of(context).brightness).highlight);
|
||||||
Color textColor = AppColors.fromBrightness(brightness ?? Theme.of(context).brightness).text;
|
Color textColor = AppColors.fromBrightness(brightness ?? Theme.of(context).brightness).text;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class Detail extends StatelessWidget {
|
class Detail extends StatelessWidget {
|
||||||
const Detail({Key? key, required this.title, required this.description, this.maxLines = 3}) : super(key: key);
|
const Detail({super.key, required this.title, required this.description, this.maxLines = 3});
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
final String description;
|
final String description;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class DialogButton extends StatelessWidget {
|
class DialogButton extends StatelessWidget {
|
||||||
const DialogButton({Key? key, required this.label, this.onTap}) : super(key: key);
|
const DialogButton({super.key, required this.label, this.onTap});
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final Function()? onTap;
|
final Function()? onTap;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Dot extends StatelessWidget {
|
|||||||
final Color color;
|
final Color color;
|
||||||
final double size;
|
final double size;
|
||||||
|
|
||||||
const Dot({Key? key, this.color = Colors.grey, this.size = 16.0}) : super(key: key);
|
const Dot({super.key, this.color = Colors.grey, this.size = 16.0});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ List<String> faces = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
class Empty extends StatelessWidget {
|
class Empty extends StatelessWidget {
|
||||||
const Empty({Key? key, this.subtitle}) : super(key: key);
|
const Empty({super.key, this.subtitle});
|
||||||
|
|
||||||
final String? subtitle;
|
final String? subtitle;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class Empty extends StatelessWidget {
|
|||||||
children: subtitle != null
|
children: subtitle != null
|
||||||
? [
|
? [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: "\n" + subtitle!,
|
text: "\n${subtitle!}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0,
|
||||||
height: 2.0,
|
height: 2.0,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class FilterBar extends StatefulWidget implements PreferredSizeWidget {
|
class FilterBar extends StatefulWidget implements PreferredSizeWidget {
|
||||||
const FilterBar({
|
const FilterBar({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.items,
|
required this.items,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
@@ -13,8 +13,8 @@ class FilterBar extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
this.disableFading = false,
|
this.disableFading = false,
|
||||||
this.scrollable = true,
|
this.scrollable = true,
|
||||||
this.censored = false,
|
this.censored = false,
|
||||||
}) : assert(items.length == controller.length),
|
this.tabAlignment = TabAlignment.start,
|
||||||
super(key: key);
|
}) : assert(items.length == controller.length);
|
||||||
|
|
||||||
final List<Widget> items;
|
final List<Widget> items;
|
||||||
final TabController controller;
|
final TabController controller;
|
||||||
@@ -23,6 +23,7 @@ class FilterBar extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
final bool disableFading;
|
final bool disableFading;
|
||||||
final bool scrollable;
|
final bool scrollable;
|
||||||
final bool censored;
|
final bool censored;
|
||||||
|
final TabAlignment tabAlignment;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Size preferredSize = const Size.fromHeight(42.0);
|
final Size preferredSize = const Size.fromHeight(42.0);
|
||||||
@@ -37,7 +38,9 @@ class _FilterBarState extends State<FilterBar> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
censoredItemsWidth = List.generate(widget.items.length, (index) => 25 + Random().nextDouble() * 50).toList();
|
censoredItemsWidth = List.generate(
|
||||||
|
widget.items.length, (index) => 25 + Random().nextDouble() * 50)
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -67,18 +70,21 @@ class _FilterBarState extends State<FilterBar> {
|
|||||||
tabs: widget.censored
|
tabs: widget.censored
|
||||||
? censoredItemsWidth
|
? censoredItemsWidth
|
||||||
.map(
|
.map(
|
||||||
(e) => Container(
|
(e) => Tab(
|
||||||
width: e,
|
child: Container(
|
||||||
height: 15,
|
width: e,
|
||||||
decoration: BoxDecoration(
|
height: 15,
|
||||||
color: AppColors.of(context).text.withOpacity(.45),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
color: AppColors.of(context).text.withOpacity(.45),
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList()
|
.toList()
|
||||||
: widget.items,
|
: widget.items,
|
||||||
onTap: widget.onTap,
|
onTap: widget.onTap,
|
||||||
|
tabAlignment: widget.tabAlignment,
|
||||||
);
|
);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
@@ -93,19 +99,26 @@ class _FilterBarState extends State<FilterBar> {
|
|||||||
// avoid fading over selected tab
|
// avoid fading over selected tab
|
||||||
return ShaderMask(
|
return ShaderMask(
|
||||||
shaderCallback: (Rect bounds) {
|
shaderCallback: (Rect bounds) {
|
||||||
final Color bg = Theme.of(context).scaffoldBackgroundColor;
|
final Color bg =
|
||||||
|
Theme.of(context).scaffoldBackgroundColor;
|
||||||
final double index = widget.controller.animation!.value;
|
final double index = widget.controller.animation!.value;
|
||||||
return LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [
|
return LinearGradient(
|
||||||
index < 0.2 ? Colors.transparent : bg,
|
begin: Alignment.topLeft,
|
||||||
Colors.transparent,
|
end: Alignment.bottomRight,
|
||||||
Colors.transparent,
|
colors: [
|
||||||
index > widget.controller.length - 1.2 ? Colors.transparent : bg
|
index < 0.2 ? Colors.transparent : bg,
|
||||||
], stops: const [
|
Colors.transparent,
|
||||||
0,
|
Colors.transparent,
|
||||||
0.1,
|
index > widget.controller.length - 1.2
|
||||||
0.9,
|
? Colors.transparent
|
||||||
1
|
: bg
|
||||||
]).createShader(bounds);
|
],
|
||||||
|
stops: const [
|
||||||
|
0,
|
||||||
|
0.1,
|
||||||
|
0.9,
|
||||||
|
1
|
||||||
|
]).createShader(bounds);
|
||||||
},
|
},
|
||||||
blendMode: BlendMode.dstOut,
|
blendMode: BlendMode.dstOut,
|
||||||
child: child);
|
child: child);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import 'package:filcnaplo/utils/format.dart';
|
|||||||
|
|
||||||
class HeroScrollView extends StatefulWidget {
|
class HeroScrollView extends StatefulWidget {
|
||||||
const HeroScrollView(
|
const HeroScrollView(
|
||||||
{Key? key,
|
{super.key,
|
||||||
required this.child,
|
required this.child,
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
@@ -12,8 +12,7 @@ class HeroScrollView extends StatefulWidget {
|
|||||||
this.navBarItems = const [],
|
this.navBarItems = const [],
|
||||||
this.onClose,
|
this.onClose,
|
||||||
this.iconSize = 64.0,
|
this.iconSize = 64.0,
|
||||||
this.scrollController})
|
this.scrollController});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final String title;
|
final String title;
|
||||||
@@ -25,10 +24,10 @@ class HeroScrollView extends StatefulWidget {
|
|||||||
final bool italic;
|
final bool italic;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_HeroScrollViewState createState() => _HeroScrollViewState();
|
HeroScrollViewState createState() => HeroScrollViewState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HeroScrollViewState extends State<HeroScrollView> {
|
class HeroScrollViewState extends State<HeroScrollView> {
|
||||||
late ScrollController _scrollController;
|
late ScrollController _scrollController;
|
||||||
|
|
||||||
bool showBarTitle = false;
|
bool showBarTitle = false;
|
||||||
@@ -69,6 +68,7 @@ class _HeroScrollViewState extends State<HeroScrollView> {
|
|||||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
title: AnimatedOpacity(
|
title: AnimatedOpacity(
|
||||||
opacity: showBarTitle ? 1.0 : 0.0,
|
opacity: showBarTitle ? 1.0 : 0.0,
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(widget.icon,
|
Icon(widget.icon,
|
||||||
@@ -86,8 +86,7 @@ class _HeroScrollViewState extends State<HeroScrollView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
)),
|
||||||
duration: const Duration(milliseconds: 200)),
|
|
||||||
leading: BackButton(
|
leading: BackButton(
|
||||||
color: AppColors.of(context).text,
|
color: AppColors.of(context).text,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class MaterialActionButton extends StatelessWidget {
|
class MaterialActionButton extends StatelessWidget {
|
||||||
const MaterialActionButton({
|
const MaterialActionButton({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.child,
|
required this.child,
|
||||||
this.onPressed,
|
this.onPressed,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final Function()? onPressed;
|
final Function()? onPressed;
|
||||||
@@ -19,17 +19,17 @@ class MaterialActionButton extends StatelessWidget {
|
|||||||
return RawMaterialButton(
|
return RawMaterialButton(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
shape: const StadiumBorder(),
|
shape: const StadiumBorder(),
|
||||||
child: DefaultTextStyle(
|
|
||||||
child: child,
|
|
||||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: backgroundColor != null ? ColorUtils.foregroundColor(backgroundColor!) : null,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
fillColor: backgroundColor ?? AppColors.of(context).text.withOpacity(.15),
|
fillColor: backgroundColor ?? AppColors.of(context).text.withOpacity(.15),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
highlightElevation: 0,
|
highlightElevation: 0,
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
|
child: DefaultTextStyle(
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: backgroundColor != null ? ColorUtils.foregroundColor(backgroundColor!) : null,
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:filcnaplo/theme/colors/colors.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class NewContentIndicator extends StatelessWidget {
|
class NewContentIndicator extends StatelessWidget {
|
||||||
const NewContentIndicator({Key? key, this.size = 64.0}) : super(key: key);
|
const NewContentIndicator({super.key, this.size = 64.0});
|
||||||
|
|
||||||
final double size;
|
final double size;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class Panel extends StatelessWidget {
|
class Panel extends StatelessWidget {
|
||||||
const Panel({Key? key, this.child, this.title, this.padding, this.hasShadow = true}) : super(key: key);
|
const Panel(
|
||||||
|
{super.key, this.child, this.title, this.padding, this.hasShadow = true});
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final Widget? title;
|
final Widget? title;
|
||||||
@@ -25,7 +28,9 @@ class Panel extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
if (hasShadow)
|
if (hasShadow &&
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false)
|
||||||
|
.shadowEffect)
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
offset: const Offset(0, 21),
|
offset: const Offset(0, 21),
|
||||||
blurRadius: 23.0,
|
blurRadius: 23.0,
|
||||||
@@ -42,7 +47,7 @@ class Panel extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PanelTitle extends StatelessWidget {
|
class PanelTitle extends StatelessWidget {
|
||||||
const PanelTitle({Key? key, required this.title}) : super(key: key);
|
const PanelTitle({super.key, required this.title});
|
||||||
|
|
||||||
final Widget title;
|
final Widget title;
|
||||||
|
|
||||||
@@ -51,7 +56,9 @@ class PanelTitle extends StatelessWidget {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
padding: const EdgeInsets.only(left: 14.0, bottom: 8.0),
|
||||||
child: DefaultTextStyle(
|
child: DefaultTextStyle(
|
||||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w600, color: AppColors.of(context).text.withOpacity(0.65)),
|
style: Theme.of(context).textTheme.titleMedium!.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.of(context).text.withOpacity(0.65)),
|
||||||
child: title,
|
child: title,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -59,7 +66,7 @@ class PanelTitle extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PanelHeader extends StatelessWidget {
|
class PanelHeader extends StatelessWidget {
|
||||||
const PanelHeader({Key? key, required this.padding}) : super(key: key);
|
const PanelHeader({super.key, required this.padding});
|
||||||
|
|
||||||
final EdgeInsetsGeometry padding;
|
final EdgeInsetsGeometry padding;
|
||||||
|
|
||||||
@@ -69,14 +76,17 @@ class PanelHeader extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
|
borderRadius: const BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -84,7 +94,7 @@ class PanelHeader extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PanelBody extends StatelessWidget {
|
class PanelBody extends StatelessWidget {
|
||||||
const PanelBody({Key? key, this.child, this.padding}) : super(key: key);
|
const PanelBody({super.key, this.child, this.padding});
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final EdgeInsetsGeometry? padding;
|
final EdgeInsetsGeometry? padding;
|
||||||
@@ -96,11 +106,13 @@ class PanelBody extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
padding: padding,
|
padding: padding,
|
||||||
@@ -110,7 +122,7 @@ class PanelBody extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PanelFooter extends StatelessWidget {
|
class PanelFooter extends StatelessWidget {
|
||||||
const PanelFooter({Key? key, required this.padding}) : super(key: key);
|
const PanelFooter({super.key, required this.padding});
|
||||||
|
|
||||||
final EdgeInsetsGeometry padding;
|
final EdgeInsetsGeometry padding;
|
||||||
|
|
||||||
@@ -120,14 +132,18 @@ class PanelFooter extends StatelessWidget {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(16.0), bottomRight: Radius.circular(16.0)),
|
borderRadius: const BorderRadius.only(
|
||||||
|
bottomLeft: Radius.circular(16.0),
|
||||||
|
bottomRight: Radius.circular(16.0)),
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
if (Provider.of<SettingsProvider>(context, listen: false)
|
||||||
offset: const Offset(0, 21),
|
.shadowEffect)
|
||||||
blurRadius: 23.0,
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor,
|
offset: const Offset(0, 21),
|
||||||
)
|
blurRadius: 23.0,
|
||||||
|
color: Theme.of(context).shadowColor,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class PanelActionButton extends StatelessWidget {
|
class PanelActionButton extends StatelessWidget {
|
||||||
const PanelActionButton({
|
const PanelActionButton({
|
||||||
Key? key,
|
super.key,
|
||||||
this.onPressed,
|
this.onPressed,
|
||||||
this.padding = const EdgeInsets.symmetric(horizontal: 14.0),
|
this.padding = const EdgeInsets.symmetric(horizontal: 14.0),
|
||||||
this.leading,
|
this.leading,
|
||||||
this.title,
|
this.title,
|
||||||
this.trailing,
|
this.trailing,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final void Function()? onPressed;
|
final void Function()? onPressed;
|
||||||
final EdgeInsetsGeometry padding;
|
final EdgeInsetsGeometry padding;
|
||||||
|
|||||||