mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Cleanup
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PlateConfiguration extends ChangeNotifier {
|
||||
//olympic standard weights
|
||||
List<double> _plateWeights = [1.25, 2.5, 5, 10, 15, 20, 25];
|
||||
|
||||
List<double> get plateWeights => _plateWeights;
|
||||
|
||||
void setPlateWeights(List<double> weights) {
|
||||
_plateWeights = weights;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -90,20 +90,20 @@ void main() async {
|
||||
await PreferenceHelper.instance.migrationSupportFunctionForSharedPreferences();
|
||||
|
||||
// Catch errors from Flutter itself (widget build, layout, paint, etc.)
|
||||
// FlutterError.onError = (FlutterErrorDetails details) {
|
||||
// final stack = details.stack ?? StackTrace.empty;
|
||||
// if (kDebugMode) {
|
||||
// FlutterError.dumpErrorToConsole(details);
|
||||
// }
|
||||
//
|
||||
// // Don't show the full error dialog for network image loading errors.
|
||||
// if (details.exception is NetworkImageLoadException) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // showGeneralErrorDialog(details.exception, stack);
|
||||
// throw details.exception;
|
||||
// };
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
final stack = details.stack ?? StackTrace.empty;
|
||||
if (kDebugMode) {
|
||||
FlutterError.dumpErrorToConsole(details);
|
||||
}
|
||||
|
||||
// Don't show the full error dialog for network image loading errors.
|
||||
if (details.exception is NetworkImageLoadException) {
|
||||
return;
|
||||
}
|
||||
|
||||
showGeneralErrorDialog(details.exception, stack);
|
||||
// throw details.exception;
|
||||
};
|
||||
|
||||
// Catch errors that happen outside of the Flutter framework (e.g., in async operations)
|
||||
PlatformDispatcher.instance.onError = (error, stack) {
|
||||
@@ -114,8 +114,8 @@ void main() async {
|
||||
if (error is WgerHttpException) {
|
||||
showHttpExceptionErrorDialog(error);
|
||||
} else {
|
||||
// showGeneralErrorDialog(error, stack);
|
||||
throw error;
|
||||
showGeneralErrorDialog(error, stack);
|
||||
// throw error;
|
||||
}
|
||||
|
||||
// Return true to indicate that the error has been handled.
|
||||
|
||||
@@ -45,14 +45,14 @@ class UserProvider with ChangeNotifier {
|
||||
profile = null;
|
||||
}
|
||||
|
||||
// change the unit of plates
|
||||
void changeUnit({changeTo = 'kg'}) {
|
||||
if (changeTo == 'kg') {
|
||||
profile?.weightUnitStr = 'lb';
|
||||
} else {
|
||||
profile?.weightUnitStr = 'kg';
|
||||
}
|
||||
}
|
||||
// // change the unit of plates
|
||||
// void changeUnit({changeTo = 'kg'}) {
|
||||
// if (changeTo == 'kg') {
|
||||
// profile?.weightUnitStr = 'lb';
|
||||
// } else {
|
||||
// profile?.weightUnitStr = 'kg';
|
||||
// }
|
||||
// }
|
||||
|
||||
// Load theme mode from SharedPreferences
|
||||
Future<void> _loadThemeMode() async {
|
||||
|
||||
Reference in New Issue
Block a user