diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..3f51b0a
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,56 @@
+pipeline {
+ agent any
+
+ environment {
+ ANDROID_SDK = '/home/jenkins/flutter_things/android-sdk'
+ ANDROID_PATH="$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools"
+ FLUTTER = '/home/jenkins/flutter_things/flutter/bin'
+ PATH = "$PATH:$ANDROID_PATH:$FLUTTER"
+ //TODO: need to fix flutter
+ }
+
+
+ stages {
+ stage('Copy Key Properties') {
+ steps {
+ // Copy the key.properties file
+ sh 'cp /home/jenkins/key.properties refilc/android/key.properties'
+ }
+ }
+
+ stage('Flutter Doctor') {
+ steps {
+ // Ensure Flutter is set up correctly
+ sh 'flutter doctor'
+ }
+ }
+
+ stage('Dependencies') {
+ steps {
+ // Get Flutter dependencies
+ sh 'cd refilc && flutter pub get'
+ }
+ }
+
+ stage('Build') {
+ steps {
+ // Build the Flutter project
+ sh 'cd refilc && flutter build apk --release'
+ }
+ }
+
+ stage('Archive') {
+ steps {
+ // Archive the APK
+ archiveArtifacts artifacts: 'build/app/outputs/flutter-apk/app-release.apk', fingerprint: true
+ }
+ }
+ }
+
+ post {
+ always {
+ // Clean up workspace after build
+ cleanWs()
+ }
+ }
+}
diff --git a/refilc/android/app/src/main/res/layout/timetable_item.xml b/refilc/android/app/src/main/res/layout/timetable_item.xml
index f057d2d..c72dc65 100644
--- a/refilc/android/app/src/main/res/layout/timetable_item.xml
+++ b/refilc/android/app/src/main/res/layout/timetable_item.xml
@@ -20,7 +20,7 @@
android:gravity="center"
android:text="1."
android:textColor="@color/filc"
- android:textColorLink="#ff3D7BF4"
+ android:textColorLink="#ff052460"
android:textSize="30sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
@@ -110,4 +110,4 @@
android:textColor="@color/white"
tools:ignore="HardcodedText" />
-
\ No newline at end of file
+
diff --git a/refilc/android/app/src/main/res/values/colors.xml b/refilc/android/app/src/main/res/values/colors.xml
index 955cc10..f1facef 100644
--- a/refilc/android/app/src/main/res/values/colors.xml
+++ b/refilc/android/app/src/main/res/values/colors.xml
@@ -27,7 +27,7 @@
#ffFFCC00
#40FFD60A
#ff34C759
- #ff3D7BF4
+ #ff052460
#ff5AC8FA
#ff007AFF
#ff5856D6
@@ -49,8 +49,8 @@
#ffFFD60A
#40FFD60A
#ff32D74B
- #ff3D7BF4
- #ff3D93F5
+ #ff052460
+ #ff06348f
#ff64D2FF
#ff0A84FF
#ff5E5CE6
@@ -66,4 +66,4 @@
#FFF06292
#FFBA68C8
#FF22AC9B
-
\ No newline at end of file
+
diff --git a/refilc/assets/svg/cover_arts/grid.svg b/refilc/assets/svg/cover_arts/grid.svg
new file mode 100644
index 0000000..69e221c
--- /dev/null
+++ b/refilc/assets/svg/cover_arts/grid.svg
@@ -0,0 +1,43 @@
+
diff --git a/refilc/assets/svg/cover_arts/line.svg b/refilc/assets/svg/cover_arts/line.svg
new file mode 100644
index 0000000..7436d92
--- /dev/null
+++ b/refilc/assets/svg/cover_arts/line.svg
@@ -0,0 +1,27 @@
+
diff --git a/refilc/assets/svg/cover_arts/plain.svg b/refilc/assets/svg/cover_arts/plain.svg
new file mode 100644
index 0000000..e381afd
--- /dev/null
+++ b/refilc/assets/svg/cover_arts/plain.svg
@@ -0,0 +1,47 @@
+
diff --git a/refilc/assets/svg/cover_arts/vocal.svg b/refilc/assets/svg/cover_arts/vocal.svg
new file mode 100644
index 0000000..50b24fe
--- /dev/null
+++ b/refilc/assets/svg/cover_arts/vocal.svg
@@ -0,0 +1,28 @@
+
diff --git a/refilc/assets/svg/mesh_bg.svg b/refilc/assets/svg/mesh_bg.svg
deleted file mode 100644
index 5301c50..0000000
--- a/refilc/assets/svg/mesh_bg.svg
+++ /dev/null
@@ -1,43 +0,0 @@
-
diff --git a/refilc/ios/livecard/livecard.swift b/refilc/ios/livecard/livecard.swift
index f5f27e7..0271d1c 100644
--- a/refilc/ios/livecard/livecard.swift
+++ b/refilc/ios/livecard/livecard.swift
@@ -52,14 +52,31 @@ struct LockScreenLiveActivityView: View {
VStack(alignment: .center) {
// Jelenlegi óra
VStack {
- Text(context.state.index + " " + context.state.title)
- .font(.body)
- .bold()
- .multilineTextAlignment(.center)
+ if(context.state.title.contains("Az első órádig")) {
+ Text(context.state.title)
+ .font(.system(size: 15))
+ .bold()
+ .multilineTextAlignment(.center)
+ } else if(context.state.title == "Szünet") {
+ Text(context.state.title)
+ .font(.body)
+ .bold()
+ .padding(.trailing, 90)
- Text("Terem: \(context.state.subtitle)")
- .italic()
- .font(.caption)
+ } else {
+ MultilineTextView(text: "\(context.state.index) \(context.state.title)", limit: 25)
+ .font(.body)
+ .bold()
+ .multilineTextAlignment(.center)
+ }
+
+ //Terem
+ if (!context.state.subtitle.isEmpty) {
+ Text(context.state.subtitle)
+ .italic()
+ .bold()
+ .font(.system(size: 13))
+ }
}
// Leírás
@@ -69,6 +86,7 @@ struct LockScreenLiveActivityView: View {
}
// Következő óra
+ if(context.state.nextSubject != "" && context.state.nextRoom != "") {
HStack {
Image(systemName: "arrow.right")
.resizable()
@@ -80,18 +98,24 @@ struct LockScreenLiveActivityView: View {
.font(.caption2)
}
.multilineTextAlignment(.center)
+ } else {
+ Spacer(minLength: 5)
+ Text("Ez az utolsó óra! Kitartást!")
+ .font(.system(size: 15))
+ }
+
}
.padding(15)
Spacer()
-
+
// Visszaszámláló
Text(timerInterval: context.state.date, countsDown: true)
.multilineTextAlignment(.center)
.frame(width: 85)
.font(.title2)
.monospacedDigit()
- .padding(.trailing, CGFloat(24))
+ .padding(.trailing)
}
.activityBackgroundTint(
context.state.color != "#676767"
@@ -109,7 +133,7 @@ struct LiveCardWidget: Widget {
LockScreenLiveActivityView(context: context)
/// Dynamic Island
} dynamicIsland: { context in
-
+
/// Expanded
return DynamicIsland {
DynamicIslandExpandedRegion(.leading) {
@@ -133,39 +157,95 @@ struct LiveCardWidget: Widget {
).progressViewStyle(.circular)
}
}
- DynamicIslandExpandedRegion(.center) {
- VStack(alignment: .center) {
- Text(context.state.index + context.state.title)
- .lineLimit(1)
- .font(.body)
- .bold()
-
- Text(context.state.subtitle)
- .lineLimit(1)
- .font(.subheadline)
- Spacer()
-
- Text(context.state.description)
- .lineLimit(2)
- .font(.caption)
- }.padding(EdgeInsets(top: 0.0, leading: 5.0, bottom: 0.0, trailing: 0.0))
- }
+ DynamicIslandExpandedRegion(.center) {
+ VStack(alignment: .center) {
+ // Első óra előtti expanded DynamicIsland
+ if(context.state.title.contains("Az első órádig")) {
+ Text("Az első órád:")
+ .font(.body)
+ .bold()
+ .padding(.trailing, -15)
+ MultilineTextView(text: "\(context.state.nextSubject)", limit: 25)
+ .font(.body)
+ .padding(.trailing, -25)
+
+ Text("Ebben a teremben:")
+ .font(.body)
+ .bold()
+ .padding(.leading, 15)
+ Text(context.state.nextRoom)
+ .font(.body)
+ .padding(.leading, 15)
+ } else if(context.state.title == "Szünet") {
+ // Amikor szünet van, expanded DynamicIsland
+ Text(context.state.title)
+ .lineLimit(1)
+ .font(.body)
+ .bold()
+ .padding(.leading, 15)
+
+ Spacer(minLength: 5)
+ Text("Következő óra és terem:")
+ .font(.system(size: 13))
+ .padding(.leading, 25)
+ Text(context.state.nextSubject)
+ .font(.caption)
+ .padding(.leading, 15)
+ Text(context.state.nextRoom)
+ .font(.caption2)
+ .padding(.leading, 15)
+
+ } else {
+ // Amikor óra van, expanded DynamicIsland
+ MultilineTextView(text: "\(context.state.index) \(context.state.title)", limit: 25)
+ .lineLimit(1)
+ .font(.body)
+ .bold()
+ .padding(.trailing, -35)
+
+ Text(context.state.subtitle)
+ .lineLimit(1)
+ .italic()
+ .bold()
+ .font(.system(size: 13))
+ .padding(.trailing, -50)
+
+ Spacer(minLength: 5)
+
+ if(context.state.nextRoom != "" && context.state.nextSubject != "") {
+ Text("Következő óra és terem:")
+ .font(.system(size: 14))
+ .padding(.trailing, -35)
+ Spacer(minLength: 2)
+ Text(context.state.nextSubject)
+ .modifier(DynamicFontSizeModifier(text: context.state.nextSubject))
+ .padding(.trailing, -35)
+ Text(context.state.nextRoom)
+ // ignore: based on nextSubject characters, I check that the font size of the room is the same as the next subject.
+ .modifier(DynamicFontSizeModifier(text: context.state.nextSubject))
+ .padding(.trailing, -35)
+ } else {
+ Text("Ez az utolsó óra! Kitartást!")
+ .font(.system(size: 14))
+ .padding(.trailing, -30)
+ }
+ }
+
+
+ }.padding(EdgeInsets(top: 0.0, leading: 5.0, bottom: 0.0, trailing: 0.0))
+ }
+
/// Compact
} compactLeading: {
- Label {
- Text(context.state.title)
- } icon: {
- Image(systemName: context.state.icon)
- }
- .font(.caption2)
+ Image(systemName: context.state.icon)
}
compactTrailing: {
Text(timerInterval: context.state.date, countsDown: true)
.multilineTextAlignment(.center)
.frame(width: 40)
.font(.caption2)
-
+
/// Collapsed
} minimal: {
VStack(alignment: .center, content: {
@@ -191,7 +271,59 @@ struct LiveCardWidget: Widget {
context.state.color != "#676767"
? Color(hex: context.state.color)
: Color.clear
- )
+ )
+ }
+ }
+}
+
+struct MultilineTextView: View {
+ var text: String
+ var limit: Int = 20 // default is 20 character
+
+ var body: some View {
+ let words = text.split(separator: " ")
+ var currentLine = ""
+ var lines: [String] = []
+
+ for word in words {
+ if (currentLine.count + word.count + 1) > limit {
+ lines.append(currentLine)
+ currentLine = ""
+ }
+ if !currentLine.isEmpty {
+ currentLine += " "
+ }
+ currentLine += word
+ }
+ if !currentLine.isEmpty {
+ lines.append(currentLine)
+ }
+
+ return VStack(alignment: .center) {
+ ForEach(lines, id: \.self) { line in
+ Text(line)
+ }
+ Spacer(minLength: 1)
+ }
+ }
+}
+
+struct DynamicFontSizeModifier: ViewModifier {
+ var text: String
+
+ func body(content: Content) -> some View {
+ content
+ .font(.system(size: fontSize(for: text)))
+ }
+
+ private func fontSize(for text: String) -> CGFloat {
+ let length = text.count
+ if length < 10 {
+ return 12
+ } else if length < 20 {
+ return 12
+ } else {
+ return 11
}
}
}
diff --git a/refilc/lib/api/client.dart b/refilc/lib/api/client.dart
index f86428e..83fe55a 100644
--- a/refilc/lib/api/client.dart
+++ b/refilc/lib/api/client.dart
@@ -336,6 +336,8 @@ class FilcAPI {
if (res.statusCode == 200) {
return (jsonDecode(res.body) as Map);
+ } else if (res.statusCode == 404) {
+ return {"public_id": ""};
} else {
throw "HTTP ${res.statusCode}: ${res.body}";
}
diff --git a/refilc/lib/api/providers/live_card_provider.dart b/refilc/lib/api/providers/live_card_provider.dart
index 1d581db..d1d2922 100644
--- a/refilc/lib/api/providers/live_card_provider.dart
+++ b/refilc/lib/api/providers/live_card_provider.dart
@@ -88,24 +88,24 @@ class LiveCardProvider extends ChangeNotifier {
case LiveCardState.morning:
return {
"color":
- '#${_settings.liveActivityColor.toString().substring(10, 16)}',
+ '#${_settings.liveActivityColor.toString().substring(10, 16)}',
"icon": nextLesson != null
? SubjectIcon.resolveName(subject: nextLesson?.subject)
: "book",
- "title": "Első órádig:",
+ "title": "Jó reggelt! Az első órádig:",
"subtitle": "",
"description": "",
"startDate": storeFirstRunDate != null
? ((storeFirstRunDate?.millisecondsSinceEpoch ?? 0) -
- (_delay.inMilliseconds))
- .toString()
+ (_delay.inMilliseconds))
+ .toString()
: "",
"endDate": ((nextLesson?.start.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"nextSubject": nextLesson != null
? nextLesson?.subject.renamedTo ??
- ShortSubject.resolve(subject: nextLesson?.subject).capital()
+ ShortSubject.resolve(subject: nextLesson?.subject).capital()
: "",
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
};
@@ -113,24 +113,24 @@ class LiveCardProvider extends ChangeNotifier {
case LiveCardState.afternoon:
return {
"color":
- '#${_settings.liveActivityColor.toString().substring(10, 16)}',
+ '#${_settings.liveActivityColor.toString().substring(10, 16)}',
"icon": nextLesson != null
? SubjectIcon.resolveName(subject: nextLesson?.subject)
: "book",
- "title": "Első órádig:",
+ "title": "Jó napot! Az első órádig:",
"subtitle": "",
"description": "",
"startDate": storeFirstRunDate != null
? ((storeFirstRunDate?.millisecondsSinceEpoch ?? 0) -
- (_delay.inMilliseconds))
- .toString()
+ (_delay.inMilliseconds))
+ .toString()
: "",
"endDate": ((nextLesson?.start.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"nextSubject": nextLesson != null
? nextLesson?.subject.renamedTo ??
- ShortSubject.resolve(subject: nextLesson?.subject).capital()
+ ShortSubject.resolve(subject: nextLesson?.subject).capital()
: "",
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
};
@@ -138,24 +138,24 @@ class LiveCardProvider extends ChangeNotifier {
case LiveCardState.night:
return {
"color":
- '#${_settings.liveActivityColor.toString().substring(10, 16)}',
+ '#${_settings.liveActivityColor.toString().substring(10, 16)}',
"icon": nextLesson != null
? SubjectIcon.resolveName(subject: nextLesson?.subject)
: "book",
- "title": "Első órádig:",
+ "title": "Jó estét! Az első órádig:",
"subtitle": "",
"description": "",
"startDate": storeFirstRunDate != null
? ((storeFirstRunDate?.millisecondsSinceEpoch ?? 0) -
- (_delay.inMilliseconds))
- .toString()
+ (_delay.inMilliseconds))
+ .toString()
: "",
"endDate": ((nextLesson?.start.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"nextSubject": nextLesson != null
? nextLesson?.subject.renamedTo ??
- ShortSubject.resolve(subject: nextLesson?.subject).capital()
+ ShortSubject.resolve(subject: nextLesson?.subject).capital()
: "",
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
};
@@ -163,28 +163,28 @@ class LiveCardProvider extends ChangeNotifier {
case LiveCardState.duringLesson:
return {
"color":
- '#${_settings.liveActivityColor.toString().substring(10, 16)}',
+ '#${_settings.liveActivityColor.toString().substring(10, 16)}',
"icon": currentLesson != null
? SubjectIcon.resolveName(subject: currentLesson?.subject)
: "book",
"index":
- currentLesson != null ? '${currentLesson!.lessonIndex}. ' : "",
+ currentLesson != null ? '${currentLesson!.lessonIndex}. ' : "",
"title": currentLesson != null
? currentLesson?.subject.renamedTo ??
- ShortSubject.resolve(subject: currentLesson?.subject)
- .capital()
+ ShortSubject.resolve(subject: currentLesson?.subject)
+ .capital()
: "",
- "subtitle": currentLesson?.room.replaceAll("_", " ") ?? "",
+ "subtitle": "Terem: ${currentLesson?.room.replaceAll("_", " ") ?? ""}",
"description": currentLesson?.description ?? "",
"startDate": ((currentLesson?.start.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"endDate": ((currentLesson?.end.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"nextSubject": nextLesson != null
? nextLesson?.subject.renamedTo ??
- ShortSubject.resolve(subject: nextLesson?.subject).capital()
+ ShortSubject.resolve(subject: nextLesson?.subject).capital()
: "",
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
};
@@ -200,23 +200,23 @@ class LiveCardProvider extends ChangeNotifier {
return {
"color":
- '#${_settings.liveActivityColor.toString().substring(10, 16)}',
+ '#${_settings.liveActivityColor.toString().substring(10, 16)}',
"icon": iconFloorMap[diff] ?? "cup.and.saucer",
"title": "Szünet",
"description": "go $diff".i18n.fill([
diff != "to room" ? (nextLesson!.getFloor() ?? 0) : nextLesson!.room
]),
"startDate": ((prevLesson?.end.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"endDate": ((nextLesson?.start.millisecondsSinceEpoch ?? 0) -
- _delay.inMilliseconds)
+ _delay.inMilliseconds)
.toString(),
"nextSubject": (nextLesson != null
- ? nextLesson?.subject.renamedTo ??
- ShortSubject.resolve(subject: nextLesson?.subject)
- .capital()
- : "")
+ ? nextLesson?.subject.renamedTo ??
+ ShortSubject.resolve(subject: nextLesson?.subject)
+ .capital()
+ : "")
.capital(),
"nextRoom": nextLesson?.room.replaceAll("_", " ") ?? "",
"index": "",
@@ -243,8 +243,8 @@ class LiveCardProvider extends ChangeNotifier {
DateTime now = _now().add(_delay);
if ((currentState == LiveCardState.morning ||
- currentState == LiveCardState.afternoon ||
- currentState == LiveCardState.night) &&
+ currentState == LiveCardState.afternoon ||
+ currentState == LiveCardState.night) &&
storeFirstRunDate == null) {
storeFirstRunDate = now;
}
@@ -253,9 +253,9 @@ class LiveCardProvider extends ChangeNotifier {
// Filter label lessons #128
today = today
.where((lesson) =>
- lesson.status?.name != "Elmaradt" &&
- lesson.subject.id != '' &&
- !lesson.isEmpty)
+ lesson.status?.name != "Elmaradt" &&
+ lesson.subject.id != '' &&
+ !lesson.isEmpty)
.toList();
if (today.isNotEmpty) {
@@ -263,7 +263,7 @@ class LiveCardProvider extends ChangeNotifier {
today.sort((a, b) => a.start.compareTo(b.start));
final _lesson = today.firstWhere(
- (l) => l.start.isBefore(now) && l.end.isAfter(now),
+ (l) => l.start.isBefore(now) && l.end.isAfter(now),
orElse: () => Lesson.fromJson({}));
if (_lesson.start.year != 0) {
@@ -328,7 +328,7 @@ class LiveCardProvider extends ChangeNotifier {
hasActivityStarted = true;
} else if (!hasActivityStarted &&
((currentState == LiveCardState.duringLesson &&
- currentLesson != null) ||
+ currentLesson != null) ||
currentState == LiveCardState.duringBreak)) {
debugPrint("Óra van, vagy szünet, de nincs LiveActivity. létrehozás...");
PlatformChannel.createLiveActivity(toMap());
@@ -362,7 +362,12 @@ class LiveCardProvider extends ChangeNotifier {
}
//END
- if (hasActivityStarted &&
+ if ((currentState == LiveCardState.afternoon || currentState == LiveCardState.morning || currentState == LiveCardState.night) && hasActivityStarted && nextLesson != null &&
+ nextLesson!.start.difference(now).inMinutes > 60) {
+ debugPrint("Több, mint 1 óra van az első óráig. Befejezés...");
+ PlatformChannel.endLiveActivity();
+ hasActivityStarted = false;
+ } else if (hasActivityStarted &&
!hasDayEnd &&
nextLesson == null &&
now.isAfter(prevLesson!.end)) {
@@ -384,4 +389,4 @@ class LiveCardProvider extends ChangeNotifier {
List _today(TimetableProvider p) => (p.getWeek(Week.current()) ?? [])
.where((l) => _sameDate(l.date, _now()))
.toList();
-}
+}
\ No newline at end of file
diff --git a/refilc/lib/api/providers/self_note_provider.dart b/refilc/lib/api/providers/self_note_provider.dart
index 3a095b7..4be70a5 100644
--- a/refilc/lib/api/providers/self_note_provider.dart
+++ b/refilc/lib/api/providers/self_note_provider.dart
@@ -7,17 +7,23 @@ import 'package:provider/provider.dart';
class SelfNoteProvider with ChangeNotifier {
late List _notes;
+ late List _todoItems;
late BuildContext _context;
+
List get notes => _notes;
+ List get todos => _todoItems;
SelfNoteProvider({
List initialNotes = const [],
+ List initialTodoItems = const [],
required BuildContext context,
}) {
_notes = List.castFrom(initialNotes);
+ _todoItems = List.castFrom(initialTodoItems);
_context = context;
if (_notes.isEmpty) restore();
+ if (_todoItems.isEmpty) restoreTodo();
}
// restore self notes from db
@@ -38,6 +44,24 @@ class SelfNoteProvider with ChangeNotifier {
}
}
+ // restore todo items from db
+ Future restoreTodo() async {
+ String? userId = Provider.of(_context, listen: false).id;
+
+ // await Provider.of(_context, listen: false)
+ // .userStore
+ // .storeSelfNotes([], userId: userId!);
+
+ // load self notes from db
+ if (userId != null) {
+ var dbTodo = await Provider.of(_context, listen: false)
+ .userQuery
+ .getTodoItems(userId: userId);
+ _todoItems = dbTodo;
+ notifyListeners();
+ }
+ }
+
// fetches fresh data from api (not needed, cuz no api for that)
// Future fetch() async {
// }
@@ -54,4 +78,17 @@ class SelfNoteProvider with ChangeNotifier {
_notes = notes;
notifyListeners();
}
+
+ // store todo items in db
+ Future storeTodo(List todos) async {
+ User? user = Provider.of(_context, listen: false).user;
+ if (user == null) throw "Cannot store Self Notes for User null";
+ String userId = user.id;
+
+ await Provider.of(_context, listen: false)
+ .userStore
+ .storeSelfTodoItems(todos, userId: userId);
+ _todoItems = todos;
+ notifyListeners();
+ }
}
diff --git a/refilc/lib/api/providers/user_provider.dart b/refilc/lib/api/providers/user_provider.dart
index a71028c..8d4bc89 100644
--- a/refilc/lib/api/providers/user_provider.dart
+++ b/refilc/lib/api/providers/user_provider.dart
@@ -23,6 +23,7 @@ class UserProvider with ChangeNotifier {
String? get nickname => user?.nickname;
String get picture => user?.picture ?? "";
String? get displayName => user?.displayName;
+ int? get gradeStreak => user?.gradeStreak;
final SettingsProvider _settings;
diff --git a/refilc/lib/database/init.dart b/refilc/lib/database/init.dart
index 23960a9..a8c820d 100644
--- a/refilc/lib/database/init.dart
+++ b/refilc/lib/database/init.dart
@@ -45,6 +45,7 @@ const settingsDB = DatabaseStruct("settings", {
// more
"show_breaks": int,
"font_family": String,
+ "title_only_font": int,
"plus_session_id": String,
"cal_sync_room_location": String, "cal_sync_show_exams": int,
"cal_sync_show_teacher": int, "cal_sync_renamed": int,
@@ -52,6 +53,7 @@ const settingsDB = DatabaseStruct("settings", {
"nav_shadow": int,
"new_colors": int,
"uwu_mode": int,
+ "new_popups": int,
// quick settings
"q_timetable_lesson_num": int, "q_timetable_sub_tiles": int,
"q_subjects_sub_tiles": int,
@@ -61,7 +63,8 @@ const settingsDB = DatabaseStruct("settings", {
const usersDB = DatabaseStruct("users", {
"id": String, "name": String, "username": String, "password": String,
"institute_code": String, "student": String, "role": int,
- "nickname": String, "picture": String // premium only
+ "nickname": String, "picture": String, // premium only (it's now plus btw)
+ "grade_streak": int,
});
const userDataDB = DatabaseStruct("user_data", {
"id": String, "grades": String, "timetable": String, "exams": String,
@@ -84,12 +87,13 @@ const userDataDB = DatabaseStruct("user_data", {
"goal_befores": String,
"goal_pin_dates": String,
// todo and notes
- "todo_items": String, "self_notes": String,
+ "todo_items": String, "self_notes": String, "self_todo": String,
// v5 shit
"roundings": String,
"grade_rarities": String,
"linked_accounts": String,
"custom_lesson_desc": String,
+ "watch_data": String,
});
Future createTable(Database db, DatabaseStruct struct) =>
@@ -129,7 +133,12 @@ Future initDB(DatabaseProvider database) async {
await migrateDB(
db,
struct: usersDB,
- defaultValues: {"role": 0, "nickname": "", "picture": ""},
+ defaultValues: {
+ "role": 0,
+ "nickname": "",
+ "picture": "",
+ "grade_streak": 0
+ },
);
await migrateDB(db, struct: userDataDB, defaultValues: {
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]",
@@ -152,12 +161,13 @@ Future initDB(DatabaseProvider database) async {
"goal_befores": "{}",
"goal_pin_dates": "{}",
// todo and notes
- "todo_items": "{}", "self_notes": "[]",
+ "todo_items": "{}", "self_notes": "[]", "self_todo": "[]",
// v5 shit
"roundings": "{}",
"grade_rarities": "{}",
"linked_accounts": "[]",
"custom_lesson_desc": "{}",
+ "watch_data": "{}",
});
} catch (error) {
print("ERROR: migrateDB: $error");
diff --git a/refilc/lib/database/query.dart b/refilc/lib/database/query.dart
index e899e6d..741a253 100644
--- a/refilc/lib/database/query.dart
+++ b/refilc/lib/database/query.dart
@@ -317,6 +317,18 @@ class UserDatabaseQuery {
return selfNotes;
}
+ Future> getTodoItems({required String userId}) async {
+ List