Skip to content

Commit 9886062

Browse files
authored
Cleanup and dependency bump (#271)
1 parent 5a6f7ab commit 9886062

File tree

13 files changed

+185
-921
lines changed

13 files changed

+185
-921
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ flutter {
8989

9090
dependencies {
9191
implementation "androidx.multidex:multidex:2.0.1"
92-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
92+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
9393
}

lib/core/db/database.dart

Lines changed: 0 additions & 326 deletions
Original file line numberDiff line numberDiff line change
@@ -62,330 +62,4 @@ class DatabaseManager {
6262
Database db, int oldVersion, int newVersion) async {
6363
await runMigrations(db, oldVersion, newVersion);
6464
}
65-
66-
// Future<void> insertInterval(IntervalType interval) async {
67-
// final db = await _getDatabase();
68-
// await db.insert(
69-
// intervalTableName,
70-
// interval.toMap(),
71-
// conflictAlgorithm: ConflictAlgorithm.fail,
72-
// );
73-
// }
74-
75-
// Future<void> insertIntervals(List<IntervalType> intervals) async {
76-
// final db = await _getDatabase();
77-
// const int batchSize = 10000; // Number of rows per batch
78-
79-
// for (var i = 0; i < intervals.length; i += batchSize) {
80-
// final batch = db.batch();
81-
82-
// // Get the next chunk of intervals
83-
// final chunk = intervals.skip(i).take(batchSize);
84-
85-
// for (var interval in chunk) {
86-
// batch.insert(
87-
// intervalTableName,
88-
// interval.toMap(),
89-
// conflictAlgorithm: ConflictAlgorithm.fail,
90-
// );
91-
// }
92-
93-
// // Commit the batch
94-
// await batch.commit(noResult: true);
95-
// }
96-
// }
97-
98-
// Future<void> insertTimer(TimerType timer) async {
99-
// final db = await _getDatabase();
100-
// await db.insert(
101-
// timerTableName,
102-
// timer.toMap(),
103-
// conflictAlgorithm: ConflictAlgorithm.fail,
104-
// );
105-
// }
106-
107-
// Future<void> insertTimers(List<TimerType> timers) async {
108-
// final db = await _getDatabase();
109-
// Batch batch = db.batch();
110-
111-
// for (var timer in timers) {
112-
// batch.insert(
113-
// timerTableName,
114-
// timer.toMap(),
115-
// conflictAlgorithm: ConflictAlgorithm.fail,
116-
// );
117-
// }
118-
119-
// await batch.commit(noResult: true);
120-
// }
121-
122-
// Future<void> insertTimeSettings(TimerTimeSettings timeSettings) async {
123-
// final db = await _getDatabase();
124-
// await db.insert(
125-
// timeSettingsTableName,
126-
// timeSettings.toMap(),
127-
// conflictAlgorithm: ConflictAlgorithm.fail,
128-
// );
129-
// }
130-
131-
// Future<void> insertSoundSettings(TimerSoundSettings soundSettings) async {
132-
// final db = await _getDatabase();
133-
// await db.insert(
134-
// soundSettingsTableName,
135-
// soundSettings.toMap(),
136-
// conflictAlgorithm: ConflictAlgorithm.fail,
137-
// );
138-
// }
139-
140-
// // Update interval
141-
// Future<void> updateInterval(IntervalType interval) async {
142-
// final db = await _getDatabase();
143-
// await db.update(
144-
// intervalTableName,
145-
// interval.toMap(),
146-
// where: 'id = ?',
147-
// whereArgs: [interval.id],
148-
// );
149-
// }
150-
151-
// // Batch update intervals
152-
// Future<void> updateIntervals(List<IntervalType> intervals) async {
153-
// final db = await _getDatabase();
154-
// Batch batch = db.batch();
155-
156-
// // Collect all interval IDs to be updated
157-
// List<String> intervalIds =
158-
// intervals.map((interval) => interval.id).toList();
159-
// String timerId = intervals.first.workoutId;
160-
161-
// // Delete intervals that match the timerId but are not in the update list
162-
// await db.delete(
163-
// intervalTableName,
164-
// where:
165-
// 'workoutId = ? AND id NOT IN (${List.filled(intervalIds.length, '?').join(', ')})',
166-
// whereArgs: [timerId, ...intervalIds],
167-
// );
168-
169-
// // Update intervals
170-
// for (var interval in intervals) {
171-
// batch.update(
172-
// intervalTableName,
173-
// interval.toMap(),
174-
// where: 'id = ?',
175-
// whereArgs: [interval.id],
176-
// );
177-
// }
178-
179-
// await batch.commit(noResult: true);
180-
// }
181-
182-
// Future<void> updateTimer(TimerType timer) async {
183-
// final db = await _getDatabase();
184-
// await db.update(
185-
// timerTableName,
186-
// timer.toMap(),
187-
// where: 'id = ?',
188-
// whereArgs: [timer.id],
189-
// );
190-
// }
191-
192-
// Future<void> updateTimers(List<TimerType> timers) async {
193-
// final db = await _getDatabase();
194-
// Batch batch = db.batch();
195-
196-
// for (var timer in timers) {
197-
// batch.update(
198-
// timerTableName,
199-
// timer.toMap(),
200-
// where: 'id = ?',
201-
// whereArgs: [timer.id],
202-
// );
203-
// }
204-
205-
// await batch.commit(noResult: true);
206-
// }
207-
208-
// Future<void> updateTimeSettingsByTimerId(
209-
// String timerId, TimerTimeSettings timeSettings) async {
210-
// final db = await _getDatabase();
211-
// await db.update(
212-
// timeSettingsTableName,
213-
// timeSettings.toMap(),
214-
// where: 'timerId = ?',
215-
// whereArgs: [timerId],
216-
// );
217-
// }
218-
219-
// Future<void> updateSoundSettingsByTimerId(
220-
// String timerId, TimerSoundSettings soundSettings) async {
221-
// final db = await _getDatabase();
222-
// await db.update(
223-
// soundSettingsTableName,
224-
// soundSettings.toMap(),
225-
// where: 'timerId = ?',
226-
// whereArgs: [timerId],
227-
// );
228-
// }
229-
230-
// // Delete workout
231-
// Future<void> deleteWorkout(String id) async {
232-
// final db = await _getDatabase();
233-
// await db.delete(
234-
// workoutTableName,
235-
// where: 'id = ?',
236-
// whereArgs: [id],
237-
// );
238-
// }
239-
240-
// Future<void> deleteWorkoutTable() async {
241-
// final db = await _getDatabase();
242-
// await db.execute("DROP TABLE IF EXISTS $workoutTableName");
243-
// }
244-
245-
// // Delete interval
246-
// Future<void> deleteInterval(String id) async {
247-
// final db = await _getDatabase();
248-
// await db.delete(
249-
// intervalTableName,
250-
// where: 'id = ?',
251-
// whereArgs: [id],
252-
// );
253-
// }
254-
255-
// // Delete intervals
256-
// Future<void> deleteIntervalsByWorkoutId(String workoutId) async {
257-
// final db = await _getDatabase();
258-
// await db.delete(
259-
// intervalTableName,
260-
// where: 'workoutId = ?',
261-
// whereArgs: [workoutId],
262-
// );
263-
// }
264-
265-
// // Delete timer
266-
// Future<void> deleteTimer(String id) async {
267-
// final db = await _getDatabase();
268-
// await db.delete(
269-
// timerTableName,
270-
// where: 'id = ?',
271-
// whereArgs: [id],
272-
// );
273-
// }
274-
275-
// // Delete time settings
276-
// Future<void> deleteTimeSettingsByTimerId(String timerId) async {
277-
// final db = await _getDatabase();
278-
// await db.delete(
279-
// timeSettingsTableName,
280-
// where: 'timerId = ?',
281-
// whereArgs: [timerId],
282-
// );
283-
// }
284-
285-
// // Delete sound settings
286-
// Future<void> deleteSoundSettingsByTimerId(String timerId) async {
287-
// final db = await _getDatabase();
288-
// await db.delete(
289-
// soundSettingsTableName,
290-
// where: 'timerId = ?',
291-
// whereArgs: [timerId],
292-
// );
293-
// }
294-
295-
// // Get all workouts
296-
// Future<List<Workout>> getWorkouts() async {
297-
// final db = await _getDatabase();
298-
// try {
299-
// final List<Map<String, dynamic>> maps = await db.query(workoutTableName);
300-
// return maps.map((map) => Workout.fromMap(map)).toList();
301-
// } catch (e) {
302-
// // If the workouts table does not exist, return an empty list
303-
// return [];
304-
// }
305-
// }
306-
307-
// // Get all intervals
308-
// Future<List<IntervalType>> getIntervals() async {
309-
// final db = await _getDatabase();
310-
// final List<Map<String, dynamic>> maps = await db.query(
311-
// intervalTableName,
312-
// orderBy: 'intervalIndex ASC',
313-
// );
314-
// return maps.map((map) => IntervalType.fromMap(map)).toList();
315-
// }
316-
317-
// Future<List<IntervalType>> getIntervalsByWorkoutId(String workoutId) async {
318-
// final db = await _getDatabase();
319-
// final List<Map<String, dynamic>> maps = await db.query(
320-
// intervalTableName,
321-
// where: 'workoutId = ?',
322-
// whereArgs: [workoutId],
323-
// orderBy: 'intervalIndex ASC',
324-
// );
325-
// return maps.map((map) => IntervalType.fromMap(map)).toList();
326-
// }
327-
328-
// // Get all timers
329-
// Future<List<TimerType>> getTimers() async {
330-
// final db = await _getDatabase();
331-
// final List<Map<String, dynamic>> maps = await db.query(timerTableName);
332-
// return maps.map((map) => TimerType.fromMap(map)).toList();
333-
// }
334-
335-
// // Get all timers with their settings
336-
// Future<List<TimerType>> getTimersWithSettings() async {
337-
// final db = await _getDatabase();
338-
// final List<Map<String, dynamic>> timerMaps = await db.query(timerTableName);
339-
// List<TimerType> timers = [];
340-
341-
// for (var timerMap in timerMaps) {
342-
// TimerType timer = TimerType.fromMap(timerMap);
343-
344-
// // Fetch and set time settings
345-
// TimerTimeSettings? timeSettings =
346-
// await getTimeSettingsByTimerId(timer.id);
347-
// if (timeSettings != null) {
348-
// timer.timeSettings = timeSettings;
349-
// }
350-
351-
// // Fetch and set sound settings
352-
// TimerSoundSettings? soundSettings =
353-
// await getSoundSettingsByTimerId(timer.id);
354-
// if (soundSettings != null) {
355-
// timer.soundSettings = soundSettings;
356-
// }
357-
358-
// timers.add(timer);
359-
// }
360-
361-
// return timers;
362-
// }
363-
364-
// // Get time settings by timer ID
365-
// Future<TimerTimeSettings?> getTimeSettingsByTimerId(String timerId) async {
366-
// final db = await _getDatabase();
367-
// final List<Map<String, dynamic>> maps = await db.query(
368-
// timeSettingsTableName,
369-
// where: 'timerId = ?',
370-
// whereArgs: [timerId],
371-
// );
372-
// if (maps.isEmpty) {
373-
// return null;
374-
// }
375-
// return TimerTimeSettings.fromMap(maps.first);
376-
// }
377-
378-
// // Get sound settings by timer ID
379-
// Future<TimerSoundSettings?> getSoundSettingsByTimerId(String timerId) async {
380-
// final db = await _getDatabase();
381-
// final List<Map<String, dynamic>> maps = await db.query(
382-
// soundSettingsTableName,
383-
// where: 'timerId = ?',
384-
// whereArgs: [timerId],
385-
// );
386-
// if (maps.isEmpty) {
387-
// return null;
388-
// }
389-
// return TimerSoundSettings.fromMap(maps.first);
390-
// }
39165
}

0 commit comments

Comments
 (0)