multi-touch-canvas-with-flutter
Multi-touch Canvas with Flutter
If you ever wanted to create a canvas in Flutter that needs to be panned in any direction and allow zoom then you also probably tried to create a MultiGestureRecognizer or under a GestureDetector added onPanUpdate and onScaleUpdate and received an error because both can not work at the same time. Even if you have to GestureDetectors then you will still find it does not work how you want and one will always win.
This is the canvas rendering logic used in https://widget.studio
Multi Touch Goal
- Pan the canvas with two or more fingers
- Zoom the canvas with two fingers only (Pinch/Zoom)
- Single finger will interact with canvas object and detect selection
- Bonus trackpad support with similar results
In order to achieve this we need to use a Listener for the trackpad events and raw touch interactions and RawKeyboardListener for keyboard shortcuts.
Part 1 - Project Setup
More from rodydavis/skills
flutter-control-and-screenshot
Guide on how to control a Flutter app using flutter_driver via MCP and capture screenshots.
197how-to-build-a-native-cross-platform-project-with-flutter
Learn how to import `dart:html` and `dart:io` in the same Flutter project to create cross-platform plugins that work seamlessly on mobile and web.
59install-flutter-from-git
Install Flutter SDK via git clone and configure for all platforms
56how-to-build-a-webrtc-signal-server-with-pocketbase
Learn how to build a simple WebRTC video call application using PocketBase as a signaling server, enabling peer-to-peer communication with SQLite on the server and realtime updates via Server Sent Events.
55how-to-do-full-text-search-with-sqlite
Learn how to supercharge your SQLite databases with full-text search capabilities using the built-in fts5 extension, enabling efficient and powerful querying with the `MATCH` keyword.
55flutter-fastlane-one-click-beta
Deploy your Flutter app to the App Store and Google Play with ease using this step-by-step guide covering installation, project setup, Fastlane integration, and automated deployments with Automator.
55