Skip to content

Commit de13488

Browse files
committed
[desktop_drop] chore: update version to 0.6.0, migrate macOS to SPM, and improve code readability
1 parent 8d0b608 commit de13488

File tree

10 files changed

+21
-82
lines changed

10 files changed

+21
-82
lines changed

packages/desktop_drop/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ build/
1010

1111
*.iml
1212

13-
/pubspec.lock
13+
/pubspec.lock
14+
15+
.vscode

packages/desktop_drop/.vscode/settings.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

packages/desktop_drop/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.6.0
4+
5+
Migrate macOS to SPM, fix web build.
6+
7+
* https://github.com/MixinNetwork/flutter-plugins/pull/398
8+
* https://github.com/MixinNetwork/flutter-plugins/pull/399
9+
* https://github.com/MixinNetwork/flutter-plugins/pull/403
10+
311
## 0.5.0
412

513
* upgrade web version to 1.0.0

packages/desktop_drop/example/lib/main.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class MyApp extends StatelessWidget {
1919
final SharedPreferences prefs = await SharedPreferences.getInstance();
2020
String? jsonStr = prefs.getString("apple-bookmark");
2121
if (jsonStr == null) return;
22-
print(jsonStr);
22+
debugPrint(jsonStr);
2323
Map<String, dynamic> data = json.decode(jsonStr);
2424
String path = data["path"]! as String;
2525
String appleBookmarkStr = data["apple-bookmark"]! as String;
@@ -120,7 +120,7 @@ class ExampleDragTarget extends StatefulWidget {
120120

121121
class _ExampleDragTargetState extends State<ExampleDragTarget> {
122122
final List<XFile> _list = [];
123-
final List<DropItem> drop_files = [];
123+
final List<DropItem> dropFiles = [];
124124

125125
bool _dragging = false;
126126

@@ -146,7 +146,7 @@ class _ExampleDragTargetState extends State<ExampleDragTarget> {
146146
onDragDone: (detail) async {
147147
setState(() {
148148
_list.addAll(detail.files);
149-
drop_files.addAll(detail.files);
149+
dropFiles.addAll(detail.files);
150150
});
151151

152152
debugPrint('onDragDone:');
@@ -172,7 +172,7 @@ class _ExampleDragTargetState extends State<ExampleDragTarget> {
172172
child: Container(
173173
height: 200,
174174
width: 200,
175-
color: _dragging ? Colors.blue.withOpacity(0.4) : Colors.black26,
175+
color: _dragging ? Colors.blue.withValues(alpha: 0.4) : Colors.black26,
176176
child: Stack(
177177
children: [
178178
if (_list.isEmpty)
@@ -193,14 +193,14 @@ class _ExampleDragTargetState extends State<ExampleDragTarget> {
193193
child: TextButton(
194194
onPressed: () async {
195195
Map<String, String> data = {};
196-
data["path"] = drop_files[0].path;
196+
data["path"] = dropFiles[0].path;
197197

198198
String bookmark =
199-
base64.encode(drop_files[0].extraAppleBookmark!);
199+
base64.encode(dropFiles[0].extraAppleBookmark!);
200200
data["apple-bookmark"] = bookmark;
201201

202202
String jsonStr = json.encode(data);
203-
print(jsonStr);
203+
debugPrint(jsonStr);
204204
final SharedPreferences prefs =
205205
await SharedPreferences.getInstance();
206206
prefs.setString("apple-bookmark", jsonStr);

packages/desktop_drop/example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ packages:
6363
path: ".."
6464
relative: true
6565
source: path
66-
version: "0.5.1"
66+
version: "0.6.0"
6767
fake_async:
6868
dependency: transitive
6969
description:

packages/desktop_drop/lib/src/utils/platform.dart

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/desktop_drop/lib/src/utils/platform_web.dart

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/desktop_drop/macos/desktop_drop.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A new flutter plugin project.
1313
s.license = { :file => '../LICENSE' }
1414
s.author = { 'Your Company' => '[email protected]' }
1515
s.source = { :path => '.' }
16-
s.source_files = 'Classes/**/*'
16+
s.source_files = 'desktop_drop/Sources/desktop_drop/**/*.{h,m,swift}'
1717
s.dependency 'FlutterMacOS'
1818

1919
s.platform = :osx, '10.11'

packages/desktop_drop/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: desktop_drop
22
description: A plugin which allows user dragging files to your flutter desktop applications.
3-
version: 0.5.1
3+
version: 0.6.0
44
homepage: https://github.com/MixinNetwork/flutter-plugins/tree/main/packages/desktop_drop
55

66
environment:

packages/desktop_drop/test/desktop_drop_test.dart

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)