Merge branch 'master' into feat/health-platform-weight-sync

This commit is contained in:
John Weidner
2026-03-27 15:57:15 -05:00
4 changed files with 15 additions and 23 deletions

View File

@@ -1,10 +1,6 @@
import 'dart:io';
import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:drift_flutter/drift_flutter.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:wger/database/exercises/type_converters.dart';
import 'package:wger/models/exercises/category.dart';
import 'package:wger/models/exercises/equipment.dart';
@@ -110,10 +106,6 @@ class ExerciseDatabase extends _$ExerciseDatabase {
}
}
LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationCacheDirectory();
final file = File(p.join(dbFolder.path, 'exercises.sqlite'));
return NativeDatabase.createInBackground(file);
});
QueryExecutor _openConnection() {
return driftDatabase(name: 'exercises');
}

View File

@@ -1,10 +1,6 @@
import 'dart:io';
import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:drift_flutter/drift_flutter.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
part 'ingredients_database.g.dart';
@@ -63,10 +59,6 @@ class IngredientDatabase extends _$IngredientDatabase {
}
}
LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationCacheDirectory();
final file = File(p.join(dbFolder.path, 'ingredients.sqlite'));
return NativeDatabase.createInBackground(file);
});
QueryExecutor _openConnection() {
return driftDatabase(name: 'ingredients');
}

View File

@@ -119,6 +119,14 @@ void main() async {
// Catch errors that happen outside of the Flutter framework (e.g., in async operations)
PlatformDispatcher.instance.onError = (error, stack) {
// Skip the StackFrame assertion error from the stack_trace package.
// This is a known Flutter framework issue where async gap markers in stack
// traces cause an assertion failure in StackFrame.fromStackTraceLine.
if (error is AssertionError && error.toString().contains('asynchronous gap')) {
logger.warning('Suppressed StackFrame assertion error (known Flutter issue)');
return true;
}
logger.severe('Error caught by PlatformDispatcher.instance.onError: $error');
logger.severe('Stack trace: $stack');

View File

@@ -64,7 +64,7 @@ dependencies:
rive: ^0.13.20
riverpod_annotation: ^4.0.0
shared_preferences: ^2.5.3
sqlite3_flutter_libs: ^0.6.0+eol
drift_flutter: ^0.2.8
table_calendar: ^3.0.8
url_launcher: ^6.3.2
version: ^3.0.2