Skip to content

Commit ae72c11

Browse files
SaadArdatiBirjuVachhani
authored andcommitted
📝 Update docs & bump version to 0.4.0
1 parent 4933a32 commit ae72c11

File tree

7 files changed

+74
-11
lines changed

7 files changed

+74
-11
lines changed

docs/flutter_controller.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ transformable box externally with proper state management.
99

1010
To create a controller, you can use the `TransformableBoxController` class. It mirrors a lot of the observed parameters
1111
in the constructor excluding `contentBuilder`, `handleBuilder`, `handleTapSize`, `allowFlippingWhileResizing`,
12-
`movable`, `resizable`, `handleAlignment`, `hideHandlesWhenNotResizable`, and `allowContentFlipping` since these are
13-
accessibility and rendering features that are controlled at the Widget level.
12+
`movable`, `resizable`, `handleAlignment`, `enabledHandles`, `visibleHandles`, and `allowContentFlipping` since these
13+
are accessibility and rendering features that are controlled at the Widget level.
1414

1515
<Warning>When using a controller, you should move these parameters from your `TransformableBox` to the constructor of
16-
the `TransformableBoxController`: **_box_**, **_flip_**, **_clampingBox_**, **_constraints_**, and
16+
the `TransformableBoxController`: **_box_**, **_flip_**, **_clampingRect_**, **_constraints_**, and
1717
**_resizeModeResolver_**. These are all intrinsically managed by the controller. There must always be only one source
1818
of truth, either the `TransformableBox` or the `TransformableBoxController`, not both.</Warning>
1919

docs/flutter_resizing.mdx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ events respectively.
174174
);
175175
```
176176

177-
## Disable Resizing
177+
## Handle visibility
178178

179179
Resizing can be disabled completely by setting the `resizable` property to `false`.
180180

181-
```dart title="Resizable widget without resizing"
181+
```dart title="Disable resizing with the resizable bool"
182182
TransformableBox(
183183
rect: rect,
184184
flip: flip,
@@ -188,5 +188,34 @@ Resizing can be disabled completely by setting the `resizable` property to `fals
188188
);
189189
```
190190

191+
You can alternatively selectively hide handles by providing your own `visibleHandles` set.
192+
193+
```dart title="Using the visibleHandles set to hide handles"
194+
TransformableBox(
195+
rect: rect,
196+
flip: flip,
197+
visibleHandles: {HandlePosition.right, HandlePosition.bottom, HandlePosition.bottomRight},
198+
onChanged: (event) {...},
199+
contentBuilder: (context, rect, flip) {...},
200+
);
201+
```
202+
203+
## Handle Interaction
204+
205+
You can selectively disable handles but keep them visible at the same time by providing your own `enabledHandles` set.
206+
207+
```dart title="Using the enabledHandles set to disable handles"
208+
TransformableBox(
209+
rect: rect,
210+
flip: flip,
211+
enabledHandles: {HandlePosition.right, HandlePosition.bottom, HandlePosition.bottomRight},
212+
onChanged: (event) {...},
213+
contentBuilder: (context, rect, flip) {...},
214+
);
215+
```
216+
217+
<Info>You can provide an empty set to disable all the handles but keep them visible and vice versa.</Info>
218+
219+
191220
[boxTransform]: https://github.com/hyper-designed/box_transform/tree/main/packages/box_transform
192221
[transformableBox]: https://github.com/hyper-designed/box_transform/blob/main/packages/flutter_box_transform/lib/src/transformable_box.dart

docs/handles.mdx

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,46 @@ the interactive area is aligned to the center of box corner/side.
4141

4242
## Handle visibility
4343

44-
By default, handles will be hidden when `resizable` is set to `false`. This can be changed by setting
45-
`hideHandlesWhenNotResizable` to `false`.
44+
By default, handles will be hidden when `resizable` is set to `false`.
4645

47-
```dart title="Showing handles when box is not resizable"
46+
```dart title="Using the resizable boolean to hide handles"
4847
TransformableBox(
4948
rect: rect,
5049
flip: flip,
5150
resizable: false,
52-
hideHandlesWhenNotResizable: false,
5351
onChanged: (event) {...},
5452
contentBuilder: (context, rect, flip) {...},
5553
);
5654
```
5755

56+
You can alternatively selectively hide handles by providing your own `visibleHandles` set.
57+
58+
```dart title="Using the visibleHandles set to hide handles"
59+
TransformableBox(
60+
rect: rect,
61+
flip: flip,
62+
visibleHandles: {HandlePosition.right, HandlePosition.bottom, HandlePosition.bottomRight},
63+
onChanged: (event) {...},
64+
contentBuilder: (context, rect, flip) {...},
65+
);
66+
```
67+
68+
## Handle Interaction
69+
70+
You can selectively disable handles but keep them visible at the same time by providing your own `enabledHandles` set.
71+
72+
```dart title="Using the enabledHandles set to disable handles"
73+
TransformableBox(
74+
rect: rect,
75+
flip: flip,
76+
enabledHandles: {HandlePosition.right, HandlePosition.bottom, HandlePosition.bottomRight},
77+
onChanged: (event) {...},
78+
contentBuilder: (context, rect, flip) {...},
79+
);
80+
```
81+
82+
<Info>You can provide an empty set to disable all the handles but keep them visible and vice versa.</Info>
83+
5884
## Customizing the default handles
5985

6086
By default, `TransformableBox` uses `DefaultCornerHandle` and `DefaultSideHandle` to build the handles. You can

packages/box_transform/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.4.0
2+
- Fix stack overflow error when the clamping rect is smaller than the box rect.
3+
14
## 0.3.0
25

36
- Refactored the core logic to make it more readable, cleaner and easier to maintain.

packages/box_transform/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: box_transform
22
description: A pure dart implementation of advanced 2D box transformation with easy and simple API.
33

4-
version: 0.3.0
4+
version: 0.4.0
55

66
repository: https://github.com/hyper-designed/box_transform
77
homepage: https://github.com/hyper-designed/box_transform

packages/flutter_box_transform/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.4.0
2+
- [BREAKING]: Replace `hideHandlesWhenNotResizable` with `enabledHandles` and `visibleHandles`.
3+
- Replace the usage of Listener widgets with GestureDetectors in the TransformableBox.
4+
- Add new controls to the playground to reflect the new handle parameters.
5+
16
## 0.3.2
27

38
- Fix controller pattern not updating the UI when the controller is updated.

packages/flutter_box_transform/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_box_transform
22
description: A Flutter implementation of box_transform package that provides easy 2D box transform operations with advanced resizing of rect in UI.
33

4-
version: 0.3.2
4+
version: 0.4.0
55

66
repository: https://github.com/hyper-designed/box_transform
77
homepage: https://github.com/hyper-designed/box_transform

0 commit comments

Comments
 (0)