Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting a single image from Google Photos does not work #58

Closed
Boehrsi opened this issue Mar 21, 2019 · 5 comments
Closed

Selecting a single image from Google Photos does not work #58

Boehrsi opened this issue Mar 21, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@Boehrsi
Copy link

Boehrsi commented Mar 21, 2019

If FilePicker.getFilePath() is used and an image is added via the default file chooser + Google Photos an error occurs.

E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'String'
#0 FilePicker.getFile (package:file_picker/file_picker.dart:42:18)

The reason for this problem is Google Photos and not this plugin. Even if only one file is requested Google Photos returns a list of elements, with one entry. It seems like a good idea to verify the returned data and wrap it if necessary. I will attach a PR which fixes the problem.

@miguelpruivo
Copy link
Owner

Thank you for your input, can you post your full log and the steps to reproduce?

@miguelpruivo miguelpruivo added bug Something isn't working triage Further information is requested on hold labels Mar 21, 2019
@Boehrsi
Copy link
Author

Boehrsi commented Mar 21, 2019

Sure :)

Device: Samsung S7 with Android 8.0.0

  1. Call await FilePicker.getFilePath(type: fileType, fileExtension: extension);
  2. Select Google Photos (see Screenshot, fifth from the bottom)
  3. Select any image
  4. See error (see trace below)

Screenshot_20190321-144535_Files

Error:

2019-03-21 14:47:27.713 4484-4586/com.openxchange.oxtalk E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'FutureOr<String>'
#0      FilePicker.getFilePath (package:file_picker/file_picker.dart:35:7)
<asynchronous suspension>
#1      _BlocScreenState._getFilePath (package:justAnApp/src/some_code/just_a_file.dart:401:40)
<asynchronous suspension>
#2      _BlocScreenState._showAttachmentChooser.<anonymous closure>.<anonymous closure> (package:justAnApp/src/some_code/just_a_file.dart:371:28)
#3      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:513:14)
#4      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:568:30)
#5      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:120:24)
#6      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
#7      TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:204:7)
#8      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
#9      _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:20)
#10     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:192:22)
#11     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:149:7)
#12     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7)
#13     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7)
#14     _rootRunUnary (dart:async/zone.dart:1136:13)
#15     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#16     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#17     _invoke1 (dart:ui/hooks.dart:223:10)
#18     _dispatchPointerDataPacket (dart:ui/hooks.dart:144:5)

@miguelpruivo miguelpruivo added fixed on beta and removed triage Further information is requested on hold labels Mar 22, 2019
@miguelpruivo
Copy link
Owner

I've already fixed this in beta. Looking to deploy a version to pub dart with this and #56 fixed until the weekend.

Thank you for your feedback.

@Boehrsi
Copy link
Author

Boehrsi commented Mar 22, 2019

Okay nice thank you, have a nice weekend. 👍

@miguelpruivo
Copy link
Owner

Fixed on 1.3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants