Comments (3)
On this topic, I recently got a pretty solid "universal" drag going, using the window_size plugin (which supports all 3 desktop platforms).
This is some ugly code, and it's not quite perfect (dragging is not 1:1, more like 1:0.99), but it's really close:
onPointerMove: (d) async {
if (_ignoreNext) {
// Have to skip each 2nd event, cause flutter generates one when we move
_ignoreNext = false;
return;
}
_windowPos += d.delta * 2; // Note sure why we need to double this, but it gets us real close
Window.setWindowFrame(_windowPos & _windowSize);
_ignoreNext = true;
},
// Also called on each build:
void _updateWindowSize() async => _windowSize = (await Window.getWindowInfo()).frame.size;
Seems like there might be some opportunity to build on the base API's from WindowSize, and just add on what is really unique to this package (prefab'd Windows btns, maximize/minimize methods, and ability to hide native title bar). Though I think max/min probably best belong in the core as well, maybe we can try and land a PR for that.
We had to remove BitDojo for now just cause it prevents us from building on Web, but luckily this works ok across all platforms.
from bitsdojo_window.
Haven't had the chance to test this on a non-retina screen but I guess you'd might want to do:
_windowPos += d.delta * MediaQuery.of(context).devicePixelRatio;
Related issue: flutter/flutter#71680
from bitsdojo_window.
With regards to dragging, isn't the MoveWindow
widget enough for your use case @esDotDev ?
from bitsdojo_window.
Related Issues (20)
- How to set the window to be transparent but the internal components to be opaque ? HOT 1
- On linux, this library doesn't respect display scaling
- it seem code updated 3 week ago here, but pub.dev shows 8 month ago, so can't update from pub get HOT 2
- Please support win32^5.0.0 HOT 13
- appWindow.hide() behaviour changes from IDE to compiled EXE HOT 1
- Likely incompatibility with NSSM and WinSW
- please upgrade HOT 2
- Upgrade to win^5.0.6 HOT 7
- requires win32 ^3.0.0 HOT 1
- Is it possible to drag windows in mac os ? HOT 1
- Custom frame doesn't hide title bar completely when using flutter_acrylic HOT 1
- Doesn't work in Windows 11 HOT 4
- segfault on Linux within getAppWindowHandle HOT 2
- MACOSX_DEPLOYMENT_TARGET
- . HOT 4
- How to totally hide title bar(title and 3 buttons in left-top) in macos HOT 1
- Can't install bitsdojo HOT 3
- There were someone published v3, is this your work? HOT 3
- -
- dependencies issue when upgrading file_picker package HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitsdojo_window.