feat: Add dragRegionBuilder to TabView for Borderless Window Dragging#1240
feat: Add dragRegionBuilder to TabView for Borderless Window Dragging#1240uiYzzi wants to merge 3 commits intobdlukaa:masterfrom
Conversation
The TabView component has a new parameter dragRegionBuilder, allowing the creation of a draggable area in the blank area of the tab bar, which facilitates the dragging operation of borderless windows. At the same time, the macOS project configuration and dependency versions have been updated. Test cases have been added to verify the functionality of the custom drag area builder and the handling of null values. Example code has been updated to demonstrate the use of the new feature.
Remove excess blank lines in test files and adjust the format of code snippets to improve readability.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new dragRegionBuilder property to the TabView component to enable borderless window dragging functionality, allowing the entire tab strip area to serve as a drag region for window management.
- Added
dragRegionBuilderproperty toTabViewwith appropriate documentation and debug information - Modified the build logic to apply the drag region builder to the entire tab strip while maintaining compatibility with existing
stripBuilder - Updated example app to demonstrate the new functionality with
DragToMoveAreaintegration
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/src/controls/navigation/tab_view/tab_view.dart | Core implementation adding dragRegionBuilder property and build logic |
| test/tab_view_test.dart | Added comprehensive tests for the new functionality and null handling |
| example/lib/screens/navigation/tab_view.dart | Updated example to showcase borderless window dragging with practical usage |
| example/macos/Runner/AppDelegate.swift | Updated macOS configuration for modern Swift conventions |
| example/macos/Runner.xcodeproj/project.pbxproj | Xcode project version updates |
| example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Xcode scheme configuration updates |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Example: TabView(
tabs: tabs,
stripBuilder: (context, strip) => DragToMoveArea(child: strip),
reservedStripWidth: 34,
...
); |
Using |

This PR introduces a new
dragRegionBuilderproperty to theTabViewcomponent, allowing developers to easily implement window dragging functionality in borderless window applications.Changes Made
Core Implementation:
dragRegionBuilderproperty toTabViewclass inlib/src/controls/navigation/tab_view/tab_view.dartstripBuilderfunctionalityDocumentation & Examples:
example/lib/screens/navigation/tab_view.dartwith practical usage demonstrationTesting:
test/tab_view_test.dartRelated Issue
#1239
Usage Example
Pre-launch Checklist
CHANGELOG.mdwith my changes