Skip to content

Commit

Permalink
Change db path for linux/windows
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Jul 29, 2023
1 parent d3ab5eb commit 7f0fdc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 21 additions & 0 deletions lib/database/database_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ class DatabaseManager {
String path = join(await getDatabasesPath(), "core1.db");
// Clear database for testing
// await deleteDatabase(path);
if (Platform.isWindows || Platform.isLinux) {
return await openDatabase(inMemoryDatabasePath, version: 1,
onCreate: (db, version) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS WorkoutTable(id TEXT PRIMARY KEY,
title TEXT,
numExercises INTEGER,
exercises TEXT,
exerciseTime INTEGER,
restTime INTEGER,
halfTime INTEGER,
halfwayMark INTEGER,
workSound TEXT,
restSound TEXT,
halfwaySound TEXT,
completeSound TEXT,
countdownSound TEXT
)
''');
});
}
return await openDatabase(path, version: 2,
onCreate: (Database db, int version) async {
await db.execute('''
Expand Down
2 changes: 0 additions & 2 deletions test/workout_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ void main() {

// Tap to go to the next page.
await tester.tap(find.byType(ElevatedButton));
// await tester.pumpAndSettle();
await tester.pump(const Duration(milliseconds: 5000));
await tester.pumpAndSettle();

expect(find.text(workoutName), findsOneWidget);
Expand Down

0 comments on commit 7f0fdc2

Please sign in to comment.