google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.11k stars 608 forks source link

file_chooser window 10 2004 error #805

Closed zsytssk closed 4 years ago

zsytssk commented 4 years ago

run showSavePanel cause error, error message(showOpenPanel is the same):

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type 'bool' is not a subtype of type 'List<dynamic>?' in type cast
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:41)
<asynchronous suspension>
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
#2      MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:345:41)
#3      FileChooserChannelController.show (package:file_chooser/src/channel_controller.dart:149:34)
#4      showSavePanel (package:file_chooser/src/utilities.dart:63:8)
#5      pickFiles (package:my_app/utils.dart:10:5)
#6      _FileListState.onUpload (package:my_app/fileList.dart:15:5)
#7      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:993:19)
#8      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1111:38)
#9      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24)
#10     TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11)
#11     BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5)
#12     BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:222:7)
#13     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:476:9)
#14     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:77:12)
#15     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9)
#16     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
#17     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
#18     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
#19     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:370:19)
#20     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:350:22)
#21     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:269:11)
#22     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:305:7)
#23     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:240:7)
#24     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:213:7)
#25     _rootRunUnary (dart:async/zone.dart:1206:13)
#26     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#27     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#28     _invoke1 (dart:ui/hooks.dart:265:10)
#29     _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)

flutter doctor -v

[√] Flutter (Channel dev, 1.23.0-7.0.pre, on Microsoft Windows [Version 10.0.19041.508], locale zh-CN)
    • Flutter version 1.23.0-7.0.pre at D:\zsytssk\tool\flutter
    • Framework revision db6e2d8aa5 (2 weeks ago), 2020-09-25 06:47:03 -0400
    • Engine revision 3a73d073c8
    • Dart version 2.11.0 (build 2.11.0-161.0.dev)
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) 
    • Android SDK at C:\Users\zsy\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java       
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30523.141
    • Windows 10 SDK version 10.0.18362.0

[!] Android Studio (version 4.0)
    • Android Studio at D:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.50.0)
    • VS Code at C:\Users\zsy\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.15.0

[√] Connected device (1 available)
    • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19041.508]

! Doctor found issues in 1 category.
stuartmorgan commented 4 years ago

There is no codepath in the Windows plugin implementation that returns a boolean for those calls. Please provide the file_chooser entry from your pubspec.yaml, because I don't see how you could get this error with the current code.

zsytssk commented 4 years ago

code

image

stuartmorgan commented 4 years ago

The file_chooser package published on pub.dev is not part of this project. Please read its README, particularly the bold, all-caps part about not reporting issues with it to this repository.

If it doesn't work, you'll need to contact its maintainer. Alternately, you can use this project's version, rather than their fork, by following the directions for using plugins from this project.