Compare commits

..

53 Commits

Author SHA1 Message Date
unknown
68d92c4462 changelog 2021-09-18 14:27:44 +02:00
unknown
a46f6130cb ios dist fix 2021-09-18 14:25:20 +02:00
unknown
c6021e7a69 version bump 2021-09-18 12:24:56 +02:00
unknown
3ceb40ddb8 mobile 2021-09-18 12:24:38 +02:00
unknown
593292e860 kreten 2021-09-18 12:24:36 +02:00
unknown
ab952daa10 vibration cleanup 2021-09-18 11:57:01 +02:00
unknown
56b6eb3d2b haptics 2021-09-18 11:17:41 +02:00
unknown
26be20ac28 version bump 2021-09-12 20:25:22 +02:00
unknown
afd004b980 migrate users db 2021-09-12 20:24:39 +02:00
unknown
6eb6a0cf16 kreten 2021-09-12 18:32:43 +02:00
unknown
abf9f9b13d todo 2021-09-11 19:26:53 +02:00
unknown
0471843919 mobile 2021-09-11 19:13:04 +02:00
unknown
bb83dd2137 version bump 2021-09-11 19:11:04 +02:00
unknown
d9b07525a4 mobile 2021-09-11 19:10:40 +02:00
unknown
92334406c5 kreten 2021-09-11 19:10:35 +02:00
unknown
506af7fa71 mobile 2021-09-11 18:41:52 +02:00
unknown
f5be03e5ce add role 2021-09-11 18:40:11 +02:00
unknown
2047784d8f mobile 2021-09-11 17:58:31 +02:00
unknown
037cf1df48 kreten 2021-09-11 17:58:27 +02:00
unknown
8238cc0678 role 2021-09-11 17:55:27 +02:00
unknown
f52a747268 mobile 2021-09-11 16:01:56 +02:00
unknown
c37bdc7aff kreten 2021-09-11 16:01:52 +02:00
unknown
9015ff2d6b mobile 2021-09-11 15:53:47 +02:00
unknown
a801503838 trim 2021-09-11 15:53:37 +02:00
55nknown
b0565ddcd9 mobile 2021-09-06 09:54:22 +02:00
55nknown
d8b6ba9a64 ios 2021-09-06 09:39:45 +02:00
unknown
549570a48c version bump 2021-09-05 19:54:30 +02:00
unknown
930e8d86b8 mobile 2021-09-05 19:36:14 +02:00
unknown
4aff7df96f kreten 2021-09-05 19:36:10 +02:00
unknown
c839ac178a android build fix 2021-09-05 19:35:08 +02:00
unknown
2c7efc0a18 kreten 2021-09-05 18:49:59 +02:00
unknown
5252813721 mobile 2021-09-05 18:48:23 +02:00
unknown
15d3daefed kreten 2021-09-05 18:48:18 +02:00
unknown
0729c13362 mobile 2021-09-05 16:58:33 +02:00
unknown
4bb978ba63 mobile 2021-09-05 16:55:43 +02:00
unknown
d9c071b5ae update gradle version 2021-09-05 16:53:13 +02:00
unknown
6ffe4b6c33 gitignore 2021-09-04 20:29:46 +02:00
unknown
7bd5d8bd5a version bump 2021-09-04 20:24:03 +02:00
unknown
c0ffa5d726 commit 2021-09-04 20:05:48 +02:00
unknown
befb107183 mobile 2021-09-04 12:11:15 +02:00
unknown
e56488094e mobile 2021-09-02 20:15:02 +02:00
unknown
74831c3e56 beta 5 2021-09-02 20:03:00 +02:00
unknown
9d3347d680 mobile 2021-09-02 20:01:13 +02:00
unknown
25100ab7d9 add test school 2021-09-02 18:08:31 +02:00
unknown
b509adcbc9 kreten 2021-09-02 17:00:03 +02:00
unknown
d421ae9031 capitalize fix 2021-09-02 16:59:57 +02:00
unknown
c3b79fcb3f today, yesterday fix 2021-09-02 01:34:32 +02:00
unknown
3cf57ac6d4 version bump 2021-09-02 01:28:06 +02:00
unknown
d72bf84a36 supporters 2021-09-02 01:27:59 +02:00
unknown
638b8c9413 limit text scaling 2021-09-02 01:27:29 +02:00
unknown
d5bdca698b commit 2021-09-02 00:18:58 +02:00
unknown
ea6b2ec73d commit 2021-09-02 00:18:41 +02:00
unknown
7ffb58c9ac art icon appears for geography 2021-09-01 14:11:30 +02:00
27 changed files with 436 additions and 62 deletions

3
changelog.md Normal file
View File

@@ -0,0 +1,3 @@
- Haptikus visszajelzés
- Animációk
- Hibajavítások

View File

@@ -9,3 +9,4 @@ 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

View File

@@ -52,6 +52,7 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
signingConfigs {
@@ -77,6 +78,7 @@ flutter {
}
dependencies {
implementation 'com.android.support:multidex:2.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

View File

@@ -13,7 +13,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

View File

@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>

View File

@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

View File

@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"

41
filcnaplo/ios/Podfile Normal file
View File

@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

123
filcnaplo/ios/Podfile.lock Normal file
View File

@@ -0,0 +1,123 @@
PODS:
- DKImagePickerController/Core (4.3.2):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.2)
- DKImagePickerController/PhotoGallery (4.3.2):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.2)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
- DKPhotoGallery/Preview (= 0.0.17)
- DKPhotoGallery/Resource (= 0.0.17)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.17):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.17):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- flutter_custom_tabs (0.0.1):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- open_file (0.0.1):
- Flutter
- package_info_plus (0.4.5):
- Flutter
- path_provider (0.0.1):
- Flutter
- "permission_handler (5.1.0+2)":
- Flutter
- SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1)
- SDWebImage/Core (5.11.1)
- share_plus (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- SwiftyGif (5.4.0)
- url_launcher (0.0.1):
- Flutter
DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- flutter_custom_tabs (from `.symlinks/plugins/flutter_custom_tabs/ios`)
- open_file (from `.symlinks/plugins/open_file/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- FMDB
- SDWebImage
- SwiftyGif
EXTERNAL SOURCES:
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
flutter_custom_tabs:
:path: ".symlinks/plugins/flutter_custom_tabs/ios"
open_file:
:path: ".symlinks/plugins/open_file/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
SPEC CHECKSUMS:
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_custom_tabs: 7a10a08686955cb748e5d26e0ae586d30689bf89
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.11.0

View File

@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
373A6ECB5FC71FE9D8AF2EDB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F0ADD56276103500A3016C8 /* Pods_Runner.framework */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -31,10 +32,13 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
1F0ADD56276103500A3016C8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; 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>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
80777CF254888CE770D5F909 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -42,6 +46,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
98578F0EBCC6D3FF8391AAEB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -49,12 +54,32 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
373A6ECB5FC71FE9D8AF2EDB /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6640A963014A9D4F31026053 /* Frameworks */ = {
isa = PBXGroup;
children = (
1F0ADD56276103500A3016C8 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
91FEB6212755D596FFFFEC73 /* Pods */ = {
isa = PBXGroup;
children = (
80777CF254888CE770D5F909 /* Pods-Runner.debug.xcconfig */,
98578F0EBCC6D3FF8391AAEB /* Pods-Runner.release.xcconfig */,
707F8089D970F81C480F73C4 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
@@ -72,6 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
91FEB6212755D596FFFFEC73 /* Pods */,
6640A963014A9D4F31026053 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -105,12 +132,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
779338C8D92BCBC36F75F791 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
71459C0EB905E05018E3D78F /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -183,6 +212,45 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
71459C0EB905E05018E3D78F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
779338C8D92BCBC36F75F791 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

View File

@@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -50,5 +50,7 @@
</array>
<key>NSPhotoLibraryUsageDescription</key>
<string>The app requires the photo library to set a custom profile picture.</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>

View File

@@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:filcnaplo/models/config.dart';
import 'package:filcnaplo/models/news.dart';
import 'package:filcnaplo/models/release.dart';
import 'package:filcnaplo/models/supporter.dart';
import 'package:filcnaplo_kreta_api/models/school.dart';
import 'package:http/http.dart' as http;
@@ -10,6 +11,7 @@ class FilcAPI {
static const SCHOOL_LIST = "https://filcnaplo.hu/v2/school_list.json";
static const CONFIG = "https://filcnaplo.hu/v2/config.json";
static const NEWS = "https://filcnaplo.hu/v2/news.json";
static const SUPPORTERS = "https://filcnaplo.hu/v2/supporters.json";
static const REPO = "filc/naplo";
static const RELEASES = "https://api.github.com/repos/$REPO/releases";
@@ -18,7 +20,13 @@ class FilcAPI {
http.Response res = await http.get(Uri.parse(SCHOOL_LIST));
if (res.statusCode == 200) {
return (jsonDecode(res.body) as List).cast<Map>().map((json) => School.fromJson(json)).toList();
List<School> schools = (jsonDecode(res.body) as List).cast<Map>().map((json) => School.fromJson(json)).toList();
schools.add(School(
city: "Tiszabura",
instituteCode: "supporttest-reni-tiszabura-teszt01",
name: "FILC Éles Reni tiszabura-teszt",
));
return schools;
} else {
throw "HTTP ${res.statusCode}: ${res.body}";
}
@@ -55,6 +63,20 @@ class FilcAPI {
}
}
static Future<Supporters?> getSupporters() async {
try {
http.Response res = await http.get(Uri.parse(SUPPORTERS));
if (res.statusCode == 200) {
return Supporters.fromJson(jsonDecode(res.body));
} else {
throw "HTTP ${res.statusCode}: ${res.body}";
}
} catch (error) {
print("ERROR: FilcAPI.getSupporters: $error");
}
}
static Future<List<Release>?> getReleases() async {
try {
http.Response res = await http.get(Uri.parse(RELEASES));

View File

@@ -1,3 +1,6 @@
import 'dart:developer';
import 'package:filcnaplo/utils/jwt.dart';
import 'package:filcnaplo_kreta_api/providers/absence_provider.dart';
import 'package:filcnaplo_kreta_api/providers/event_provider.dart';
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
@@ -10,10 +13,8 @@ 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/utils/jwt.dart';
import 'package:filcnaplo_kreta_api/client/api.dart';
import 'package:filcnaplo_kreta_api/client/client.dart';
import 'package:filcnaplo_kreta_api/models/message.dart';
import 'package:filcnaplo_kreta_api/models/student.dart';
import 'package:filcnaplo_kreta_api/models/week.dart';
import 'package:flutter/material.dart';
@@ -65,12 +66,14 @@ Future loginApi({
try {
Provider.of<KretaClient>(context, listen: false).accessToken = res["access_token"];
Map? studentJson = await Provider.of<KretaClient>(context, listen: false).getAPI(KretaAPI.student(instituteCode));
Student student = Student.fromJson(studentJson!);
var user = User(
username: username,
password: password,
instituteCode: instituteCode,
name: JwtUtils.getNameFromJWT(res["access_token"]) ?? "?",
student: Student.fromJson(studentJson!),
name: student.name,
student: student,
role: JwtUtils.getRoleFromJWT(res["access_token"])!,
);
if (onLogin != null) onLogin(user);
@@ -82,14 +85,16 @@ Future loginApi({
// Get user data
try {
await Provider.of<GradeProvider>(context, listen: false).fetch();
await Provider.of<TimetableProvider>(context, listen: false).fetch(week: Week.current());
await Provider.of<ExamProvider>(context, listen: false).fetch();
await Provider.of<HomeworkProvider>(context, listen: false).fetch();
await Provider.of<MessageProvider>(context, listen: false).fetch(type: MessageType.inbox);
await Provider.of<NoteProvider>(context, listen: false).fetch();
await Provider.of<EventProvider>(context, listen: false).fetch();
await Provider.of<AbsenceProvider>(context, listen: false).fetch();
await Future.wait([
Provider.of<GradeProvider>(context, listen: false).fetch(),
Provider.of<TimetableProvider>(context, listen: false).fetch(week: Week.current()),
Provider.of<ExamProvider>(context, listen: false).fetch(),
Provider.of<HomeworkProvider>(context, listen: false).fetch(),
Provider.of<MessageProvider>(context, listen: false).fetchAll(),
Provider.of<NoteProvider>(context, listen: false).fetch(),
Provider.of<EventProvider>(context, listen: false).fetch(),
Provider.of<AbsenceProvider>(context, listen: false).fetch(),
]);
} catch (error) {
print("WARNING: failed to fetch user data: $error");
}

View File

@@ -13,6 +13,7 @@ class UserProvider with ChangeNotifier {
String? get name => user?.name;
String? get username => user?.username;
String? get password => user?.password;
Role? get role => user?.role;
Student? get student => user?.student;
void setUser(String userId) {

View File

@@ -1,3 +1,5 @@
import 'dart:math';
import 'package:filcnaplo/api/client.dart';
import 'package:filcnaplo/api/providers/news_provider.dart';
import 'package:filcnaplo/api/providers/database_provider.dart';
@@ -77,8 +79,11 @@ class App extends StatelessWidget {
builder: (context, themeMode, child) {
return MaterialApp(
builder: (context, child) {
// Limit font size scaling to 1.0
double textScaleFactor = min(MediaQuery.of(context).textScaleFactor, 1.0);
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
child: child ?? Container(),
);
},

View File

@@ -9,7 +9,7 @@ Future<Database> initDB() async {
var settingsDB = await createSettingsTable(db);
// Create table Users
await db.execute("CREATE TABLE IF NOT EXISTS users (id TEXT NOT NULL, name TEXT, username TEXT, password TEXT, institute_code TEXT, student TEXT)");
var usersDB = await createUsersTable(db);
await db.execute("CREATE TABLE IF NOT EXISTS user_data ("
"id TEXT NOT NULL, grades TEXT, timetable TEXT, exams TEXT, homework TEXT, messages TEXT, notes TEXT, events TEXT, absences TEXT)");
@@ -18,7 +18,9 @@ Future<Database> initDB() async {
await db.insert("settings", SettingsProvider.defaultSettings().toMap());
}
await migrateDB(db, settingsDB.struct.keys);
// Migrate Databases
await migrateDB(db, "settings", settingsDB.struct.keys, SettingsProvider.defaultSettings().toMap(), createSettingsTable);
await migrateDB(db, "users", usersDB.struct.keys, {"role": 0}, createUsersTable);
return db;
}
@@ -38,35 +40,59 @@ Future<DatabaseStruct> createSettingsTable(Database db) async {
return settingsDB;
}
Future<void> migrateDB(Database db, Iterable<String> keys) async {
var settings = (await db.query("settings"))[0];
Future<DatabaseStruct> createUsersTable(Database db) async {
var usersDB = DatabaseStruct(
{"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": String});
bool migrationRequired = keys.any((key) => !settings.containsKey(key) || settings[key] == null);
// Create table Users
await db.execute("CREATE TABLE IF NOT EXISTS users ($usersDB)");
return usersDB;
}
Future<void> migrateDB(
Database db,
String table,
Iterable<String> keys,
Map<String, Object?> defaultValues,
Future<DatabaseStruct> Function(Database) create,
) async {
var originalRows = (await db.query(table));
if (originalRows.length == 0) {
await db.execute("drop table $table");
await create(db);
return;
}
await Future.forEach<Map<String, Object?>>(originalRows, (original) async {
bool migrationRequired = keys.any((key) => !original.containsKey(key) || original[key] == null);
if (migrationRequired) {
var defaultSettings = SettingsProvider.defaultSettings();
var settingsCopy = Map<String, dynamic>.from(settings);
print("INFO: Migrating $table");
var copy = Map<String, dynamic>.from(original);
// Delete settings
await db.execute("drop table settings");
// Delete table
await db.execute("drop table $table");
// Fill missing columns
keys.forEach((key) {
if (!keys.contains(key)) {
print("debug: dropping $key");
settingsCopy.remove(key);
print("DEBUG: dropping $key");
copy.remove(key);
}
if (!settings.containsKey(key) || settings[key] == null) {
if (!original.containsKey(key) || original[key] == null) {
print("DEBUG: migrating $key");
settingsCopy[key] = defaultSettings.toMap()[key];
copy[key] = defaultValues[key];
}
});
// Recreate settings
await createSettingsTable(db);
await db.insert("settings", settingsCopy);
// Recreate table
await create(db);
await db.insert(table, copy);
print("INFO: Database migrated");
}
});
}

View File

@@ -15,7 +15,7 @@ class DatabaseStruct {
break;
}
return "${name} ${typeName.toUpperCase()}";
return "${name} ${typeName.toUpperCase()} ${name == 'id' ? 'NOT NULL' : ''}";
}
@override

View File

@@ -7,16 +7,16 @@ class SubjectIcon {
static IconData? lookup({Subject? subject, String? subjectName}) {
assert(!(subject == null && subjectName == null));
String name = subject?.name.toLowerCase().specialChars() ?? subjectName ?? "";
String name = subject?.name.toLowerCase().specialChars().trim() ?? subjectName ?? "";
String category = subject?.category.description.toLowerCase().specialChars() ?? "";
// todo: check for categories
if (RegExp("mate(k|matika)").hasMatch(name) || category == "matematika") return Icons.calculate_outlined;
if (RegExp("magyar nyelv|nyelvtan").hasMatch(name)) return Icons.spellcheck_outlined;
if (RegExp("irodalom").hasMatch(name)) return Icons.menu_book_outlined;
if (RegExp("rajz|muvtori|muveszet|kultura").hasMatch(name)) return Icons.palette_outlined;
if (RegExp("tor(i|tenelem)").hasMatch(name)) return Icons.hourglass_empty_outlined;
if (RegExp("foldrajz").hasMatch(name)) return Icons.public_outlined;
if (RegExp("rajz|muvtori|muveszet|kultura").hasMatch(name)) return Icons.palette_outlined;
if (RegExp("fizika").hasMatch(name)) return Icons.emoji_objects_outlined;
if (RegExp("^enek|zene|szolfezs|zongora|korus").hasMatch(name)) return Icons.music_note_outlined;
if (RegExp("^tes(i|tneveles)|sport").hasMatch(name)) return Icons.sports_soccer_outlined;

View File

@@ -10,6 +10,8 @@ import 'package:open_file/open_file.dart';
enum UpdateState { prepare, downloading, installing }
typedef UpdateCallback = Function(double progress, UpdateState state);
// TODO: cleanup old apk files
extension UpdateHelper on Release {
Future<void> install({UpdateCallback? updateCallback}) async {
String downloads = await StorageHelper.downloadsPath();

View File

@@ -0,0 +1,38 @@
class Supporter {
String name;
String amount;
String platform;
Supporter(this.name, this.amount, this.platform);
factory Supporter.fromJson(Map json) {
return Supporter(
(json["name"] ?? "").trim(),
json["amount"] ?? "",
json["platform"] ?? "",
);
}
}
class Supporters {
List<Supporter> top;
List<Supporter> all;
int progress;
int max;
Supporters({
required this.top,
required this.all,
required this.progress,
required this.max,
});
factory Supporters.fromJson(Map json) {
return Supporters(
max: (json["progress"] ?? {})["max"] ?? 1,
progress: (json["progress"] ?? {})["value"] ?? 0,
all: ((json["all"] ?? []) as List).cast<Map>().map((e) => Supporter.fromJson(e)).toList(),
top: ((json["top"] ?? []) as List).cast<Map>().map((e) => Supporter.fromJson(e)).toList(),
);
}
}

View File

@@ -3,6 +3,8 @@ import 'package:filcnaplo_kreta_api/client/api.dart';
import 'package:filcnaplo_kreta_api/models/student.dart';
import 'package:uuid/uuid.dart';
enum Role { student, parent }
class User {
late String id;
String username;
@@ -10,6 +12,7 @@ class User {
String instituteCode;
String name;
Student student;
Role role;
User({
String? id,
@@ -18,6 +21,7 @@ class User {
required this.password,
required this.instituteCode,
required this.student,
required this.role,
}) {
if (id != null) {
this.id = id;
@@ -32,8 +36,9 @@ class User {
instituteCode: map["institute_code"],
username: map["username"],
password: map["password"],
name: map["name"],
name: map["name"].trim(),
student: Student.fromJson(jsonDecode(map["student"])),
role: Role.values[map["role"] ?? 0],
);
}
@@ -45,9 +50,13 @@ class User {
"institute_code": instituteCode,
"name": name,
"student": jsonEncode(student.json),
"role": role.index,
};
}
@override
String toString() => jsonEncode(toMap());
static Map<String, Object?> loginBody({
required String username,
required String password,

View File

@@ -18,7 +18,7 @@ extension StringFormatUtils on String {
String capital() => this.length > 0 ? this[0].toUpperCase() + this.substring(1) : "";
String capitalize() => this.split(" ").map((w) => this.capital()).join(" ");
String capitalize() => this.split(" ").map((w) => w.capital()).join(" ");
String escapeHtml() {
String htmlString = this;
@@ -37,11 +37,11 @@ extension DateFormatUtils on DateTime {
if (timeOnly) return DateFormat("HH:mm").format(this);
DateTime now = DateTime.now();
if (this.difference(now).inDays == 0) {
if (now.year == this.year && now.month == this.month && now.day == this.day) {
if (this.hour == 0 && this.minute == 0 && this.second == 0) return "Today".i18n;
return DateFormat("HH:mm").format(this);
}
if (this.difference(now).inDays == 1) return "Yesterday".i18n;
if (now.year == this.year && now.month == this.month && now.subtract(Duration(days: 1)).day == this.day) return "Yesterday".i18n;
String formatString;
if (this.year == now.year)

View File

@@ -1,7 +1,9 @@
import 'dart:convert';
import 'package:filcnaplo/models/user.dart';
class JwtUtils {
static String? getNameFromJWT(String jwt) {
static Map? decodeJwt(String jwt) {
var parts = jwt.split(".");
if (parts.length != 3) return null;
@@ -11,8 +13,27 @@ class JwtUtils {
parts[1] += "=";
}
try {
var payload = utf8.decode(base64Url.decode(parts[1]));
var jwtData = jsonDecode(payload);
return jwtData["name"];
return jsonDecode(payload);
} catch (error) {
print("ERROR: JwtUtils.decodeJwt: $error");
}
}
static String? getNameFromJWT(String jwt) {
var jwtData = decodeJwt(jwt);
return jwtData?["name"];
}
static Role? getRoleFromJWT(String jwt) {
var jwtData = decodeJwt(jwt);
switch (jwtData?["role"]) {
case "Tanulo":
return Role.student;
case "Gondviselo":
return Role.parent;
}
}
}

View File

@@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
homepage: https://filcnaplo.hu
publish_to: "none"
version: 3.0.0-beta.3+125
version: 3.0.4+133
environment:
sdk: ">=2.12.0 <3.0.0"