---
description: "Flutter Desktop conventions for {{PROJECT_NAME}} — Pillar 4"
alwaysApply: true
---

# Flutter Desktop Standards — {{PROJECT_NAME}}

## Window management
- Use `window_manager` package for window title, size, minimize/maximize controls
- Set minimum window size to prevent unusable UI: `windowManager.setMinimumSize(const Size(800, 600))`
- Remember window position/size across sessions using `shared_preferences`

## Keyboard shortcuts
- All primary actions must have keyboard shortcuts
- Use `Shortcuts` widget + `Actions` widget for app-wide shortcuts
- Follow platform conventions: `Cmd+S` (macOS), `Ctrl+S` (Windows/Linux) for save

## Context menus
- Right-click context menus: use `ContextMenuRegion` widget
- Desktop users expect right-click everywhere

## Platform-specific behavior
```dart
if (Platform.isMacOS) {
  // macOS: use mac_window_manager for traffic lights placement
} else if (Platform.isWindows) {
  // Windows: custom title bar with min/max/close buttons
} else if (Platform.isLinux) {
  // Linux: respect window manager decorations
}
```

## File system
- `path_provider` provides platform-appropriate directories
- `file_picker` for open/save dialogs — never hardcode paths
- Handle file permission errors gracefully (especially on macOS with sandboxing)
