feat: add setting for auto-lock fix: fix sideswipe

This commit is contained in:
2026-08-04 01:09:01 +02:00
parent 0997d110d4
commit 812fcc892b
23 changed files with 629 additions and 28 deletions
+31
View File
@@ -90,6 +90,37 @@ class BarScreenViewModel extends ChangeNotifier {
}
}
Future<void> renameTab(String tabId, String customerName) async {
try {
await barTabService.renameTab(tabId: tabId, customerName: customerName);
await _reloadTabs();
} catch (e, stack) {
debugPrint('BarScreenViewModel: renameTab error: $e');
_errorMessage = 'Could not rename tab.';
notifyListeners();
Sentry.captureException(e, stackTrace: stack);
rethrow;
}
}
Future<void> deleteTab(String tabId) async {
try {
final deletedItems = await barTabService.deleteTab(tabId);
for (final item in deletedItems) {
inventory.applyStockDelta(item.productId, item.quantity);
}
await _reloadTabs();
} catch (e, stack) {
debugPrint('BarScreenViewModel: deleteTab error: $e');
_errorMessage = 'Could not delete tab.';
notifyListeners();
Sentry.captureException(e, stackTrace: stack);
rethrow;
}
}
Future<void> addProductToSelectedTab(Product product) async {
final tab = selectedTab;
+3
View File
@@ -108,6 +108,9 @@ class SettingsViewModel extends ChangeNotifier {
Future<void> updatePinRequired(bool value) =>
_save(_settings.copyWith(pinRequired: value));
Future<void> updateAutoLockEnabled(bool value) =>
_save(_settings.copyWith(autoLockEnabled: value));
Future<void> updateThemeMode(AppThemeMode mode) =>
_save(_settings.copyWith(themeMode: mode));