forked from firka/student-legacy
fixed project problems (warnings)
This commit is contained in:
parent
9ea0085ddb
commit
917d6d01db
@ -17,7 +17,7 @@ import 'package:refilc_kreta_api/providers/grade_provider.dart';
|
|||||||
import 'package:refilc_kreta_api/providers/timetable_provider.dart';
|
import 'package:refilc_kreta_api/providers/timetable_provider.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
|
||||||
hide Message;
|
hide Message;
|
||||||
import 'package:i18n_extension/i18n_widget.dart';
|
import 'package:i18n_extension/i18n_extension.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:refilc_kreta_api/models/message.dart';
|
import 'package:refilc_kreta_api/models/message.dart';
|
||||||
|
|
||||||
@ -38,7 +38,6 @@ class NotificationsHelper {
|
|||||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||||
FlutterLocalNotificationsPlugin();
|
FlutterLocalNotificationsPlugin();
|
||||||
|
|
||||||
|
|
||||||
String dayTitle(DateTime date) {
|
String dayTitle(DateTime date) {
|
||||||
try {
|
try {
|
||||||
String dayTitle =
|
String dayTitle =
|
||||||
@ -65,25 +64,37 @@ class NotificationsHelper {
|
|||||||
// Process notifications for each user asynchronously
|
// Process notifications for each user asynchronously
|
||||||
await Future.forEach(users, (User user) async {
|
await Future.forEach(users, (User user) async {
|
||||||
// Create a new instance of userProvider for each user
|
// Create a new instance of userProvider for each user
|
||||||
UserProvider userProviderForUser = await database.query.getUsers(settingsProvider);
|
UserProvider userProviderForUser =
|
||||||
|
await database.query.getUsers(settingsProvider);
|
||||||
userProviderForUser.setUser(user.id);
|
userProviderForUser.setUser(user.id);
|
||||||
|
|
||||||
// Refresh kreta login for current user
|
// Refresh kreta login for current user
|
||||||
final status = StatusProvider();
|
final status = StatusProvider();
|
||||||
KretaClient kretaClientForUser = KretaClient(
|
KretaClient kretaClientForUser = KretaClient(
|
||||||
user: userProviderForUser, settings: settingsProvider, status: status);
|
user: userProviderForUser,
|
||||||
|
settings: settingsProvider,
|
||||||
|
status: status);
|
||||||
await kretaClientForUser.refreshLogin();
|
await kretaClientForUser.refreshLogin();
|
||||||
|
|
||||||
// Process notifications for current user
|
// Process notifications for current user
|
||||||
if (settingsProvider.notificationsGradesEnabled) await gradeNotification(userProviderForUser, kretaClientForUser);
|
if (settingsProvider.notificationsGradesEnabled) {
|
||||||
if (settingsProvider.notificationsAbsencesEnabled) await absenceNotification(userProviderForUser, kretaClientForUser);
|
await gradeNotification(userProviderForUser, kretaClientForUser);
|
||||||
if (settingsProvider.notificationsMessagesEnabled) await messageNotification(userProviderForUser, kretaClientForUser);
|
}
|
||||||
if (settingsProvider.notificationsLessonsEnabled) await lessonNotification(userProviderForUser, kretaClientForUser);
|
if (settingsProvider.notificationsAbsencesEnabled) {
|
||||||
|
await absenceNotification(userProviderForUser, kretaClientForUser);
|
||||||
|
}
|
||||||
|
if (settingsProvider.notificationsMessagesEnabled) {
|
||||||
|
await messageNotification(userProviderForUser, kretaClientForUser);
|
||||||
|
}
|
||||||
|
if (settingsProvider.notificationsLessonsEnabled) {
|
||||||
|
await lessonNotification(userProviderForUser, kretaClientForUser);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> gradeNotification(UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
Future<void> gradeNotification(
|
||||||
|
UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
||||||
// fetch grades
|
// fetch grades
|
||||||
GradeProvider gradeProvider = GradeProvider(
|
GradeProvider gradeProvider = GradeProvider(
|
||||||
settings: settingsProvider,
|
settings: settingsProvider,
|
||||||
@ -131,8 +142,7 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "grades"
|
payload: "grades");
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// multiple users are added, also display student name
|
// multiple users are added, also display student name
|
||||||
await flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.show(
|
||||||
@ -149,26 +159,27 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "grades"
|
payload: "grades");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// set grade seen status
|
// set grade seen status
|
||||||
database.userStore.storeLastSeen(DateTime.now(), userId: currentuserProvider.id!, category: LastSeenCategory.grade);
|
database.userStore.storeLastSeen(DateTime.now(),
|
||||||
|
userId: currentuserProvider.id!, category: LastSeenCategory.grade);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> absenceNotification(UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
Future<void> absenceNotification(
|
||||||
|
UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
||||||
// get absences from api
|
// get absences from api
|
||||||
List? absenceJson = await currentKretaClient
|
List? absenceJson = await currentKretaClient
|
||||||
.getAPI(KretaAPI.absences(currentuserProvider.instituteCode ?? ""));
|
.getAPI(KretaAPI.absences(currentuserProvider.instituteCode ?? ""));
|
||||||
if (absenceJson == null) {
|
if (absenceJson == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DateTime lastSeenAbsence = await database.userQuery
|
DateTime lastSeenAbsence = await database.userQuery.lastSeen(
|
||||||
.lastSeen(userId: currentuserProvider.id!, category: LastSeenCategory.absence);
|
userId: currentuserProvider.id!, category: LastSeenCategory.absence);
|
||||||
// format api absences
|
// format api absences
|
||||||
List<Absence> absences =
|
List<Absence> absences =
|
||||||
absenceJson.map((e) => Absence.fromJson(e)).toList();
|
absenceJson.map((e) => Absence.fromJson(e)).toList();
|
||||||
@ -201,8 +212,7 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "absences"
|
payload: "absences");
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
await flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.show(
|
||||||
absence.id.hashCode,
|
absence.id.hashCode,
|
||||||
@ -219,8 +229,7 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "absences"
|
payload: "absences");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -228,7 +237,8 @@ class NotificationsHelper {
|
|||||||
userId: currentuserProvider.id!, category: LastSeenCategory.absence);
|
userId: currentuserProvider.id!, category: LastSeenCategory.absence);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> messageNotification(UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
Future<void> messageNotification(
|
||||||
|
UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
||||||
// get messages from api
|
// get messages from api
|
||||||
List? messageJson =
|
List? messageJson =
|
||||||
await currentKretaClient.getAPI(KretaAPI.messages("beerkezett"));
|
await currentKretaClient.getAPI(KretaAPI.messages("beerkezett"));
|
||||||
@ -245,8 +255,8 @@ class NotificationsHelper {
|
|||||||
.getAPI(KretaAPI.message(message["azonosito"].toString()));
|
.getAPI(KretaAPI.message(message["azonosito"].toString()));
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
if (innerMessageJson != null) {
|
if (innerMessageJson != null) {
|
||||||
messages.add(Message.fromJson(innerMessageJson,
|
messages.add(
|
||||||
forceType: MessageType.inbox));
|
Message.fromJson(innerMessageJson, forceType: MessageType.inbox));
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
}));
|
}));
|
||||||
@ -291,21 +301,25 @@ class NotificationsHelper {
|
|||||||
userId: currentuserProvider.id!, category: LastSeenCategory.message);
|
userId: currentuserProvider.id!, category: LastSeenCategory.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> lessonNotification(UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
Future<void> lessonNotification(
|
||||||
|
UserProvider currentuserProvider, KretaClient currentKretaClient) async {
|
||||||
// get lessons from api
|
// get lessons from api
|
||||||
TimetableProvider timetableProvider = TimetableProvider(
|
TimetableProvider timetableProvider = TimetableProvider(
|
||||||
user: currentuserProvider, database: database, kreta: currentKretaClient);
|
user: currentuserProvider,
|
||||||
|
database: database,
|
||||||
|
kreta: currentKretaClient);
|
||||||
await timetableProvider.restoreUser();
|
await timetableProvider.restoreUser();
|
||||||
await timetableProvider.fetch(week: Week.current());
|
await timetableProvider.fetch(week: Week.current());
|
||||||
List<Lesson> apilessons =
|
List<Lesson> apilessons = timetableProvider.getWeek(Week.current()) ?? [];
|
||||||
timetableProvider.getWeek(Week.current()) ?? [];
|
|
||||||
|
|
||||||
DateTime lastSeenLesson = await database.userQuery.lastSeen(
|
DateTime lastSeenLesson = await database.userQuery.lastSeen(
|
||||||
userId: currentuserProvider.id!, category: LastSeenCategory.lesson);
|
userId: currentuserProvider.id!, category: LastSeenCategory.lesson);
|
||||||
Lesson? latestLesson;
|
Lesson? latestLesson;
|
||||||
|
|
||||||
for (Lesson lesson in apilessons) {
|
for (Lesson lesson in apilessons) {
|
||||||
if((lesson.status?.name != "Elmaradt" || lesson.substituteTeacher?.name != "") && lesson.date.isAfter(latestLesson?.start ?? DateTime(1970))) {
|
if ((lesson.status?.name != "Elmaradt" ||
|
||||||
|
lesson.substituteTeacher?.name != "") &&
|
||||||
|
lesson.date.isAfter(latestLesson?.start ?? DateTime(1970))) {
|
||||||
latestLesson = lesson;
|
latestLesson = lesson;
|
||||||
}
|
}
|
||||||
if (lesson.date.isAfter(lastSeenLesson)) {
|
if (lesson.date.isAfter(lastSeenLesson)) {
|
||||||
@ -313,8 +327,7 @@ class NotificationsHelper {
|
|||||||
AndroidNotificationDetails(
|
AndroidNotificationDetails(
|
||||||
'LESSONS',
|
'LESSONS',
|
||||||
'Órák',
|
'Órák',
|
||||||
channelDescription:
|
channelDescription: 'Értesítés órák elmaradásáról, helyettesítésről',
|
||||||
'Értesítés órák elmaradásáról, helyettesítésről',
|
|
||||||
importance: Importance.max,
|
importance: Importance.max,
|
||||||
priority: Priority.max,
|
priority: Priority.max,
|
||||||
color: settingsProvider.customAccentColor,
|
color: settingsProvider.customAccentColor,
|
||||||
@ -338,8 +351,7 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "timetable"
|
payload: "timetable");
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "hu_hu":
|
case "hu_hu":
|
||||||
@ -355,8 +367,7 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "timetable"
|
payload: "timetable");
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -372,12 +383,12 @@ class NotificationsHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
notificationDetails,
|
notificationDetails,
|
||||||
payload: "timetable"
|
payload: "timetable");
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (lesson.substituteTeacher?.name != "" && lesson.substituteTeacher != null) {
|
} else if (lesson.substituteTeacher?.name != "" &&
|
||||||
|
lesson.substituteTeacher != null) {
|
||||||
switch (I18n.localeStr) {
|
switch (I18n.localeStr) {
|
||||||
case "en_en":
|
case "en_en":
|
||||||
{
|
{
|
||||||
@ -570,17 +581,20 @@ class NotificationsHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// lesson.date does not contain time, only the date
|
// lesson.date does not contain time, only the date
|
||||||
await database.userStore.storeLastSeen(latestLesson?.start ?? DateTime.now(),
|
await database.userStore.storeLastSeen(
|
||||||
userId: currentuserProvider.id!, category: LastSeenCategory.lesson);
|
latestLesson?.start ?? DateTime.now(),
|
||||||
|
userId: currentuserProvider.id!,
|
||||||
|
category: LastSeenCategory.lesson);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the user taps a notification
|
// Called when the user taps a notification
|
||||||
void onDidReceiveNotificationResponse(NotificationResponse notificationResponse) async {
|
void onDidReceiveNotificationResponse(
|
||||||
|
NotificationResponse notificationResponse) async {
|
||||||
final String? payload = notificationResponse.payload;
|
final String? payload = notificationResponse.payload;
|
||||||
if (notificationResponse.payload != null) {
|
if (notificationResponse.payload != null) {
|
||||||
debugPrint('notification payload: $payload');
|
debugPrint('notification payload: $payload');
|
||||||
}
|
}
|
||||||
switch(payload) {
|
switch (payload) {
|
||||||
case "timetable":
|
case "timetable":
|
||||||
locator<NavigationService>().navigateTo("timetable");
|
locator<NavigationService>().navigateTo("timetable");
|
||||||
break;
|
break;
|
||||||
@ -603,10 +617,11 @@ class NotificationsHelper {
|
|||||||
|
|
||||||
// Set all notification categories to seen
|
// Set all notification categories to seen
|
||||||
Future<void> setAllCategoriesSeen(UserProvider userProvider) async {
|
Future<void> setAllCategoriesSeen(UserProvider userProvider) async {
|
||||||
if(userProvider.id != null) {
|
if (userProvider.id != null) {
|
||||||
for(LastSeenCategory category in LastSeenCategory.values) {
|
for (LastSeenCategory category in LastSeenCategory.values) {
|
||||||
await database.userStore.storeLastSeen(DateTime.now(), userId: userProvider.id!, category: category);
|
await database.userStore.storeLastSeen(DateTime.now(),
|
||||||
}
|
userId: userProvider.id!, category: category);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -8,6 +8,7 @@ class ShareHelper {
|
|||||||
Share.share(text, subject: subject);
|
Share.share(text, subject: subject);
|
||||||
// ignore: deprecated_member_use
|
// ignore: deprecated_member_use
|
||||||
static Future<void> shareFile(String path, {String? text, String? subject}) =>
|
static Future<void> shareFile(String path, {String? text, String? subject}) =>
|
||||||
|
// ignore: deprecated_member_use
|
||||||
Share.shareFiles([path], text: text, subject: subject);
|
Share.shareFiles([path], text: text, subject: subject);
|
||||||
|
|
||||||
static Future<void> shareAttachment(Attachment attachment,
|
static Future<void> shareAttachment(Attachment attachment,
|
||||||
|
@ -10,7 +10,6 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:refilc/app.dart';
|
import 'package:refilc/app.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:refilc/utils/navigation_service.dart';
|
|
||||||
import 'package:refilc/utils/service_locator.dart';
|
import 'package:refilc/utils/service_locator.dart';
|
||||||
import 'package:refilc_mobile_ui/screens/error_screen.dart';
|
import 'package:refilc_mobile_ui/screens/error_screen.dart';
|
||||||
import 'package:refilc_mobile_ui/screens/error_report_screen.dart';
|
import 'package:refilc_mobile_ui/screens/error_report_screen.dart';
|
||||||
@ -36,9 +35,8 @@ void main() async {
|
|||||||
ErrorWidget.builder = errorBuilder;
|
ErrorWidget.builder = errorBuilder;
|
||||||
|
|
||||||
// initialize stripe key
|
// initialize stripe key
|
||||||
stripe.Stripe.publishableKey =
|
// stripe.Stripe.publishableKey =
|
||||||
'pk_test_51Oo7iUBS0FxsTGxKjGZSQqzDKWHY5ZFYM9XeI0qSdIh2w8jWy6GhHlYpT7GLTzgpl1xhE5YP4BXpA4gMZqPmgMId00cGFYFzbh';
|
// 'pk_test_51Oo7iUBS0FxsTGxKjGZSQqzDKWHY5ZFYM9XeI0qSdIh2w8jWy6GhHlYpT7GLTzgpl1xhE5YP4BXpA4gMZqPmgMId00cGFYFzbh';
|
||||||
|
|
||||||
|
|
||||||
BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask);
|
BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask);
|
||||||
|
|
||||||
@ -126,7 +124,8 @@ class Startup {
|
|||||||
// Initialize notifications
|
// Initialize notifications
|
||||||
await flutterLocalNotificationsPlugin.initialize(
|
await flutterLocalNotificationsPlugin.initialize(
|
||||||
initializationSettings,
|
initializationSettings,
|
||||||
onDidReceiveNotificationResponse: NotificationsHelper().onDidReceiveNotificationResponse,
|
onDidReceiveNotificationResponse:
|
||||||
|
NotificationsHelper().onDidReceiveNotificationResponse,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,11 +138,15 @@ class ThirdPartyProvider with ChangeNotifier {
|
|||||||
|
|
||||||
_googleCalendars = (await calendarApi.calendarList.list()).items ?? [];
|
_googleCalendars = (await calendarApi.calendarList.list()).items ?? [];
|
||||||
|
|
||||||
|
if (kDebugMode) {
|
||||||
print(_googleCalendars);
|
print(_googleCalendars);
|
||||||
|
}
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (kDebugMode) {
|
||||||
print(e);
|
print(e);
|
||||||
|
}
|
||||||
// await _googleSignIn.signOut();
|
// await _googleSignIn.signOut();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,14 +46,16 @@ extension DateFormatUtils on DateTime {
|
|||||||
|
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
if (now.year == year && now.month == month && now.day == day) {
|
if (now.year == year && now.month == month && now.day == day) {
|
||||||
if (hour == 0 && minute == 0 && second == 0 || forceToday)
|
if (hour == 0 && minute == 0 && second == 0 || forceToday) {
|
||||||
return "Today".i18n;
|
return "Today".i18n;
|
||||||
|
}
|
||||||
return DateFormat("HH:mm").format(this);
|
return DateFormat("HH:mm").format(this);
|
||||||
}
|
}
|
||||||
if (now.year == year &&
|
if (now.year == year &&
|
||||||
now.month == month &&
|
now.month == month &&
|
||||||
now.subtract(const Duration(days: 1)).day == day)
|
now.subtract(const Duration(days: 1)).day == day) {
|
||||||
return "Yesterday".i18n;
|
return "Yesterday".i18n;
|
||||||
|
}
|
||||||
if (now.year == year &&
|
if (now.year == year &&
|
||||||
now.month == month &&
|
now.month == month &&
|
||||||
now.add(const Duration(days: 1)).day == day) return "Tomorrow".i18n;
|
now.add(const Duration(days: 1)).day == day) return "Tomorrow".i18n;
|
||||||
|
@ -3,15 +3,14 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class FilterBar extends StatelessWidget implements PreferredSizeWidget {
|
class FilterBar extends StatelessWidget 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,
|
||||||
this.padding = const EdgeInsets.symmetric(horizontal: 24.0),
|
this.padding = const EdgeInsets.symmetric(horizontal: 24.0),
|
||||||
this.disableFading = false,
|
this.disableFading = false,
|
||||||
this.scrollable = true,
|
this.scrollable = true,
|
||||||
}) : assert(items.length == controller.length),
|
}) : assert(items.length == controller.length);
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
final List<Widget> items;
|
final List<Widget> items;
|
||||||
final TabController controller;
|
final TabController controller;
|
||||||
|
@ -3,14 +3,14 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class PanelButton extends StatelessWidget {
|
class PanelButton extends StatelessWidget {
|
||||||
const PanelButton({
|
const PanelButton({
|
||||||
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,
|
||||||
this.trailingDivider = false,
|
this.trailingDivider = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final void Function()? onPressed;
|
final void Function()? onPressed;
|
||||||
final EdgeInsetsGeometry padding;
|
final EdgeInsetsGeometry padding;
|
||||||
|
@ -5,12 +5,12 @@ import 'package:refilc/theme/colors/colors.dart';
|
|||||||
|
|
||||||
class ProfileImage extends StatelessWidget {
|
class ProfileImage extends StatelessWidget {
|
||||||
const ProfileImage({
|
const ProfileImage({
|
||||||
Key? key,
|
super.key,
|
||||||
this.name,
|
this.name,
|
||||||
this.radius = 20.0,
|
this.radius = 20.0,
|
||||||
this.role = Role.student,
|
this.role = Role.student,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final String? name;
|
final String? name;
|
||||||
final double radius;
|
final double radius;
|
||||||
|
@ -3,7 +3,7 @@ import 'package:refilc_kreta_api/models/grade.dart';
|
|||||||
import 'package:refilc/ui/widgets/grade/grade_tile.dart';
|
import 'package:refilc/ui/widgets/grade/grade_tile.dart';
|
||||||
|
|
||||||
class GradeViewable extends StatelessWidget {
|
class GradeViewable extends StatelessWidget {
|
||||||
const GradeViewable(this.grade, {Key? key}) : super(key: key);
|
const GradeViewable(this.grade, {super.key});
|
||||||
|
|
||||||
final Grade grade;
|
final Grade grade;
|
||||||
|
|
||||||
|
@ -3,8 +3,7 @@ import 'package:refilc/ui/widgets/lesson/lesson_tile.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class LessonViewable extends StatelessWidget {
|
class LessonViewable extends StatelessWidget {
|
||||||
const LessonViewable(this.lesson, {Key? key, this.swapDesc = false})
|
const LessonViewable(this.lesson, {super.key, this.swapDesc = false});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final Lesson lesson;
|
final Lesson lesson;
|
||||||
final bool swapDesc;
|
final bool swapDesc;
|
||||||
|
@ -40,13 +40,13 @@ class SubjectAbsence {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AbsencesPage extends StatefulWidget {
|
class AbsencesPage extends StatefulWidget {
|
||||||
const AbsencesPage({Key? key}) : super(key: key);
|
const AbsencesPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_AbsencesPageState createState() => _AbsencesPageState();
|
AbsencesPageState createState() => AbsencesPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AbsencesPageState extends State<AbsencesPage>
|
class AbsencesPageState extends State<AbsencesPage>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late UserProvider user;
|
late UserProvider user;
|
||||||
late AbsenceProvider absenceProvider;
|
late AbsenceProvider absenceProvider;
|
||||||
@ -87,6 +87,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void buildSubjectAbsences() {
|
void buildSubjectAbsences() {
|
||||||
|
// ignore: no_leading_underscores_for_local_identifiers
|
||||||
Map<GradeSubject, SubjectAbsence> _absences = {};
|
Map<GradeSubject, SubjectAbsence> _absences = {};
|
||||||
|
|
||||||
for (final absence in absenceProvider.absences) {
|
for (final absence in absenceProvider.absences) {
|
||||||
@ -284,10 +285,10 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
Animation<double> secondaryAnimation,
|
Animation<double> secondaryAnimation,
|
||||||
) {
|
) {
|
||||||
return FadeThroughTransition(
|
return FadeThroughTransition(
|
||||||
child: child,
|
|
||||||
animation: primaryAnimation,
|
animation: primaryAnimation,
|
||||||
secondaryAnimation: secondaryAnimation,
|
secondaryAnimation: secondaryAnimation,
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
fillColor: Theme.of(context).colorScheme.background,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -335,7 +336,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
.length;
|
.length;
|
||||||
title1 = "stat_1".i18n;
|
title1 = "stat_1".i18n;
|
||||||
title2 = "stat_2".i18n;
|
title2 = "stat_2".i18n;
|
||||||
suffix = " " + "hr".i18n;
|
suffix = " ${"hr".i18n}";
|
||||||
} else if (activeData == AbsenceFilter.delays.index) {
|
} else if (activeData == AbsenceFilter.delays.index) {
|
||||||
value1 = absenceProvider.absences
|
value1 = absenceProvider.absences
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
@ -349,7 +350,7 @@ class _AbsencesPageState extends State<AbsencesPage>
|
|||||||
.fold(0, (a, b) => a + b);
|
.fold(0, (a, b) => a + b);
|
||||||
title1 = "stat_3".i18n;
|
title1 = "stat_3".i18n;
|
||||||
title2 = "stat_4".i18n;
|
title2 = "stat_4".i18n;
|
||||||
suffix = " " + "min".i18n;
|
suffix = " ${"min".i18n}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
|
@ -30,8 +30,7 @@ import 'grades_page.i18n.dart';
|
|||||||
//import 'package:refilc_plus/ui/mobile/goal_planner/new_goal.dart';
|
//import 'package:refilc_plus/ui/mobile/goal_planner/new_goal.dart';
|
||||||
|
|
||||||
class GradeSubjectView extends StatefulWidget {
|
class GradeSubjectView extends StatefulWidget {
|
||||||
const GradeSubjectView(this.subject, {Key? key, this.groupAverage = 0.0})
|
const GradeSubjectView(this.subject, {super.key, this.groupAverage = 0.0});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final GradeSubject subject;
|
final GradeSubject subject;
|
||||||
final double groupAverage;
|
final double groupAverage;
|
||||||
@ -90,6 +89,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
tiles.add(Container(height: 24.0));
|
tiles.add(Container(height: 24.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore: no_leading_underscores_for_local_identifiers
|
||||||
List<Widget> _gradeTiles = [];
|
List<Widget> _gradeTiles = [];
|
||||||
|
|
||||||
if (!gradeCalcMode) {
|
if (!gradeCalcMode) {
|
||||||
@ -118,8 +118,8 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
animation: primaryAnimation,
|
animation: primaryAnimation,
|
||||||
secondaryAnimation: secondaryAnimation,
|
secondaryAnimation: secondaryAnimation,
|
||||||
transitionType: SharedAxisTransitionType.vertical,
|
transitionType: SharedAxisTransitionType.vertical,
|
||||||
child: child,
|
|
||||||
fillColor: Colors.transparent,
|
fillColor: Colors.transparent,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: _gradeTiles.isNotEmpty
|
child: _gradeTiles.isNotEmpty
|
||||||
@ -273,7 +273,8 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
|
|
||||||
_sheetController = _scaffoldKey.currentState?.showBottomSheet(
|
_sheetController = _scaffoldKey.currentState?.showBottomSheet(
|
||||||
(context) => RoundedBottomSheet(
|
(context) => RoundedBottomSheet(
|
||||||
child: GradeCalculator(widget.subject), borderRadius: 14.0),
|
borderRadius: 14.0,
|
||||||
|
child: GradeCalculator(widget.subject)),
|
||||||
backgroundColor: const Color(0x00000000),
|
backgroundColor: const Color(0x00000000),
|
||||||
elevation: 12.0,
|
elevation: 12.0,
|
||||||
);
|
);
|
||||||
|
@ -4,7 +4,7 @@ import 'package:refilc_desktop_ui/pages/grades/grades_count_item.dart';
|
|||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
|
||||||
class GradesCount extends StatelessWidget {
|
class GradesCount extends StatelessWidget {
|
||||||
const GradesCount({Key? key, required this.grades}) : super(key: key);
|
const GradesCount({super.key, required this.grades});
|
||||||
|
|
||||||
final List<Grade> grades;
|
final List<Grade> grades;
|
||||||
|
|
||||||
|
@ -3,8 +3,7 @@ import 'package:refilc_kreta_api/models/grade.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class GradesCountItem extends StatelessWidget {
|
class GradesCountItem extends StatelessWidget {
|
||||||
const GradesCountItem({Key? key, required this.count, required this.value})
|
const GradesCountItem({super.key, required this.count, required this.value});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final int count;
|
final int count;
|
||||||
final int value;
|
final int value;
|
||||||
|
@ -25,13 +25,13 @@ import 'package:refilc_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 {
|
||||||
const GradesPage({Key? key}) : super(key: key);
|
const GradesPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_GradesPageState createState() => _GradesPageState();
|
GradesPageState createState() => GradesPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _GradesPageState extends State<GradesPage> {
|
class GradesPageState extends State<GradesPage> {
|
||||||
late UserProvider user;
|
late UserProvider user;
|
||||||
late GradeProvider gradeProvider;
|
late GradeProvider gradeProvider;
|
||||||
late UpdateProvider updateProvider;
|
late UpdateProvider updateProvider;
|
||||||
@ -294,8 +294,8 @@ class _GradesPageState extends State<GradesPage> {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: panelPadding,
|
padding: panelPadding,
|
||||||
child: PanelBody(
|
child: PanelBody(
|
||||||
child: subjectTiles[index],
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
|
child: subjectTiles[index],
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
return Padding(
|
return Padding(
|
||||||
|
@ -10,7 +10,7 @@ import 'package:refilc/ui/filter/sort.dart';
|
|||||||
import 'home_page.i18n.dart';
|
import 'home_page.i18n.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
const HomePage({Key? key}) : super(key: key);
|
const HomePage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HomePage> createState() => _HomePageState();
|
State<HomePage> createState() => _HomePageState();
|
||||||
|
@ -15,13 +15,13 @@ import 'package:provider/provider.dart';
|
|||||||
import 'messages_page.i18n.dart';
|
import 'messages_page.i18n.dart';
|
||||||
|
|
||||||
class MessagesPage extends StatefulWidget {
|
class MessagesPage extends StatefulWidget {
|
||||||
const MessagesPage({Key? key}) : super(key: key);
|
const MessagesPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MessagesPageState createState() => _MessagesPageState();
|
MessagesPageState createState() => MessagesPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MessagesPageState extends State<MessagesPage>
|
class MessagesPageState extends State<MessagesPage>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late UserProvider user;
|
late UserProvider user;
|
||||||
late MessageProvider messageProvider;
|
late MessageProvider messageProvider;
|
||||||
|
@ -23,8 +23,7 @@ import 'timetable_page.i18n.dart';
|
|||||||
// todo: "fix" overflow (priority: -1)
|
// todo: "fix" overflow (priority: -1)
|
||||||
|
|
||||||
class TimetablePage extends StatefulWidget {
|
class TimetablePage extends StatefulWidget {
|
||||||
const TimetablePage({Key? key, this.initialDay, this.initialWeek})
|
const TimetablePage({super.key, this.initialDay, this.initialWeek});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final DateTime? initialDay;
|
final DateTime? initialDay;
|
||||||
final Week? initialWeek;
|
final Week? initialWeek;
|
||||||
@ -48,10 +47,10 @@ class TimetablePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_TimetablePageState createState() => _TimetablePageState();
|
TimetablePageState createState() => TimetablePageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TimetablePageState extends State<TimetablePage>
|
class TimetablePageState extends State<TimetablePage>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late UserProvider user;
|
late UserProvider user;
|
||||||
late TimetableProvider timetableProvider;
|
late TimetableProvider timetableProvider;
|
||||||
@ -170,10 +169,10 @@ class _TimetablePageState extends State<TimetablePage>
|
|||||||
Animation<double> secondaryAnimation,
|
Animation<double> secondaryAnimation,
|
||||||
) {
|
) {
|
||||||
return FadeThroughTransition(
|
return FadeThroughTransition(
|
||||||
child: child,
|
|
||||||
animation: primaryAnimation,
|
animation: primaryAnimation,
|
||||||
secondaryAnimation: secondaryAnimation,
|
secondaryAnimation: secondaryAnimation,
|
||||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: _controller.days != null
|
child: _controller.days != null
|
||||||
@ -208,9 +207,8 @@ class _TimetablePageState extends State<TimetablePage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${_controller.days![tab].first.date.day}"
|
"${"${_controller.days![tab].first.date.day}"
|
||||||
.padLeft(2, '0') +
|
.padLeft(2, '0')}.",
|
||||||
".",
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.of(context)
|
color: AppColors.of(context)
|
||||||
.text
|
.text
|
||||||
@ -338,29 +336,19 @@ class _TimetablePageState extends State<TimetablePage>
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
"${_controller.currentWeekId + 1}. " +
|
"${_controller.currentWeekId + 1}. ${"week".i18n} (${DateFormat(
|
||||||
"week".i18n +
|
"${_controller.currentWeek.start.year !=
|
||||||
" (" +
|
|
||||||
// Week start
|
|
||||||
DateFormat(
|
|
||||||
(_controller.currentWeek.start.year !=
|
|
||||||
DateTime.now().year
|
DateTime.now().year
|
||||||
? "yy. "
|
? "yy. "
|
||||||
: "") +
|
: ""}MMM d.",
|
||||||
"MMM d.",
|
|
||||||
I18n.of(context).locale.languageCode)
|
I18n.of(context).locale.languageCode)
|
||||||
.format(_controller.currentWeek.start) +
|
.format(_controller.currentWeek.start)} - ${DateFormat(
|
||||||
" - " +
|
"${_controller.currentWeek.start.year !=
|
||||||
// Week end
|
|
||||||
DateFormat(
|
|
||||||
(_controller.currentWeek.start.year !=
|
|
||||||
DateTime.now().year
|
DateTime.now().year
|
||||||
? "yy. "
|
? "yy. "
|
||||||
: "") +
|
: ""}MMM d.",
|
||||||
"MMM d.",
|
|
||||||
I18n.of(context).locale.languageCode)
|
I18n.of(context).locale.languageCode)
|
||||||
.format(_controller.currentWeek.end) +
|
.format(_controller.currentWeek.end)})",
|
||||||
")",
|
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
|
@ -25,15 +25,15 @@ const LinearGradient _backgroundGradient = LinearGradient(
|
|||||||
);
|
);
|
||||||
|
|
||||||
class LoginScreen extends StatefulWidget {
|
class LoginScreen extends StatefulWidget {
|
||||||
const LoginScreen({Key? key, this.back = false}) : super(key: key);
|
const LoginScreen({super.key, this.back = false});
|
||||||
|
|
||||||
final bool back;
|
final bool back;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_LoginScreenState createState() => _LoginScreenState();
|
LoginScreenState createState() => LoginScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
@ -118,10 +118,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: Opacity(
|
child: Opacity(
|
||||||
|
opacity: 0.3,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
"assets/icons/ic_splash.png",
|
"assets/icons/ic_splash.png",
|
||||||
color: Colors.black),
|
color: Colors.black)),
|
||||||
opacity: 0.3),
|
|
||||||
),
|
),
|
||||||
BackdropFilter(
|
BackdropFilter(
|
||||||
filter: ImageFilter.blur(
|
filter: ImageFilter.blur(
|
||||||
@ -253,15 +253,6 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 42.0),
|
padding: const EdgeInsets.only(top: 42.0),
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
child: LoginButton(
|
|
||||||
child: Text("login".i18n,
|
|
||||||
maxLines: 1,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontSize: 15.0,
|
|
||||||
)),
|
|
||||||
onPressed: () => _loginAPI(context: context),
|
|
||||||
),
|
|
||||||
visible: _loginState != LoginState.inProgress,
|
visible: _loginState != LoginState.inProgress,
|
||||||
replacement: const Padding(
|
replacement: const Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 6.0),
|
padding: EdgeInsets.symmetric(vertical: 6.0),
|
||||||
@ -272,6 +263,15 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: LoginButton(
|
||||||
|
child: Text("login".i18n,
|
||||||
|
maxLines: 1,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 15.0,
|
||||||
|
)),
|
||||||
|
onPressed: () => _loginAPI(context: context),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -6,17 +6,16 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:refilc_kreta_api/models/school.dart';
|
import 'package:refilc_kreta_api/models/school.dart';
|
||||||
|
|
||||||
class SchoolInput extends StatefulWidget {
|
class SchoolInput extends StatefulWidget {
|
||||||
const SchoolInput({Key? key, required this.controller, required this.scroll})
|
const SchoolInput({super.key, required this.controller, required this.scroll});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final SchoolInputController controller;
|
final SchoolInputController controller;
|
||||||
final ScrollController scroll;
|
final ScrollController scroll;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_SchoolInputState createState() => _SchoolInputState();
|
SchoolInputState createState() => SchoolInputState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SchoolInputState extends State<SchoolInput> {
|
class SchoolInputState extends State<SchoolInput> {
|
||||||
final _focusNode = FocusNode();
|
final _focusNode = FocusNode();
|
||||||
final _layerLink = LayerLink();
|
final _layerLink = LayerLink();
|
||||||
late SchoolInputOverlay overlay;
|
late SchoolInputOverlay overlay;
|
||||||
|
@ -2,8 +2,7 @@ import 'package:refilc_kreta_api/models/school.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class SchoolInputTile extends StatelessWidget {
|
class SchoolInputTile extends StatelessWidget {
|
||||||
const SchoolInputTile({Key? key, required this.school, this.onTap})
|
const SchoolInputTile({super.key, required this.school, this.onTap});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final School school;
|
final School school;
|
||||||
final Function()? onTap;
|
final Function()? onTap;
|
||||||
|
@ -15,7 +15,7 @@ import 'package:refilc_kreta_api/client/client.dart';
|
|||||||
import 'package:refilc_plus/providers/goal_provider.dart';
|
import 'package:refilc_plus/providers/goal_provider.dart';
|
||||||
|
|
||||||
class NavigationScreen extends StatefulWidget {
|
class NavigationScreen extends StatefulWidget {
|
||||||
const NavigationScreen({Key? key}) : super(key: key);
|
const NavigationScreen({super.key});
|
||||||
|
|
||||||
static NavigationScreenState? of(BuildContext context) =>
|
static NavigationScreenState? of(BuildContext context) =>
|
||||||
context.findAncestorStateOfType<NavigationScreenState>();
|
context.findAncestorStateOfType<NavigationScreenState>();
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
import 'package:refilc/api/providers/database_provider.dart';
|
import 'package:refilc/api/providers/database_provider.dart';
|
||||||
import 'package:refilc/api/providers/user_provider.dart';
|
import 'package:refilc/api/providers/user_provider.dart';
|
||||||
@ -27,11 +29,10 @@ import 'package:refilc/theme/colors/colors.dart';
|
|||||||
|
|
||||||
class Sidebar extends StatefulWidget {
|
class Sidebar extends StatefulWidget {
|
||||||
const Sidebar(
|
const Sidebar(
|
||||||
{Key? key,
|
{super.key,
|
||||||
required this.navigator,
|
required this.navigator,
|
||||||
required this.onRouteChange,
|
required this.onRouteChange,
|
||||||
this.selected = "home"})
|
this.selected = "home"});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final NavigatorState navigator;
|
final NavigatorState navigator;
|
||||||
final String selected;
|
final String selected;
|
||||||
@ -183,6 +184,7 @@ class _SidebarState extends State<Sidebar> {
|
|||||||
|
|
||||||
// delete user from app
|
// delete user from app
|
||||||
user.removeUser(userId);
|
user.removeUser(userId);
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
await Provider.of<DatabaseProvider>(context, listen: false)
|
await Provider.of<DatabaseProvider>(context, listen: false)
|
||||||
.store
|
.store
|
||||||
.removeUser(userId);
|
.removeUser(userId);
|
||||||
@ -192,6 +194,7 @@ class _SidebarState extends State<Sidebar> {
|
|||||||
user.setUser(user.getUsers().first.id);
|
user.setUser(user.getUsers().first.id);
|
||||||
restore().then((_) => user.setUser(user.getUsers().first.id));
|
restore().then((_) => user.setUser(user.getUsers().first.id));
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
.pushNamedAndRemoveUntil("login", (_) => false);
|
.pushNamedAndRemoveUntil("login", (_) => false);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,7 @@ import 'package:refilc/theme/colors/colors.dart';
|
|||||||
|
|
||||||
class SidebarAction extends StatelessWidget {
|
class SidebarAction extends StatelessWidget {
|
||||||
const SidebarAction(
|
const SidebarAction(
|
||||||
{Key? key, this.title, this.icon, this.onTap, this.selected = false})
|
{super.key, this.title, this.icon, this.onTap, this.selected = false});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final bool selected;
|
final bool selected;
|
||||||
final Widget? icon;
|
final Widget? icon;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class NewsView extends StatelessWidget {
|
class NewsView extends StatelessWidget {
|
||||||
const NewsView({Key? key}) : super(key: key);
|
const NewsView({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
||||||
|
|
||||||
import 'package:refilc/api/providers/update_provider.dart';
|
import 'package:refilc/api/providers/update_provider.dart';
|
||||||
import 'package:refilc_kreta_api/providers/absence_provider.dart';
|
import 'package:refilc_kreta_api/providers/absence_provider.dart';
|
||||||
import 'package:refilc_kreta_api/providers/event_provider.dart';
|
import 'package:refilc_kreta_api/providers/event_provider.dart';
|
||||||
@ -41,13 +43,13 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:refilc_mobile_ui/screens/settings/user/nickname.dart';
|
import 'package:refilc_mobile_ui/screens/settings/user/nickname.dart';
|
||||||
|
|
||||||
class SettingsScreen extends StatefulWidget {
|
class SettingsScreen extends StatefulWidget {
|
||||||
const SettingsScreen({Key? key}) : super(key: key);
|
const SettingsScreen({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_SettingsScreenState createState() => _SettingsScreenState();
|
SettingsScreenState createState() => SettingsScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SettingsScreenState extends State<SettingsScreen>
|
class SettingsScreenState extends State<SettingsScreen>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
int devmodeCountdown = 3;
|
int devmodeCountdown = 3;
|
||||||
final bool __ss = false; // secret settings
|
final bool __ss = false; // secret settings
|
||||||
@ -506,6 +508,7 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await _hideContainersController
|
await _hideContainersController
|
||||||
.forward();
|
.forward();
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
SettingsHelper.accentColor(context);
|
SettingsHelper.accentColor(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
_hideContainersController.reset();
|
_hideContainersController.reset();
|
||||||
@ -915,9 +918,8 @@ class _SettingsScreenState extends State<SettingsScreen>
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: const Panel(
|
child: const Panel(
|
||||||
title: Text("v" +
|
title: Text("v${const String.fromEnvironment("APPVER",
|
||||||
String.fromEnvironment("APPVER",
|
defaultValue: "?")}")),
|
||||||
defaultValue: "?"))),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (devmodeCountdown > 0) {
|
if (devmodeCountdown > 0) {
|
||||||
ScaffoldMessenger.of(context)
|
ScaffoldMessenger.of(context)
|
||||||
|
@ -17,6 +17,9 @@ dependencies:
|
|||||||
# reFilc Plus
|
# reFilc Plus
|
||||||
refilc_plus:
|
refilc_plus:
|
||||||
path: ../refilc_plus/
|
path: ../refilc_plus/
|
||||||
|
# reFilc Mobile
|
||||||
|
refilc_mobile_ui:
|
||||||
|
path: ../refilc_mobile_ui/
|
||||||
|
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
flutter_feather_icons: ^2.0.0+1
|
flutter_feather_icons: ^2.0.0+1
|
||||||
@ -30,6 +33,12 @@ dependencies:
|
|||||||
flutter_acrylic: ^1.1.3
|
flutter_acrylic: ^1.1.3
|
||||||
elegant_notification: ^1.13.0
|
elegant_notification: ^1.13.0
|
||||||
flutter_staggered_grid_view: ^0.7.0
|
flutter_staggered_grid_view: ^0.7.0
|
||||||
|
i18n_extension: ^11.0.12
|
||||||
|
flutter_expandable_fab: ^2.0.0
|
||||||
|
collection: ^1.18.0
|
||||||
|
animated_list_plus: ^0.5.2
|
||||||
|
intl: ^0.18.1
|
||||||
|
flutter_custom_tabs: ^2.0.0+1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^3.0.1
|
flutter_lints: ^3.0.1
|
||||||
|
@ -50,7 +50,7 @@ class Absence {
|
|||||||
DateTime lessonStart;
|
DateTime lessonStart;
|
||||||
DateTime lessonEnd;
|
DateTime lessonEnd;
|
||||||
int? lessonIndex;
|
int? lessonIndex;
|
||||||
bool isSeen = json["isSeen"] ?? false;
|
// bool isSeen = json["isSeen"] ?? false;
|
||||||
if (json["Ora"] != null) {
|
if (json["Ora"] != null) {
|
||||||
lessonStart = json["Ora"]["KezdoDatum"] != null
|
lessonStart = json["Ora"]["KezdoDatum"] != null
|
||||||
? DateTime.parse(json["Ora"]["KezdoDatum"]).toLocal()
|
? DateTime.parse(json["Ora"]["KezdoDatum"]).toLocal()
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
// ignore_for_file: dead_code
|
// ignore_for_file: dead_code
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
import 'package:refilc/api/providers/live_card_provider.dart';
|
import 'package:refilc/api/providers/live_card_provider.dart';
|
||||||
|
import 'package:refilc/theme/colors/colors.dart';
|
||||||
import 'package:refilc/ui/date_widget.dart';
|
import 'package:refilc/ui/date_widget.dart';
|
||||||
import 'package:refilc/utils/format.dart';
|
import 'package:refilc/utils/format.dart';
|
||||||
import 'package:i18n_extension/i18n_extension.dart';
|
import 'package:i18n_extension/i18n_extension.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:refilc_mobile_ui/common/soon_alert/soon_alert.dart';
|
||||||
import 'package:refilc_plus/providers/premium_provider.dart';
|
import 'package:refilc_plus/providers/premium_provider.dart';
|
||||||
import 'package:animated_list_plus/animated_list_plus.dart';
|
import 'package:animated_list_plus/animated_list_plus.dart';
|
||||||
import 'package:refilc/api/providers/update_provider.dart';
|
import 'package:refilc/api/providers/update_provider.dart';
|
||||||
@ -243,6 +246,34 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8.0, vertical: 5.0),
|
||||||
|
child: IconButton(
|
||||||
|
splashRadius: 24.0,
|
||||||
|
onPressed: () async {
|
||||||
|
// Navigator.of(context, rootNavigator: true)
|
||||||
|
// .push(PageRouteBuilder(
|
||||||
|
// pageBuilder: (context, animation, secondaryAnimation) =>
|
||||||
|
// PremiumFSTimetable(
|
||||||
|
// controller: controller,
|
||||||
|
// ),
|
||||||
|
// ))
|
||||||
|
// .then((_) {
|
||||||
|
// SystemChrome.setPreferredOrientations(
|
||||||
|
// [DeviceOrientation.portraitUp]);
|
||||||
|
// setSystemChrome(context);
|
||||||
|
// });
|
||||||
|
SoonAlert.show(context: context);
|
||||||
|
// await showSendMessageSheet(context);
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
FeatherIcons.messageCircle,
|
||||||
|
color: AppColors.of(context).text,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// Profile Icon
|
// Profile Icon
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 24.0),
|
padding: const EdgeInsets.only(right: 24.0),
|
||||||
|
@ -14,7 +14,7 @@ class ErrorReportScreen extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Color(0xFFE3EBFB),
|
backgroundColor: const Color(0xFFE3EBFB),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
@ -28,7 +28,7 @@ class ErrorReportScreen extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
"ekretaYou".i18n,
|
"ekretaYou".i18n,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xFF011234).withOpacity(0.7),
|
color: const Color(0xFF011234).withOpacity(0.7),
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
@ -120,7 +120,7 @@ class ErrorReportScreen extends StatelessWidget {
|
|||||||
const EdgeInsets.symmetric(vertical: 14.0),
|
const EdgeInsets.symmetric(vertical: 14.0),
|
||||||
),
|
),
|
||||||
backgroundColor: MaterialStateProperty.all(
|
backgroundColor: MaterialStateProperty.all(
|
||||||
Color(0xFFF3F7FE),
|
const Color(0xFFF3F7FE),
|
||||||
),
|
),
|
||||||
shape: MaterialStateProperty.all(
|
shape: MaterialStateProperty.all(
|
||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
@ -128,7 +128,7 @@ class ErrorReportScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
side: MaterialStateProperty.all(
|
side: MaterialStateProperty.all(
|
||||||
BorderSide(width: 1.0, color: Color(0xFFC7D3EB)),
|
const BorderSide(width: 1.0, color: Color(0xFFC7D3EB)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -244,7 +244,7 @@ class ErrorDetail extends StatelessWidget {
|
|||||||
const EdgeInsets.symmetric(horizontal: 6.5, vertical: 4.0),
|
const EdgeInsets.symmetric(horizontal: 6.5, vertical: 4.0),
|
||||||
margin: const EdgeInsets.only(top: 4.0),
|
margin: const EdgeInsets.only(top: 4.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color.fromARGB(255, 218, 218, 218),
|
color: const Color.fromARGB(255, 218, 218, 218),
|
||||||
borderRadius: BorderRadius.circular(4.0)),
|
borderRadius: BorderRadius.circular(4.0)),
|
||||||
child: Text(
|
child: Text(
|
||||||
content,
|
content,
|
||||||
|
@ -18,9 +18,10 @@ List<School> searchSchools(List<School> all, String pattern) {
|
|||||||
|
|
||||||
if (contains == pattern.split(" ").length) results.add(item);
|
if (contains == pattern.split(" ").length) results.add(item);
|
||||||
|
|
||||||
if (item.instituteCode.toLowerCase().specialChars().contains(pattern))
|
if (item.instituteCode.toLowerCase().specialChars().contains(pattern)) {
|
||||||
results.add(item);
|
results.add(item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
results.sort((a, b) => a.name.compareTo(b.name));
|
results.sort((a, b) => a.name.compareTo(b.name));
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: deprecated_member_use
|
||||||
|
|
||||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:refilc/api/providers/update_provider.dart';
|
import 'package:refilc/api/providers/update_provider.dart';
|
||||||
@ -201,9 +203,7 @@ class NavigationScreenState extends State<NavigationScreen>
|
|||||||
@override
|
@override
|
||||||
void didChangePlatformBrightness() {
|
void didChangePlatformBrightness() {
|
||||||
if (settings.theme == ThemeMode.system) {
|
if (settings.theme == ThemeMode.system) {
|
||||||
// ignore: deprecated_member_use
|
|
||||||
Brightness? brightness =
|
Brightness? brightness =
|
||||||
// ignore: deprecated_member_use
|
|
||||||
WidgetsBinding.instance.window.platformBrightness;
|
WidgetsBinding.instance.window.platformBrightness;
|
||||||
Provider.of<ThemeModeObserver>(context, listen: false).changeTheme(
|
Provider.of<ThemeModeObserver>(context, listen: false).changeTheme(
|
||||||
brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark);
|
brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark);
|
||||||
@ -242,7 +242,6 @@ class NavigationScreenState extends State<NavigationScreen>
|
|||||||
// SvgTheme navIcTheme =
|
// SvgTheme navIcTheme =
|
||||||
// SvgTheme(currentColor: Theme.of(context).colorScheme.primary);
|
// SvgTheme(currentColor: Theme.of(context).colorScheme.primary);
|
||||||
|
|
||||||
// ignore: deprecated_member_use
|
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
if (_navigatorState.currentState?.canPop() ?? false) {
|
if (_navigatorState.currentState?.canPop() ?? false) {
|
||||||
|
@ -1016,7 +1016,7 @@ class SettingsScreenState extends State<SettingsScreen>
|
|||||||
);
|
);
|
||||||
showErrorScreen(context, fakeErrorDetails);
|
showErrorScreen(context, fakeErrorDetails);
|
||||||
},
|
},
|
||||||
child: Text('hiba_tesztelese'),
|
child: const Text('hiba_tesztelese'),
|
||||||
),
|
),
|
||||||
|
|
||||||
// developer options
|
// developer options
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 146ff9251c421f1982e90e07d36027c4d5d3342a
|
Subproject commit a4d569db8d8cffa5342fabacd7d1f3ee4fe43061
|
Loading…
x
Reference in New Issue
Block a user