From 728982df2ca26f6816b441f9920bfaf8f23da3cd Mon Sep 17 00:00:00 2001 From: vitormpp Date: Wed, 29 May 2024 14:09:40 +0100 Subject: [PATCH] Fixed lint error --- .../local_storage/database/app_bus_stop_database.dart | 6 +++--- .../local_storage/database/app_calendar_database.dart | 4 ++-- .../local_storage/database/app_course_units_database.dart | 4 ++-- .../local_storage/database/app_courses_database.dart | 6 +++--- .../local_storage/database/app_exams_database.dart | 6 +++--- .../database/app_last_user_info_update_database.dart | 6 +++--- .../local_storage/database/app_lectures_database.dart | 4 ++-- .../database/app_library_occupation_database.dart | 4 ++-- .../local_storage/database/app_references_database.dart | 6 +++--- .../local_storage/database/app_restaurant_database.dart | 4 ++-- .../local_storage/database/app_user_database.dart | 6 +++--- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/uni/lib/controller/local_storage/database/app_bus_stop_database.dart b/uni/lib/controller/local_storage/database/app_bus_stop_database.dart index 09b023640..c312f52f9 100644 --- a/uni/lib/controller/local_storage/database/app_bus_stop_database.dart +++ b/uni/lib/controller/local_storage/database/app_bus_stop_database.dart @@ -106,10 +106,10 @@ class AppBusStopDatabase extends AppDatabase> { } /// Replaces all the bus stops in this database with entries - /// from [stops]. + /// from [data]. @override - Future saveToDatabase(Map stops) async { + Future saveToDatabase(Map data) async { await deleteBusStops(); - await _insertBusStops(stops); + await _insertBusStops(data); } } diff --git a/uni/lib/controller/local_storage/database/app_calendar_database.dart b/uni/lib/controller/local_storage/database/app_calendar_database.dart index 5505a8230..186bd38c8 100644 --- a/uni/lib/controller/local_storage/database/app_calendar_database.dart +++ b/uni/lib/controller/local_storage/database/app_calendar_database.dart @@ -29,11 +29,11 @@ class CalendarDatabase extends AppDatabase> { } @override - Future saveToDatabase(List calendar) async { + Future saveToDatabase(List data) async { final db = await getDatabase(); await db.transaction((txn) async { await txn.delete('CALENDAR'); - for (final event in calendar) { + for (final event in data) { await txn.insert('CALENDAR', event.toMap()); } }); diff --git a/uni/lib/controller/local_storage/database/app_course_units_database.dart b/uni/lib/controller/local_storage/database/app_course_units_database.dart index f72158c6a..3cf3181ed 100644 --- a/uni/lib/controller/local_storage/database/app_course_units_database.dart +++ b/uni/lib/controller/local_storage/database/app_course_units_database.dart @@ -57,8 +57,8 @@ class AppCourseUnitsDatabase extends AppDatabase> { } @override - Future saveToDatabase(List courseUnits) async { + Future saveToDatabase(List data) async { await deleteCourseUnits(); - await _insertCourseUnits(courseUnits); + await _insertCourseUnits(data); } } diff --git a/uni/lib/controller/local_storage/database/app_courses_database.dart b/uni/lib/controller/local_storage/database/app_courses_database.dart index cf0cdc739..61026f105 100644 --- a/uni/lib/controller/local_storage/database/app_courses_database.dart +++ b/uni/lib/controller/local_storage/database/app_courses_database.dart @@ -77,10 +77,10 @@ class AppCoursesDatabase extends AppDatabase> { await batch.commit(); } - /// Replaces all of the data in this database with the data from [courses]. + /// Replaces all of the data in this database with the data from [data]. @override - Future saveToDatabase(List courses) async { + Future saveToDatabase(List data) async { await deleteCourses(); - await _insertCourses(courses); + await _insertCourses(data); } } diff --git a/uni/lib/controller/local_storage/database/app_exams_database.dart b/uni/lib/controller/local_storage/database/app_exams_database.dart index 27b6ba9be..31bbead47 100644 --- a/uni/lib/controller/local_storage/database/app_exams_database.dart +++ b/uni/lib/controller/local_storage/database/app_exams_database.dart @@ -70,10 +70,10 @@ CREATE TABLE exams(id TEXT, subject TEXT, begin TEXT, end TEXT, await batch.commit(); } - /// Replaces all of the data in this database with [exams]. + /// Replaces all of the data in this database with [data]. @override - Future saveToDatabase(List exams) async { + Future saveToDatabase(List data) async { await deleteExams(); - await _insertExams(exams); + await _insertExams(data); } } diff --git a/uni/lib/controller/local_storage/database/app_last_user_info_update_database.dart b/uni/lib/controller/local_storage/database/app_last_user_info_update_database.dart index 2bdacdd3c..a0f1fb807 100644 --- a/uni/lib/controller/local_storage/database/app_last_user_info_update_database.dart +++ b/uni/lib/controller/local_storage/database/app_last_user_info_update_database.dart @@ -39,10 +39,10 @@ class AppLastUserInfoUpdateDatabase extends AppDatabase { return DateTime.now(); } - /// Replaces the timestamp in this database with [timestamp]. + /// Replaces the timestamp in this database with [data]. @override - Future saveToDatabase(DateTime timestamp) async { + Future saveToDatabase(DateTime data) async { await deleteLastUpdate(); - await _insertTimeStamp(timestamp); + await _insertTimeStamp(data); } } diff --git a/uni/lib/controller/local_storage/database/app_lectures_database.dart b/uni/lib/controller/local_storage/database/app_lectures_database.dart index 3b8c10bbb..af0deed03 100644 --- a/uni/lib/controller/local_storage/database/app_lectures_database.dart +++ b/uni/lib/controller/local_storage/database/app_lectures_database.dart @@ -79,8 +79,8 @@ CREATE TABLE lectures(subject TEXT, typeClass TEXT, /// Replaces all of the data in this database with [lectures]. @override - Future saveToDatabase(List lectures) async { + Future saveToDatabase(List data) async { await deleteLectures(); - await _insertLectures(lectures); + await _insertLectures(data); } } diff --git a/uni/lib/controller/local_storage/database/app_library_occupation_database.dart b/uni/lib/controller/local_storage/database/app_library_occupation_database.dart index 491c1d3ba..665ff3193 100644 --- a/uni/lib/controller/local_storage/database/app_library_occupation_database.dart +++ b/uni/lib/controller/local_storage/database/app_library_occupation_database.dart @@ -38,11 +38,11 @@ class LibraryOccupationDatabase extends AppDatabase { } @override - Future saveToDatabase(LibraryOccupation occupation) async { + Future saveToDatabase(LibraryOccupation data) async { final db = await getDatabase(); await db.transaction((txn) async { await txn.delete('FLOOR_OCCUPATION'); - for (final floor in occupation.floors) { + for (final floor in data.floors) { await txn.insert('FLOOR_OCCUPATION', floor.toMap()); } }); diff --git a/uni/lib/controller/local_storage/database/app_references_database.dart b/uni/lib/controller/local_storage/database/app_references_database.dart index a24425093..375d4c893 100644 --- a/uni/lib/controller/local_storage/database/app_references_database.dart +++ b/uni/lib/controller/local_storage/database/app_references_database.dart @@ -67,10 +67,10 @@ class AppReferencesDatabase extends AppDatabase> { await batch.commit(); } - /// Replaces all of the data in this database with the data from [references]. + /// Replaces all of the data in this database with the data from [data]. @override - Future saveToDatabase(List references) async { + Future saveToDatabase(List data) async { await deleteReferences(); - await insertReferences(references); + await insertReferences(data); } } diff --git a/uni/lib/controller/local_storage/database/app_restaurant_database.dart b/uni/lib/controller/local_storage/database/app_restaurant_database.dart index b0685fe75..840e8624e 100644 --- a/uni/lib/controller/local_storage/database/app_restaurant_database.dart +++ b/uni/lib/controller/local_storage/database/app_restaurant_database.dart @@ -119,11 +119,11 @@ class RestaurantDatabase extends AppDatabase> { } @override - Future saveToDatabase(List restaurants) async { + Future saveToDatabase(List data) async { final db = await getDatabase(); await db.transaction((transaction) async { await deleteAll(transaction); - for (final restaurant in restaurants) { + for (final restaurant in data) { await insertRestaurant(transaction, restaurant); } }); diff --git a/uni/lib/controller/local_storage/database/app_user_database.dart b/uni/lib/controller/local_storage/database/app_user_database.dart index af27ec793..aa6894dfe 100644 --- a/uni/lib/controller/local_storage/database/app_user_database.dart +++ b/uni/lib/controller/local_storage/database/app_user_database.dart @@ -11,10 +11,10 @@ class AppUserDataDatabase extends AppDatabase { AppUserDataDatabase() : super('userdata.db', ['CREATE TABLE userdata(key TEXT, value TEXT)']); - /// Adds [profile] to this database. + /// Adds [data] (profile) to this database. @override - Future saveToDatabase(Profile profile) async { - for (final keymap in profile.keymapValues()) { + Future saveToDatabase(Profile data) async { + for (final keymap in data.keymapValues()) { await insertInDatabase( 'userdata', {'key': keymap.item1, 'value': keymap.item2},