artflutter / multi_image_picker2

MIT License
11 stars 33 forks source link

Encounter an error when calling metadata #10

Open husen-hn opened 3 years ago

husen-hn commented 3 years ago

Bug Report

multi_image_picker version: 5.0.2

Is it happening on Android: Yes

Is it happening on iOS: not tested

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 4.2)
[✓] Android Studio (version 2020.3)
[✓] Android Studio (version 2020.3)
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Describe the bug Encounter error ‍‍type 'Future<dynamic>' is not a subtype of type 'FutureOr<Map<dynamic, dynamic>>' in type cast when calling metadata

List<Asset> _images = <Asset>[];
List<Asset> _selectet_images = <Asset>[];
_images = await MultiImagePicker.pickImages(
        maxImages: 300,
        enableCamera: true,
        selectedAssets: _selectet_images,
        cupertinoOptions: CupertinoOptions(
          takePhotoIcon: "chat",
          doneButtonTitle: "Fatto",
        ),
        materialOptions: MaterialOptions(
          actionBarColor: "#abcdef",
          actionBarTitle: "Example App",
          allViewTitle: "All Photos",
          useDetailsView: false,
          selectCircleStrokeColor: "#000000",
        ),
      );

var pr;
try {
    pr = await _images[0].metadata;
} catch (e) {
    print(e.toString());
}

DEBUG CONSOLE

type 'Future<dynamic>' is not a subtype of type 'FutureOr<Map<dynamic, dynamic>>' in type cast
Abdullahfoysal commented 3 years ago

facing same problem