Search categories, packages and repositories

flutter_box_transform cover
Package detailsv0.4.7

flutter_box_transform

A Flutter implementation of box_transform package that provides easy 2D box transform operations with advanced resizing of rect in UI.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
20.3K
Likes
123
Pub points
160

Install package

flutter pub add flutter_box_transform

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_box_transform is a Flutter package that enables precise 2D box transform operations, simplifying the manipulation of rectangular areas in UI layouts. It supports advanced resizing and geometric transformations of rects, making it ideal for dynamic UI elements, overlays, and interactive components. Built for cross-platform use, it works seamlessly across Android, iOS, Web, macOS, Windows, and Linux. The package provides intuitive APIs to adjust positions, scales, and rotations of boxes with minimal code. Designed for developers needing fine-grained control over visual layout geometry.

Use cases

  • Dynamic UI element positioning
  • Interactive overlay design
  • Responsive layout adjustments
  • Visual transformation of rectangles
  • Cross-platform UI consistency
  • Complex shape manipulation

Key features

  • 2D box transformation utilities
  • Advanced rect resizing
  • Cross-platform compatibility
  • Intuitive API for geometric operations
  • Supports scaling, rotation, and translation
  • Built-in alignment and offset handling

Suitable for

  • UI developers needing precise layout control
  • Designers implementing interactive interfaces
  • Developers working on responsive or animated layouts
  • Teams building cross-platform apps with complex visuals
  • Apps requiring real-time rectangle manipulation

Considerations

  • Requires understanding of 2D coordinate systems
  • Best suited for advanced layout scenarios
  • May add overhead for simple UI needs
  • Limited to rectangular transforms, not arbitrary shapes
  • Not intended for high-frequency animation loops

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Banner

Box Transform

Build Tests codecov

Box Transform provides packages that allows you to programmatically handle box resizing and dragging. It provides highly flexible, programmatically resizable and draggable boxes that can be used in any Dart or Flutter project.

Packages

Package Pub Description
box_transform Pub Version A pure Dart implementation for box transformation operations that does not rely on Flutter.
flutter_box_transform Pub Version A Flutter implementation that provides a flexible, customizable and easy to use interface tailored for Flutter projects.

Features

  • 📏 Dimension Constraining: Set maximum and minimum constraints to keep boxes within specific boundaries while resizing.
  • 🔁 Flipping Mechanics: Advanced positional-flipping when resizing hits extreme values with hard constraints.
  • 🔒 Drag Clamping: Specify clamping boxes to keep your transformable boxes within a specific region.
  • 🎨 Flexible Resizing Modes: Choose from four different resizing modes for more flexibility in how boxes are resized.
  • 📍 Customizable Anchor Points: Define resizing corner-handles to anchor different parts of the box when resizing.
  • 🎨 Customizable Handles: Use default resizing handles or define your own custom handles.
  • 🌀 Rotation Support: Rotate boxes around their center, with full rotated-aware drag, resize, flip, and clamping. Choose between BindingStrategy.originalBox (the unrotated logical rect stays in the clamp; rotated corners may extend outside) and BindingStrategy.boundingBox (the rendered axis-aligned footprint stays inside). Rotation gestures slide-then-freeze: when the requested angle would force the rect outside the clamp, the box slides into available slack first, then caps at the last feasible angle. Rotated force-flip also falls back to the natural direction when the flipped state can't fit, so the rect stays clamp-pinned instead of jumping or freezing.
  • 🚀 Easy Integration: Integrate Box Transform into your Dart or Flutter project with ease.

Getting Started

Go to the Getting Started page of the documentation to start using Box Transform.

Example App: box-transform-example.firebaseapp.com
Playground: box-transform-playground.firebaseapp.com

Documentation

Documentation is available at boxtransform.hyperdesigned.dev.

Contributing

See CONTRIBUTING.md for details.

See DEVELOPMENT.md for development setup.

Authors


Birju Vachhani

Saad Ardati

Feel free to join our Discord server for any inquiries or support!

License

Copyright © 2023 Hyperdesigned

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package