deleteLayout method
Delete a layout configuration
Implementation
Future<void> deleteLayout(String id) async {
// Remove from cache
_configCache.remove(id);
// Remove from storage
await _storage.deleteLayoutConfig(id);
// If this was the current layout, reset the current layout
if (_currentLayoutId == id) {
_currentLayoutId =
_configCache.isNotEmpty ? _configCache.keys.first : null;
notifyListeners();
if (_currentLayoutId != null) {
_notifyLayoutChange();
}
}
}