How abdelrahman-elreedy/window_frame works
window_frame is a Flutter Windows plugin that replaces the native title bar with a customizable Flutter bar while retaining native window behavior. The main workflow initializes window options, wraps the app in a scope that presents the bar, and sends window commands through the Dart/native channel to Win32; window-state events return to Dart. The graph also preserves documented menu, drag, caption-button, and safe-close capabilities. Dart internals are represented at subsystem level because their source was not excerpted; native links are limited to relationships supported by the README and source index.
Main entry points: window_method_channel_data_source.dart Method-channel data source · window_use_cases.cpp Window use cases · win32_window_gateway.cpp Win32 window gateway · scope Frame scope
Components 23
Flutter presentation
- Frame scope
lib/src/presentation/widgets/scope - Title bar
lib/src/presentation/widgets/title_bar/window_title_bar.dart - Caption buttons
lib/src/presentation/widgets/caption_buttons/window_caption_buttons.dart - Drag and menus
lib/src/presentation/widgets/title_bar
Dart window logic
- Title bar controller
lib/src/presentation/view_models/title_bar_controller.dart - Bar content model
lib/src/presentation/models/title_bar_content.dart - Close coordinator
lib/src/presentation/coordinators/window_close_coordinator.dart - Frame facade
lib/src/presentation/facade/window_frame.dart
Platform channel
- Method-channel data source
lib/src/data/datasources/window_method_channel_data_source.dart - Channel contract
lib/src/data/constants/window_channel_contract.dart - Channel mappers
lib/src/data/mappers/window_channel_mappers.dart - Platform repository
lib/src/data/repositories/window_platform_repositories.dart
Native application
- Plugin composition root
windows/window_frame_plugin.cpp - Channel controller
windows/src/presentation/window_channel.cpp - Window use cases
windows/src/application/window_use_cases.cpp - Window session and options
windows/src/domain/window_models.h - Window ports
windows/src/domain/window_ports.h
Windows integration
- Message dispatcher
windows/src/infrastructure/win32/win32_message_pipeline.cpp - Window message handlers
windows/src/infrastructure/win32/win32_message_handlers.cpp - Win32 window gateway
windows/src/infrastructure/win32/win32_window_gateway.cpp - Native frame helpers
windows/src/infrastructure/win32/win32_frame.cpp
Other components
- Flutter app
- Windows window
Connections 24
- Flutter app → Frame scope: wraps app
README.md - Frame scope → Title bar: presents
README.md - Title bar controller → Bar content model: describes bar
README.md - Frame scope → Title bar controller: uses controller
README.md - Title bar → Caption buttons: shows buttons
README.md - Title bar → Drag and menus: offers interactions
README.md - Flutter app → Frame facade: initializes frame
README.md - Frame facade → Method-channel data source: sends commands
- Close coordinator → Method-channel data source: requests close
- Method-channel data source → Channel contract: uses contract
- Method-channel data source → Channel mappers: maps messages
- Platform repository → Method-channel data source: delegates calls
- Method-channel data source → Channel controller: invokes methods
README.md - Plugin composition root → Channel controller: registers channel
windows/window_frame_plugin.cpp - Plugin composition root → Message dispatcher: registers handlers
- Channel controller → Window use cases: dispatches commands
- Window use cases → Window ports: uses contracts
- Window session and options → Window use cases: holds session state
- Message dispatcher → Window message handlers: dispatches messages
- Window message handlers → Window use cases: synchronizes state
- Win32 window gateway → Window ports: implements gateway
- Win32 window gateway → Native frame helpers: uses frame helpers
windows/src/infrastructure/win32/win32_frame.cpp - Win32 window gateway → Windows window: controls window
- Window use cases → Win32 window gateway: controls window