Skip to content

Commit c303e57

Browse files
committed
🔧 Update dependencies of examples & fix terminal resizing check to account for handle instead of cursor delta.
1 parent fbb1d28 commit c303e57

File tree

6 files changed

+23
-15
lines changed

6 files changed

+23
-15
lines changed

packages/box_transform/lib/src/enums.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ enum HandlePosition {
6565
bool get influencesBottomOrRight =>
6666
this == bottomRight || this == bottom || this == right;
6767

68+
/// Whether the handle is either on the left or right, or any diagonal side
69+
/// of the rect.
70+
bool get influencesHorizontal => isHorizontal || isDiagonal;
71+
72+
/// Whether the handle is either on the top or bottom, or any diagonal side
73+
/// of the rect.
74+
bool get influencesVertical => isVertical || isDiagonal;
75+
6876
/// Whether the handle is on the corner of the rect.
6977
bool get isDiagonal =>
7078
this == topLeft ||

packages/box_transform/lib/src/transformer.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class BoxTransformer {
171171
initialRect: initialRect,
172172
clampingRect: clampingRect,
173173
constraints: constraints,
174-
delta: delta,
174+
handle: handle,
175175
);
176176

177177
return ResizeResult(
@@ -203,13 +203,13 @@ class BoxTransformer {
203203
required Box initialRect,
204204
required Box clampingRect,
205205
required Constraints constraints,
206-
required Vector2 delta,
206+
required HandlePosition handle,
207207
}) {
208208
bool minWidthReached = false;
209209
bool maxWidthReached = false;
210210
bool minHeightReached = false;
211211
bool maxHeightReached = false;
212-
if (delta.x != 0) {
212+
if (handle.influencesHorizontal) {
213213
if (rect.width <= initialRect.width &&
214214
rect.width == constraints.minWidth) {
215215
minWidthReached = true;
@@ -220,14 +220,14 @@ class BoxTransformer {
220220
maxWidthReached = true;
221221
}
222222
}
223-
if (delta.y != 0) {
223+
if (handle.influencesVertical) {
224224
if (rect.height <= initialRect.height &&
225225
rect.height == constraints.minHeight) {
226226
minHeightReached = true;
227227
}
228228
if (rect.height >= initialRect.height &&
229-
rect.height == constraints.maxHeight ||
230-
rect.height == clampingRect.height) {
229+
(rect.height == constraints.maxHeight ||
230+
rect.height == clampingRect.height)) {
231231
maxHeightReached = true;
232232
}
233233
}

packages/flutter_box_transform/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
dev_dependencies:
1818
flutter_test:
1919
sdk: flutter
20-
flutter_lints: ^2.0.1
20+
flutter_lints: ^4.0.0
2121

2222
flutter:
2323
uses-material-design: true

packages/flutter_box_transform/playground/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
isa = PBXProject;
205205
attributes = {
206206
LastSwiftUpdateCheck = 0920;
207-
LastUpgradeCheck = 1300;
207+
LastUpgradeCheck = 1510;
208208
ORGANIZATIONNAME = "";
209209
TargetAttributes = {
210210
33CC10EC2044A3C60003C045 = {

packages/flutter_box_transform/playground/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

packages/flutter_box_transform/playground/pubspec.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ environment:
1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
adaptive_theme: ^3.2.1
15-
url_launcher: ^6.1.11
16-
provider: ^6.0.5
14+
adaptive_theme: ^3.6.0
15+
url_launcher: ^6.2.6
16+
provider: ^6.1.2
1717
equatable: ^2.0.5
18-
dart_style: ^2.3.1
18+
dart_style: ^2.3.6
1919
vector_math: ^2.1.4
20-
file_picker: ^5.2.11
20+
file_picker: ^8.0.3
2121
flutter_box_transform:
2222
path: ../
2323

2424
dev_dependencies:
2525
flutter_test:
2626
sdk: flutter
27-
flutter_lints: ^2.0.1
27+
flutter_lints: ^4.0.0
2828

2929
flutter:
3030
uses-material-design: true

0 commit comments

Comments
 (0)