File tree Expand file tree Collapse file tree 7 files changed +24
-11
lines changed Expand file tree Collapse file tree 7 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import 'package:desktop_drop/desktop_drop.dart';
66import 'package:flutter/foundation.dart' ;
77import 'package:flutter/material.dart' ;
88import 'package:shared_preferences/shared_preferences.dart' ;
9+ import 'package:universal_platform/universal_platform.dart' ;
910
1011void main () {
1112 runApp (const MyApp ());
@@ -75,7 +76,7 @@ class MyApp extends StatelessWidget {
7576 const ExampleDragTarget (),
7677 const ExampleDragTarget (),
7778 const ExampleDragTarget (),
78- if (Platform .isMacOS)
79+ if (UniversalPlatform .isMacOS)
7980 StatefulBuilder (builder: (context, setState) {
8081 return Column (
8182 children: [
@@ -186,7 +187,7 @@ class _ExampleDragTargetState extends State<ExampleDragTarget> {
186187 style: Theme .of (context).textTheme.bodySmall,
187188 ),
188189 ),
189- if (_list.isNotEmpty && Platform .isMacOS)
190+ if (_list.isNotEmpty && UniversalPlatform .isMacOS)
190191 Align (
191192 alignment: Alignment .bottomRight,
192193 child: TextButton (
Original file line number Diff line number Diff line change @@ -324,6 +324,14 @@ packages:
324324 url: "https://pub.dev"
325325 source: hosted
326326 version: "0.7.4"
327+ universal_platform:
328+ dependency: "direct main"
329+ description:
330+ name: universal_platform
331+ sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec"
332+ url: "https://pub.dev"
333+ source: hosted
334+ version: "1.1.0"
327335 vector_math:
328336 dependency: transitive
329337 description:
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ dependencies:
1919 cross_file : ^0.3.2
2020 cupertino_icons : ^1.0.2
2121 shared_preferences : ^2.2.3
22+ universal_platform :
2223
2324dev_dependencies :
2425 flutter_test :
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import 'dart:convert';
33import 'package:desktop_drop/src/drop_item.dart' ;
44import 'package:flutter/services.dart' ;
55import 'package:flutter/widgets.dart' ;
6+ import 'package:universal_platform/universal_platform.dart' ;
67
78import 'events.dart' ;
89import 'utils/platform.dart'
@@ -65,7 +66,7 @@ class DesktopDrop {
6566 _notifyEvent (DropEnterEvent (location: _offset! ));
6667 break ;
6768 case "updated" :
68- if (_offset == null && Platform .isLinux) {
69+ if (_offset == null && UniversalPlatform .isLinux) {
6970 final position = (call.arguments as List ).cast <double >();
7071 _offset = Offset (position[0 ], position[1 ]);
7172 _notifyEvent (DropEnterEvent (location: _offset! ));
Original file line number Diff line number Diff line change 11import 'package:flutter/widgets.dart' ;
2+ import 'package:universal_platform/universal_platform.dart' ;
23
34import 'channel.dart' ;
45import 'drop_item.dart' ;
@@ -155,7 +156,7 @@ class _DropTargetState extends State<DropTarget> {
155156 localLocation: position,
156157 );
157158 } else if (event is DropDoneEvent &&
158- (_status != _DragTargetStatus .idle || Platform .isLinux) &&
159+ (_status != _DragTargetStatus .idle || UniversalPlatform .isLinux) &&
159160 inBounds) {
160161 _updateStatus (
161162 _DragTargetStatus .idle,
@@ -211,7 +212,7 @@ class _DropTargetState extends State<DropTarget> {
211212}
212213
213214Offset _scaleHoverPoint (BuildContext context, Offset point) {
214- if (Platform .isWindows || Platform .isAndroid) {
215+ if (UniversalPlatform .isWindows || UniversalPlatform .isAndroid) {
215216 return point.scale (
216217 1 / MediaQuery .of (context).devicePixelRatio,
217218 1 / MediaQuery .of (context).devicePixelRatio,
Original file line number Diff line number Diff line change 1- import 'dart:io' as io ;
1+ import 'package:universal_platform/universal_platform.dart' ;
22
33class Platform {
4- static bool get isLinux => io. Platform .isLinux;
4+ static bool get isLinux => UniversalPlatform .isLinux;
55
6- static bool get isWindows => io. Platform .isWindows;
6+ static bool get isWindows => UniversalPlatform .isWindows;
77
8- static bool get isWeb => false ;
8+ static bool get isWeb => UniversalPlatform .isWeb ;
99
10- static bool get isAndroid => io. Platform .isAndroid;
10+ static bool get isAndroid => UniversalPlatform .isAndroid;
1111}
Original file line number Diff line number Diff line change 11name : desktop_drop
22description : A plugin which allows user dragging files to your flutter desktop applications.
3- version : 0.5.0
3+ version : 0.5.1
44homepage : https://github.com/MixinNetwork/flutter-plugins/tree/main/packages/desktop_drop
55
66environment :
@@ -14,6 +14,7 @@ dependencies:
1414 sdk : flutter
1515 cross_file : ^0.3.4+2
1616 web : ^1.1.1
17+ universal_platform : ^1.1.0
1718
1819dev_dependencies :
1920 flutter_test :
You can’t perform that action at this time.
0 commit comments