Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0a7ab20d9 | ||
|
|
59a9e0e236 | ||
|
|
e83202ba29 | ||
|
|
d4489dd9d4 | ||
|
|
debb4cac5b | ||
|
|
acbdf2aecb | ||
|
|
5d9ea4311a | ||
|
|
8aa24d7a32 | ||
|
|
9fbcef357e | ||
|
|
e9423a8535 | ||
|
|
2a7265256d | ||
|
|
d5ba231fcc | ||
|
|
68d92c4462 | ||
|
|
a46f6130cb | ||
|
|
c6021e7a69 | ||
|
|
3ceb40ddb8 | ||
|
|
593292e860 | ||
|
|
ab952daa10 | ||
|
|
56b6eb3d2b | ||
|
|
26be20ac28 | ||
|
|
afd004b980 | ||
|
|
903cbba69a | ||
|
|
6eb6a0cf16 | ||
|
|
abf9f9b13d |
3
changelog.md
Normal file
3
changelog.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- Anoním analitika
|
||||||
|
- Hibabejelentő funkció
|
||||||
|
- Hibajavítások
|
||||||
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-Bold.ttf
Normal file
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-Bold.ttf
Normal file
Binary file not shown.
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-BoldItalic.ttf
Normal file
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-Italic.ttf
Normal file
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-Italic.ttf
Normal file
Binary file not shown.
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-Regular.ttf
Normal file
BIN
filcnaplo/assets/fonts/SpaceMono/SpaceMono-Regular.ttf
Normal file
Binary file not shown.
@@ -58,8 +58,6 @@ PODS:
|
|||||||
- SwiftyGif (5.4.0)
|
- SwiftyGif (5.4.0)
|
||||||
- url_launcher (0.0.1):
|
- url_launcher (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- vibration (1.7.4-nullsafety.0):
|
|
||||||
- Flutter
|
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||||
@@ -72,7 +70,6 @@ DEPENDENCIES:
|
|||||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
- vibration (from `.symlinks/plugins/vibration/ios`)
|
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
@@ -103,8 +100,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/sqflite/ios"
|
:path: ".symlinks/plugins/sqflite/ios"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
:path: ".symlinks/plugins/url_launcher/ios"
|
:path: ".symlinks/plugins/url_launcher/ios"
|
||||||
vibration:
|
|
||||||
:path: ".symlinks/plugins/vibration/ios"
|
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
|
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
|
||||||
@@ -122,7 +117,6 @@ SPEC CHECKSUMS:
|
|||||||
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
|
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
|
||||||
SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
|
SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
|
||||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||||
vibration: 1ec279c4a1a7a646627b54039d812334b3f1114a
|
|
||||||
|
|
||||||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
||||||
|
|
||||||
|
|||||||
@@ -50,5 +50,7 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
<string>The app requires the photo library to set a custom profile picture.</string>
|
<string>The app requires the photo library to set a custom profile picture.</string>
|
||||||
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
|
<false/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -3,15 +3,22 @@ import 'dart:convert';
|
|||||||
import 'package:filcnaplo/models/config.dart';
|
import 'package:filcnaplo/models/config.dart';
|
||||||
import 'package:filcnaplo/models/news.dart';
|
import 'package:filcnaplo/models/news.dart';
|
||||||
import 'package:filcnaplo/models/release.dart';
|
import 'package:filcnaplo/models/release.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/models/supporter.dart';
|
import 'package:filcnaplo/models/supporter.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/school.dart';
|
import 'package:filcnaplo_kreta_api/models/school.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
class FilcAPI {
|
class FilcAPI {
|
||||||
|
// Public API
|
||||||
static const SCHOOL_LIST = "https://filcnaplo.hu/v2/school_list.json";
|
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 NEWS = "https://filcnaplo.hu/v2/news.json";
|
||||||
static const SUPPORTERS = "https://filcnaplo.hu/v2/supporters.json";
|
static const SUPPORTERS = "https://filcnaplo.hu/v2/supporters.json";
|
||||||
|
|
||||||
|
// Private API
|
||||||
|
static const CONFIG = "https://api.filcnaplo.hu/config";
|
||||||
|
static const REPORT = "https://api.filcnaplo.hu/report";
|
||||||
|
|
||||||
|
// Updates
|
||||||
static const REPO = "filc/naplo";
|
static const REPO = "filc/naplo";
|
||||||
static const RELEASES = "https://api.github.com/repos/$REPO/releases";
|
static const RELEASES = "https://api.github.com/repos/$REPO/releases";
|
||||||
|
|
||||||
@@ -35,15 +42,22 @@ class FilcAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Config?> getConfig() async {
|
static Future<Config?> getConfig(SettingsProvider settings) async {
|
||||||
|
Map<String, String> headers = {
|
||||||
|
"x-filc-id": settings.xFilcId,
|
||||||
|
"user-agent": settings.config.userAgent,
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
http.Response res = await http.get(Uri.parse(CONFIG));
|
http.Response res = await http.get(Uri.parse(CONFIG), headers: headers);
|
||||||
|
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
return Config.fromJson(jsonDecode(res.body));
|
return Config.fromJson(jsonDecode(res.body));
|
||||||
} else {
|
} else if (res.statusCode == 429) {
|
||||||
throw "HTTP ${res.statusCode}: ${res.body}";
|
res = await http.get(Uri.parse(CONFIG));
|
||||||
|
if (res.statusCode == 200) return Config.fromJson(jsonDecode(res.body));
|
||||||
}
|
}
|
||||||
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
print("ERROR: FilcAPI.getConfig: $error");
|
print("ERROR: FilcAPI.getConfig: $error");
|
||||||
}
|
}
|
||||||
@@ -104,4 +118,35 @@ class FilcAPI {
|
|||||||
|
|
||||||
return Future.value(null);
|
return Future.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<void> sendReport(ErrorReport report) async {
|
||||||
|
try {
|
||||||
|
http.Response res = await http.post(Uri.parse(REPORT), body: {
|
||||||
|
"os": report.os,
|
||||||
|
"version": report.version,
|
||||||
|
"error": report.error,
|
||||||
|
"stack_trace": report.stack,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.statusCode != 200) {
|
||||||
|
throw "HTTP ${res.statusCode}: ${res.body}";
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
print("ERROR: FilcAPI.sendReport: $error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ErrorReport {
|
||||||
|
String stack;
|
||||||
|
String os;
|
||||||
|
String version;
|
||||||
|
String error;
|
||||||
|
|
||||||
|
ErrorReport({
|
||||||
|
required this.stack,
|
||||||
|
required this.os,
|
||||||
|
required this.version,
|
||||||
|
required this.error,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class App extends StatelessWidget {
|
|||||||
setSystemChrome(context);
|
setSystemChrome(context);
|
||||||
|
|
||||||
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
||||||
FilcAPI.getConfig().then((Config? config) {
|
FilcAPI.getConfig(settings).then((Config? config) {
|
||||||
settings.update(context, database: database, config: config ?? Config.fromJson({}));
|
settings.update(context, database: database, config: config ?? Config.fromJson({}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Future<Database> initDB() async {
|
|||||||
var settingsDB = await createSettingsTable(db);
|
var settingsDB = await createSettingsTable(db);
|
||||||
|
|
||||||
// Create table Users
|
// 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 ("
|
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)");
|
"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 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;
|
return db;
|
||||||
}
|
}
|
||||||
@@ -30,6 +32,7 @@ Future<DatabaseStruct> createSettingsTable(Database db) async {
|
|||||||
"grade_color1": int, "grade_color2": int, "grade_color3": int, "grade_color4": int, "grade_color5": int, // grade colors
|
"grade_color1": int, "grade_color2": int, "grade_color3": int, "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,
|
||||||
"notifications": int, "notifications_bitfield": int, "notification_poll_interval": int, // notifications
|
"notifications": int, "notifications_bitfield": int, "notification_poll_interval": int, // notifications
|
||||||
|
"x_filc_id": String,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create table Settings
|
// Create table Settings
|
||||||
@@ -38,35 +41,67 @@ Future<DatabaseStruct> createSettingsTable(Database db) async {
|
|||||||
return settingsDB;
|
return settingsDB;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> migrateDB(Database db, Iterable<String> keys) async {
|
Future<DatabaseStruct> createUsersTable(Database db) async {
|
||||||
var settings = (await db.query("settings"))[0];
|
var usersDB = DatabaseStruct(
|
||||||
|
{"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int});
|
||||||
|
|
||||||
bool migrationRequired = keys.any((key) => !settings.containsKey(key) || settings[key] == null);
|
// Create table Users
|
||||||
|
await db.execute("CREATE TABLE IF NOT EXISTS users ($usersDB)");
|
||||||
|
|
||||||
if (migrationRequired) {
|
return usersDB;
|
||||||
var defaultSettings = SettingsProvider.defaultSettings();
|
}
|
||||||
var settingsCopy = Map<String, dynamic>.from(settings);
|
|
||||||
|
|
||||||
// Delete settings
|
Future<void> migrateDB(
|
||||||
await db.execute("drop table settings");
|
Database db,
|
||||||
|
String table,
|
||||||
|
Iterable<String> keys,
|
||||||
|
Map<String, Object?> defaultValues,
|
||||||
|
Future<DatabaseStruct> Function(Database) create,
|
||||||
|
) async {
|
||||||
|
var originalRows = await db.query(table);
|
||||||
|
|
||||||
// Fill missing columns
|
if (originalRows.length == 0) {
|
||||||
keys.forEach((key) {
|
await db.execute("drop table $table");
|
||||||
if (!keys.contains(key)) {
|
await create(db);
|
||||||
print("debug: dropping $key");
|
return;
|
||||||
settingsCopy.remove(key);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!settings.containsKey(key) || settings[key] == null) {
|
List<Map<String, dynamic>> migrated = [];
|
||||||
print("DEBUG: migrating $key");
|
|
||||||
settingsCopy[key] = defaultSettings.toMap()[key];
|
await Future.forEach<Map<String, Object?>>(originalRows, (original) async {
|
||||||
}
|
bool migrationRequired = keys.any((key) => !original.containsKey(key) || original[key] == null);
|
||||||
|
|
||||||
|
if (migrationRequired) {
|
||||||
|
print("INFO: Migrating $table");
|
||||||
|
var copy = Map<String, dynamic>.from(original);
|
||||||
|
|
||||||
|
// Fill missing columns
|
||||||
|
keys.forEach((key) {
|
||||||
|
if (!keys.contains(key)) {
|
||||||
|
print("DEBUG: dropping $key");
|
||||||
|
copy.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!original.containsKey(key) || original[key] == null) {
|
||||||
|
print("DEBUG: migrating $key");
|
||||||
|
copy[key] = defaultValues[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
migrated.add(copy);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (migrated.length > 0) {
|
||||||
|
// Delete table
|
||||||
|
await db.execute("drop table $table");
|
||||||
|
|
||||||
|
// Recreate table
|
||||||
|
await create(db);
|
||||||
|
await Future.forEach(migrated, (Map<String, dynamic> copy) async {
|
||||||
|
await db.insert(table, copy);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Recreate settings
|
|
||||||
await createSettingsTable(db);
|
|
||||||
await db.insert("settings", settingsCopy);
|
|
||||||
|
|
||||||
print("INFO: Database migrated");
|
print("INFO: Database migrated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class DatabaseStruct {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "${name} ${typeName.toUpperCase()}";
|
return "${name} ${typeName.toUpperCase()} ${name == 'id' ? 'NOT NULL' : ''}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import 'package:open_file/open_file.dart';
|
|||||||
enum UpdateState { prepare, downloading, installing }
|
enum UpdateState { prepare, downloading, installing }
|
||||||
typedef UpdateCallback = Function(double progress, UpdateState state);
|
typedef UpdateCallback = Function(double progress, UpdateState state);
|
||||||
|
|
||||||
|
// TODO: cleanup old apk files
|
||||||
|
|
||||||
extension UpdateHelper on Release {
|
extension UpdateHelper on Release {
|
||||||
Future<void> install({UpdateCallback? updateCallback}) async {
|
Future<void> install({UpdateCallback? updateCallback}) async {
|
||||||
String downloads = await StorageHelper.downloadsPath();
|
String downloads = await StorageHelper.downloadsPath();
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ 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/database/init.dart';
|
import 'package:filcnaplo/database/init.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:filcnaplo/app.dart';
|
import 'package:filcnaplo/app.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/error_screen.dart';
|
import 'package:filcnaplo_mobile_ui/screens/error_screen.dart';
|
||||||
|
import 'package:filcnaplo_mobile_ui/screens/error_report_screen.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
// Initalize
|
// Initalize
|
||||||
@@ -39,12 +41,24 @@ class Startup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool errorShown = false;
|
||||||
|
String lastException = '';
|
||||||
|
|
||||||
Widget errorBuilder(FlutterErrorDetails details) {
|
Widget errorBuilder(FlutterErrorDetails details) {
|
||||||
return Builder(builder: (context) {
|
return Builder(builder: (context) {
|
||||||
if (Navigator.of(context).canPop()) Navigator.pop(context);
|
if (Navigator.of(context).canPop()) Navigator.pop(context);
|
||||||
|
|
||||||
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
||||||
Navigator.of(context, rootNavigator: true).push(MaterialPageRoute(builder: (ctx) => ErrorScreen(details)));
|
if (!errorShown && details.exceptionAsString() != lastException) {
|
||||||
|
errorShown = true;
|
||||||
|
lastException = details.exceptionAsString();
|
||||||
|
Navigator.of(context, rootNavigator: true).push(MaterialPageRoute(builder: (context) {
|
||||||
|
if (kReleaseMode)
|
||||||
|
return ErrorReportScreen(details);
|
||||||
|
else
|
||||||
|
return ErrorScreen(details);
|
||||||
|
})).then((_) => errorShown = false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return Container();
|
return Container();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:filcnaplo/theme.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
enum Pages { home, grades, timetable, messages, absences }
|
enum Pages { home, grades, timetable, messages, absences }
|
||||||
enum UpdateChannel { stable, beta, dev }
|
enum UpdateChannel { stable, beta, dev }
|
||||||
@@ -47,6 +48,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool _swapABweeks;
|
bool _swapABweeks;
|
||||||
UpdateChannel _updateChannel;
|
UpdateChannel _updateChannel;
|
||||||
Config _config;
|
Config _config;
|
||||||
|
String _xFilcId;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
required String language,
|
required String language,
|
||||||
@@ -66,6 +68,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required bool swapABweeks,
|
required bool swapABweeks,
|
||||||
required UpdateChannel updateChannel,
|
required UpdateChannel updateChannel,
|
||||||
required Config config,
|
required Config config,
|
||||||
|
required String xFilcId,
|
||||||
}) : _language = language,
|
}) : _language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
_rounding = rounding,
|
_rounding = rounding,
|
||||||
@@ -82,7 +85,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_ABweeks = ABweeks,
|
_ABweeks = ABweeks,
|
||||||
_swapABweeks = swapABweeks,
|
_swapABweeks = swapABweeks,
|
||||||
_updateChannel = updateChannel,
|
_updateChannel = updateChannel,
|
||||||
_config = config {
|
_config = config,
|
||||||
|
_xFilcId = xFilcId {
|
||||||
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
|
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
|
||||||
_packageInfo = packageInfo;
|
_packageInfo = packageInfo;
|
||||||
});
|
});
|
||||||
@@ -113,6 +117,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
swapABweeks: map["swap_ab_weeks"] == 1 ? true : false,
|
swapABweeks: map["swap_ab_weeks"] == 1 ? true : false,
|
||||||
updateChannel: UpdateChannel.values[map["update_channel"]],
|
updateChannel: UpdateChannel.values[map["update_channel"]],
|
||||||
config: Config.fromJson(jsonDecode(map["config"] ?? "{}")),
|
config: Config.fromJson(jsonDecode(map["config"] ?? "{}")),
|
||||||
|
xFilcId: map["x_filc_id"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,6 +144,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"swap_ab_weeks": _swapABweeks ? 1 : 0,
|
"swap_ab_weeks": _swapABweeks ? 1 : 0,
|
||||||
"notification_poll_interval": _notificationPollInterval,
|
"notification_poll_interval": _notificationPollInterval,
|
||||||
"config": jsonEncode(config.json),
|
"config": jsonEncode(config.json),
|
||||||
|
"x_filc_id": _xFilcId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,6 +173,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
swapABweeks: false,
|
swapABweeks: false,
|
||||||
updateChannel: UpdateChannel.stable,
|
updateChannel: UpdateChannel.stable,
|
||||||
config: Config.fromJson({}),
|
config: Config.fromJson({}),
|
||||||
|
xFilcId: Uuid().v4(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,6 +196,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
UpdateChannel get updateChannel => _updateChannel;
|
UpdateChannel get updateChannel => _updateChannel;
|
||||||
PackageInfo? get packageInfo => _packageInfo;
|
PackageInfo? get packageInfo => _packageInfo;
|
||||||
Config get config => _config;
|
Config get config => _config;
|
||||||
|
String get xFilcId => _xFilcId;
|
||||||
|
|
||||||
Future<void> update(
|
Future<void> update(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
@@ -210,6 +218,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool? swapABweeks,
|
bool? swapABweeks,
|
||||||
UpdateChannel? updateChannel,
|
UpdateChannel? updateChannel,
|
||||||
Config? config,
|
Config? config,
|
||||||
|
String? xFilcId,
|
||||||
}) 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;
|
||||||
@@ -229,6 +238,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
if (swapABweeks != null && swapABweeks != _swapABweeks) _swapABweeks = swapABweeks;
|
if (swapABweeks != null && swapABweeks != _swapABweeks) _swapABweeks = swapABweeks;
|
||||||
if (updateChannel != null && updateChannel != _updateChannel) _updateChannel = updateChannel;
|
if (updateChannel != null && updateChannel != _updateChannel) _updateChannel = updateChannel;
|
||||||
if (config != null && config != _config) _config = config;
|
if (config != null && config != _config) _config = config;
|
||||||
|
if (xFilcId != null && xFilcId != _xFilcId) _xFilcId = xFilcId;
|
||||||
|
|
||||||
if (database == null) database = Provider.of<DatabaseProvider>(context, listen: false);
|
if (database == null) database = Provider.of<DatabaseProvider>(context, listen: false);
|
||||||
await database.store.storeSettings(this);
|
await database.store.storeSettings(this);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ description: "Nem hivatalos e-napló alkalmazás az e-Kréta rendszerhez"
|
|||||||
homepage: https://filcnaplo.hu
|
homepage: https://filcnaplo.hu
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 3.0.2+130
|
version: 3.0.5+135
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.12.0 <3.0.0"
|
sdk: ">=2.12.0 <3.0.0"
|
||||||
@@ -101,6 +101,17 @@ flutter:
|
|||||||
weight: 100
|
weight: 100
|
||||||
style: italic
|
style: italic
|
||||||
|
|
||||||
|
- family: SpaceMono
|
||||||
|
fonts:
|
||||||
|
- asset: assets/fonts/SpaceMono/SpaceMono-Regular.ttf
|
||||||
|
- asset: assets/fonts/SpaceMono/SpaceMono-Bold.ttf
|
||||||
|
weight: 700
|
||||||
|
- asset: assets/fonts/SpaceMono/SpaceMono-Italic.ttf
|
||||||
|
style: italic
|
||||||
|
- asset: assets/fonts/SpaceMono/SpaceMono-BoldItalic.ttf
|
||||||
|
weight: 700
|
||||||
|
style: italic
|
||||||
|
|
||||||
flutter_icons:
|
flutter_icons:
|
||||||
image_path: "assets/icons/ic_launcher.png"
|
image_path: "assets/icons/ic_launcher.png"
|
||||||
adaptive_icon_background: "#1F5B50"
|
adaptive_icon_background: "#1F5B50"
|
||||||
|
|||||||
Submodule filcnaplo_kreta_api updated: 8b3ec15500...d0392db10a
Submodule filcnaplo_mobile_ui updated: b301aee9d0...fc84baee2f
Reference in New Issue
Block a user