Skip to content

Commit 57fbbb1

Browse files
committed
feat: refactor to use RenderObjects instead of widgets
1 parent 564e807 commit 57fbbb1

File tree

9 files changed

+230
-308
lines changed

9 files changed

+230
-308
lines changed

packages/desktop_drop/example/lib/main.dart

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,28 @@ class _ExampleDragTargetState extends State<ExampleDragTarget> {
5151
@override
5252
Widget build(BuildContext context) {
5353
return DropTarget(
54-
onDragDone: (detail) async {
54+
onDragDone: (files, location) async {
5555
setState(() {
56-
_list.addAll(detail.files);
56+
_list.addAll(files);
5757
});
5858

5959
debugPrint('onDragDone:');
60-
for (final file in detail.files) {
60+
for (final file in files) {
6161
debugPrint(' ${file.path} ${file.name}'
6262
' ${await file.lastModified()}'
6363
' ${await file.length()}'
6464
' ${file.mimeType}');
6565
}
6666
},
67-
onDragUpdated: (details) {
67+
onDragUpdated: (localPosition) {
6868
setState(() {
69-
offset = details.localPosition;
69+
offset = localPosition;
7070
});
7171
},
72-
onDragEntered: (detail) {
72+
onDragEntered: (localPosition) {
7373
setState(() {
7474
_dragging = true;
75-
offset = detail.localPosition;
75+
offset = localPosition;
7676
});
7777
},
7878
onDragExited: (detail) {
@@ -87,10 +87,7 @@ class _ExampleDragTargetState extends State<ExampleDragTarget> {
8787
color: _dragging ? Colors.blue.withOpacity(0.4) : Colors.black26,
8888
child: Stack(
8989
children: [
90-
if (_list.isEmpty)
91-
const Center(child: Text("Drop here"))
92-
else
93-
Text(_list.map((e) => e.path).join("\n")),
90+
if (_list.isEmpty) const Center(child: Text("Drop here")) else Text(_list.map((e) => e.path).join("\n")),
9491
if (offset != null)
9592
Align(
9693
alignment: Alignment.topRight,

packages/desktop_drop/example/macos/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ EXTERNAL SOURCES:
1515

1616
SPEC CHECKSUMS:
1717
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
18-
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
18+
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
1919

2020
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
2121

packages/desktop_drop/example/pubspec.lock

Lines changed: 39 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,63 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
9-
url: "https://pub.dev"
8+
url: "https://pub.dartlang.org"
109
source: hosted
11-
version: "2.10.0"
10+
version: "2.9.0"
1211
boolean_selector:
1312
dependency: transitive
1413
description:
1514
name: boolean_selector
16-
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17-
url: "https://pub.dev"
15+
url: "https://pub.dartlang.org"
1816
source: hosted
19-
version: "2.1.1"
17+
version: "2.1.0"
2018
characters:
2119
dependency: transitive
2220
description:
2321
name: characters
24-
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
25-
url: "https://pub.dev"
22+
url: "https://pub.dartlang.org"
2623
source: hosted
2724
version: "1.2.1"
2825
clock:
2926
dependency: transitive
3027
description:
3128
name: clock
32-
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33-
url: "https://pub.dev"
29+
url: "https://pub.dartlang.org"
3430
source: hosted
3531
version: "1.1.1"
3632
collection:
3733
dependency: transitive
3834
description:
3935
name: collection
40-
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
41-
url: "https://pub.dev"
36+
url: "https://pub.dartlang.org"
4237
source: hosted
43-
version: "1.17.0"
38+
version: "1.16.0"
4439
cross_file:
4540
dependency: "direct main"
4641
description:
4742
name: cross_file
48-
sha256: "552ffd2f851d4314958e6265452af1891959e00cd32b6d17452c5b836e27a0fa"
49-
url: "https://pub.dev"
43+
url: "https://pub.dartlang.org"
5044
source: hosted
51-
version: "0.3.2"
45+
version: "0.3.3+4"
5246
cupertino_icons:
5347
dependency: "direct main"
5448
description:
5549
name: cupertino_icons
56-
sha256: "486b7bc707424572cdf7bd7e812a0c146de3fd47ecadf070254cc60383f21dd8"
57-
url: "https://pub.dev"
50+
url: "https://pub.dartlang.org"
5851
source: hosted
59-
version: "1.0.3"
52+
version: "1.0.5"
6053
desktop_drop:
6154
dependency: "direct main"
6255
description:
6356
path: ".."
6457
relative: true
6558
source: path
66-
version: "0.4.0"
59+
version: "0.4.1"
6760
fake_async:
6861
dependency: transitive
6962
description:
7063
name: fake_async
71-
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
72-
url: "https://pub.dev"
64+
url: "https://pub.dartlang.org"
7365
source: hosted
7466
version: "1.3.1"
7567
flutter:
@@ -81,8 +73,7 @@ packages:
8173
dependency: "direct dev"
8274
description:
8375
name: flutter_lints
84-
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
85-
url: "https://pub.dev"
76+
url: "https://pub.dartlang.org"
8677
source: hosted
8778
version: "1.0.4"
8879
flutter_test:
@@ -99,48 +90,42 @@ packages:
9990
dependency: transitive
10091
description:
10192
name: js
102-
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
103-
url: "https://pub.dev"
93+
url: "https://pub.dartlang.org"
10494
source: hosted
105-
version: "0.6.5"
95+
version: "0.6.4"
10696
lints:
10797
dependency: transitive
10898
description:
10999
name: lints
110-
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
111-
url: "https://pub.dev"
100+
url: "https://pub.dartlang.org"
112101
source: hosted
113102
version: "1.0.1"
114103
matcher:
115104
dependency: transitive
116105
description:
117106
name: matcher
118-
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
119-
url: "https://pub.dev"
107+
url: "https://pub.dartlang.org"
120108
source: hosted
121-
version: "0.12.13"
109+
version: "0.12.12"
122110
material_color_utilities:
123111
dependency: transitive
124112
description:
125113
name: material_color_utilities
126-
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
127-
url: "https://pub.dev"
114+
url: "https://pub.dartlang.org"
128115
source: hosted
129-
version: "0.2.0"
116+
version: "0.1.5"
130117
meta:
131118
dependency: transitive
132119
description:
133120
name: meta
134-
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
135-
url: "https://pub.dev"
121+
url: "https://pub.dartlang.org"
136122
source: hosted
137123
version: "1.8.0"
138124
path:
139125
dependency: transitive
140126
description:
141127
name: path
142-
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
143-
url: "https://pub.dev"
128+
url: "https://pub.dartlang.org"
144129
source: hosted
145130
version: "1.8.2"
146131
sky_engine:
@@ -152,58 +137,51 @@ packages:
152137
dependency: transitive
153138
description:
154139
name: source_span
155-
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
156-
url: "https://pub.dev"
140+
url: "https://pub.dartlang.org"
157141
source: hosted
158-
version: "1.9.1"
142+
version: "1.9.0"
159143
stack_trace:
160144
dependency: transitive
161145
description:
162146
name: stack_trace
163-
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
164-
url: "https://pub.dev"
147+
url: "https://pub.dartlang.org"
165148
source: hosted
166-
version: "1.11.0"
149+
version: "1.10.0"
167150
stream_channel:
168151
dependency: transitive
169152
description:
170153
name: stream_channel
171-
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
172-
url: "https://pub.dev"
154+
url: "https://pub.dartlang.org"
173155
source: hosted
174-
version: "2.1.1"
156+
version: "2.1.0"
175157
string_scanner:
176158
dependency: transitive
177159
description:
178160
name: string_scanner
179-
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
180-
url: "https://pub.dev"
161+
url: "https://pub.dartlang.org"
181162
source: hosted
182-
version: "1.2.0"
163+
version: "1.1.1"
183164
term_glyph:
184165
dependency: transitive
185166
description:
186167
name: term_glyph
187-
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
188-
url: "https://pub.dev"
168+
url: "https://pub.dartlang.org"
189169
source: hosted
190170
version: "1.2.1"
191171
test_api:
192172
dependency: transitive
193173
description:
194174
name: test_api
195-
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
196-
url: "https://pub.dev"
175+
url: "https://pub.dartlang.org"
197176
source: hosted
198-
version: "0.4.16"
177+
version: "0.4.12"
199178
vector_math:
200179
dependency: transitive
201180
description:
202181
name: vector_math
203-
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
204-
url: "https://pub.dev"
182+
url: "https://pub.dartlang.org"
205183
source: hosted
206-
version: "2.1.4"
184+
version: "2.1.2"
207185
sdks:
208-
dart: ">=2.18.0 <3.0.0"
209-
flutter: ">=1.22.0"
186+
dart: ">=2.17.0 <3.0.0"
187+
flutter: ">=1.20.0"

0 commit comments

Comments
 (0)