Code Monkey home page Code Monkey logo

shubham-gupta-16 / multi_image_picker_view Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 24.0 372 KB

An image_picker based widget which helps to pick multiple images in a GridView which can also be reorderable.

Home Page: https://pub.dev/packages/multi_image_picker_view

License: MIT License

Dart 94.99% Kotlin 0.26% Swift 0.85% Objective-C 0.08% HTML 3.82%
dart flutter flutter-package flutterpackage imagepicker reorderable dartlang dartlanguage flutter-ui grid-view

multi_image_picker_view's Introduction

Multi Image Picker View Flutter

A complete widget which can easily pick multiple images from device and display them in UI. Also picked image can be re-ordered and removed easily.

🚀 LIVE DEMO OF EXAMPLE PROJECT: https://shubham-gupta-16.github.io/multi_image_picker_view/

preview

Features

  • Pick multiple images
  • Displayed in GridView
  • Reorder picked images just by dragging
  • Remove picked image
  • Limit max images
  • Fully customizable UI

Getting started

flutter pub add multi_image_picker_view

For image/file picker

flutter pub add image_picker

OR

flutter pub add file_picker

OR you can use any plugin to pick images/files.

pubspec.yaml

  multi_image_picker_view: # latest version

  image_picker: ^1.0.4
#  or
  file_picker: ^6.1.1

Usage

Define the controller

final controller = MultiImagePickerController(
    picker: (bool allowMultiple) async {
      // use image_picker or file_picker to pick images `pickImages`
      final pickedImages = await pickImages(allowMultiple);
      // convert the picked image list to `ImageFile` list and return it.
      return pickedImages.map((e) => convertToImageFile(e)).toList();
    }
);

OR

final controller = MultiImagePickerController(
    maxImages: 15,
    images: <ImageFile>[], // array of pre/default selected images
    picker: (bool allowMultiple) async {
      return await pickConvertedImages(allowMultiple);
    },
);

UI Implementation

MultiImagePickerView(
  controller: controller,
  padding: const EdgeInsets.all(10),
);

OR

MultiImagePickerView(
  controller: controller,
  bulder: (BuldContext context, ImageFile imageFile) {
    // here returning DefaultDraggableItemWidget. You can also return your custom widget as well.
    return DefaultDraggableItemWidget(
      imageFile: imageFile,
      boxDecoration:
        BoxDecoration(borderRadius: BorderRadius.circular(20)),
      closeButtonAlignment: Alignment.topLeft,
      fit: BoxFit.cover,
      closeButtonIcon:
        const Icon(Icons.delete_rounded, color: Colors.red),
      closeButtonBoxDecoration: null,
      showCloseButton: true,
      closeButtonMargin: const EdgeInsets.all(3),
      closeButtonPadding: const EdgeInsets.all(3),
    );
  },
  initialWidget: DefaultInitialWidget(
    centerWidget: Icon(Icons.image_search_outlined),
    backgroundColor: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
    margin: EdgeInsets.zero,
  ), // Use any Widget or DefaultInitialWidget. Use null to hide initial widget
  addMoreButton: DefaultAddMoreWidget(
    icon: Icon(Icons.image_search_outlined),
    backgroundColor: Theme.of(context).colorScheme.primaryColor.withOpacity(0.2),
  ), // Use any Widget or DefaultAddMoreWidget. Use null to hide add more button.
  gridDelegate: /* Your SliverGridDelegate */,
  draggable: /* true or false, images can be reordered by dragging by user or not, default true */,
  shrinkWrap: /* true or false, to control GridView's shrinkWrap */
  longPressDelayMilliseconds: /* time to press and hold to start dragging item */
  onDragBoxDecoration: /* BoxDecoration when item is dragging */,
  padding: /* GridView padding */
  
);

ImageFile

This package use ImageFile entity to represent one image or file. Inside picker method in MultiImagePickerController, pick your images/files and convert it to list of ImageFile object and then return it. The ImageFile consists of:

final imageFile = ImageFile(
  UniqueKey().toString(), // A unique key required to track it in grid view.
  name: fileName,
  extension: fileExtension,
  path: fileFullPath,
);

Note: The package have two Extension functions to convert XFile (image_picker plugin) and PlatformFile (image_picker plugin) to ImageFile object. final imageFile = convertXFileToImageFile(xFileObject); and final imageFile = convertPlatformFileToImageFile(platformFileObject);. This functions will help you to write your picker logic easily.

ImageFileView

The ImageFileView is a widget which is used to display Image using ImageFile object. This will work on web as well as mobile platforms.

child: ImageFileView(imageFile: imageFile),
child: ImageFileView(
  imageFile: imageFile,
  borderRadius: BorderRadius.circular(8),
  fit: BoxFit.cover,
  backgroundColor: Theme.of(context).colorScheme.background,
  errorBuilder: (BuildContext context, Object error, StackTrace? trace) {
    return MyCustomErrorWidget(imageFile: imageFile)
  } // if errorBuilder is null, default error widget is used.
),

Custom UI

GridView Draggable item

  • In builder, you can use either DefaultDraggableItemWidget or your full custom Widget. i.e.
builder: (context, imageFile) {
  return Stack(
    children: [
      Positioned.fill(child: ImageFileView(imageFile: imageFile)),
      Positioned(
        top: 4,
        right: 4,
        child: DraggableItemInkWell(
          borderRadius: BorderRadius.circular(2),
          onPressed: () => controller.removeImage(imageFile),
          child: Container(
            padding: const EdgeInsets.all(5),
            decoration: BoxDecoration(
              color: Theme.of(context).colorScheme.secondary.withOpacity(0.4),
              shape: BoxShape.circle,
            ),
            child: Icon(
              Icons.delete_forever_rounded,
              size: 18,
              color: Theme.of(context).colorScheme.background,
            ),
          ),
        ),
      ),
    ],
  );
},
  • The DraggableItemInkWell can be used instead of InkWell inside builder to handle proper clicks when using laptop touchpads.
  • ImageFileView is a custom widget to show the image using ImageFile.

Initial Widget

  • You can use either DefaultInitialWidget or Custom widget or null if you don't want to show initial widget.
initialWidget: DefaultInitialWidget(
  centerWidget: Icon(Icons.image_search_outlined),
  backgroundColor: Theme.of(context).colorScheme.secondary.withOpacity(0.05),
  margin: EdgeInsets.zero,
),

OR

initialWidget: SizedBox(
  height: 170,
  width: double.infinity,
  child: Center(
    child: ElevatedButton(
      child: const Text('Add Images'),
      onPressed: () {
        controller.pickImages();
      },
    ),
  ),
),

OR

initialWidget: null,

Initial Widget

  • You can use either DefaultInitialWidget or Custom widget or null if you don't want to show initial widget.
addMoreButton: DefaultAddMoreWidget(
  icon: Icon(Icons.image_search_outlined),
  backgroundColor: Theme.of(context).colorScheme.primary.withOpacity(0.2),
),

OR

addMoreButton: SizedBox(
  height: 170,
  width: double.infinity,
  child: Center(
    child: TextButton(
      style: TextButton.styleFrom(
        backgroundColor: Colors.blue.withOpacity(0.2),
        shape: const CircleBorder(),
      ),
      onPressed: controller.pickImages,
      child: const Padding(
        padding: EdgeInsets.all(10),
        child: Icon(
          Icons.add,
          color: Colors.blue,
          size: 30,
        ),
      ),
    ),
  ),
),

OR

addMoreButton: null,

Get Picked Images

Picked Images can be get from controller.

final images = controller.images; // return Iterable<ImageFile>
for (final image in images) {
  if (image.hasPath)
    request.addFile(File(image.path!));
  else 
    request.addFile(File.fromRawPath(image.bytes!));
}
request.send();

Also controller can perform more actions.

controller.pickImages();
controller.hasNoImages; // return bool
controller.maxImages; // return maxImages
controller.removeImage(imageFile); // remove image from the images
controller.clearImages(); // remove all images (clear selection)
controller.reOrderImage(oldIndex, newIndex); // reorder the image

Custom Examples

Check the example to access all the custom examples.

custom

Migrating <1.0.0 to >=1.0.0

Changes in MultiImagePickerController

  • Inbuilt image picker is removed. You have to provide your own image/file picker logic. This will provide you more controls over image/file picking. You have to pass your picker in MultiImagePickerController.
  • allowedImageTypes removed.
  • withData removed.
  • withReadStream removed.

Changes in MultiImagePickerView

  • addMoreBuilder is removed. Now use addMoreButton to define your custom Add More Button.
  • showAddMoreButton is removed. To hide the default Add More Button, pass null in addMoreButton field.
  • initialContainerBuilder is removed. Now use initialWidget to define your custom Initial Widget.
  • showInitialContainer is removed. To hide the default Initial Widget, pass null in initialWidget field.
  • itemBuilder is removed. Now use builder to define your custom Draggable item widget. You can now define different widget for different image (ImaegFile).
  • addMoreButtonTitle is removed. Use addMoreButton and pass DefaultAddMoreWidget with custom parameters.
  • addButtonTitle is removed. Use initialWidget and pass DefaultInitialWidget with custom parameters.
  • longPressDelayMilliseconds is added. This is used to define the press and hold duration to start dragging.
  • onChange is removed.
  • MultiImagePickerView.of(context) can be used inside anywhere in MultiImagePickerView get the instance of it's components. i.e. MultiImagePickerView.of(context).controller.pickImages().

My other flutter packages

  • view_model_x - An Android similar state management package (StateFlow and SharedFlow with ViewModel) which helps to implement MVVM pattern easily.

Support

shubhamgupta16

Contributors

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

multi_image_picker_view's People

Contributors

aryan-more avatar bennito254 avatar broderbluff avatar burhankhanzada avatar mrnancy avatar nadialvy avatar philemonchiro avatar rajshreeyoga avatar shubham-gupta-16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

multi_image_picker_view's Issues

how to get image added paths infinite as setstate is use how to get images path added or removed

bool _isSelectionToggled = false;

void toggleImageSelection(ImageFile imageFile) {
if (!_isSelectionToggled) {
setState(() {
if (selectedImages.contains(imageFile)) {
selectedImages.remove(imageFile);
} else {
selectedImages.add(imageFile);
}
_isSelectionToggled = true;
});
}
}

caling from build

builder: (context, imageFile) {
Future.microtask(() => handleImageSelection(imageFile));
return DefaultDraggableItemWidget(
imageFile: imageFile,
boxDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
),
closeButtonAlignment: Alignment.topLeft,
fit: BoxFit.cover,
closeButtonIcon:
const Icon(Icons.delete_rounded, color: Colors.red),
closeButtonBoxDecoration: null,
showCloseButton: true,
closeButtonMargin: const EdgeInsets.all(3),
closeButtonPadding: const EdgeInsets.all(3),
);
},

Remove button not working with laptop touchpad (web)

After adding some images, when trying to remove any image by clicking on the close icon, it not working. The item is not removed at all.
This is only happing with the touchpad. With the mouse, it works fine.

Misleading Name - Not a Regular Image Picker, it's a File Picker that Supports Image Files.

I found this package thinking it was exactly what I needed, implemented it, and then got extremely disappointed. I was expecting something like the image_picker package which uses the photo gallery on mobile devices but instead, this uses the files (at least on iOS, haven't tested it on Android). Since almost all photos on a mobile device are stored in the gallery I'd like to see that added as an option. This was a great package idea but the name is misleading.

Couldn't find the executable zenity in the path

OS: Manjaro Linux x86_64

Error Log:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Couldn't find the executable zenity in the path.
#0      isExecutableOnPath (package:file_picker/src/utils.dart:60:5)
<asynchronous suspension>
#1      FilePickerLinux._getPathToExecutable (package:file_picker/src/linux/file_picker_linux.dart:119:14)
<asynchronous suspension>
#2      FilePickerLinux.pickFiles (package:file_picker/src/linux/file_picker_linux.dart:22:31)
<asynchronous suspension>
#3      MultiImagePickerController.pickImages (package:multi_image_picker_view/src/multi_image_picker_controller.dart:39:32)
<asynchronous suspension>
#4      _MultiImagePickerViewState._pickImages (package:multi_image_picker_view/src/multi_image_picker_view.dart:124:20)
<asynchronous suspension>


Code:

  final controller = MultiImagePickerController();

// ...
                Material(
                  child: MultiImagePickerView(
                    controller: controller,
                    padding: const EdgeInsets.all(10),
                  ),
                ),

Scrollable.of() was called with a context that does not contain a Scrollable widget.

`The following assertion was thrown during a scheduler callback:
Scrollable.of() was called with a context that does not contain a Scrollable widget.

No Scrollable widget ancestor could be found starting from the context that was passed to Scrollable.of(). This can happen because you are using a widget that looks for a Scrollable ancestor, but no such ancestor exists.
The context used was:
ReorderableBuilder-[<'[GlobalKey#5c0ca]'>](state: _ReorderableBuilderState#8d722)
When the exception was thrown, this was the stack
#0 Scrollable.of.
package:flutter/…/widgets/scrollable.dart:336
#1 Scrollable.of
package:flutter/…/widgets/scrollable.dart:348
#2 _ReorderableBuilderState._scrollPixels
package:flutter_reorderable_grid_view/widgets/reorderable_builder.dart:625
#3 _ReorderableBuilderState._getOffset
package:flutter_reorderable_grid_view/widgets/reorderable_builder.dart:656
#4 _ReorderableBuilderState._handleCreated
package:flutter_reorderable_grid_view/widgets/reorderable_builder.dart:274
#5 _ReorderableDraggableState._callOnCreated
package:flutter_reorderable_grid_view/…/animated/reorderable_draggable.dart:185
#6 _ReorderableDraggableState._handleCreated.
package:flutter_reorderable_grid_view/…/animated/reorderable_draggable.dart:179
#7 SchedulerBinding._invokeFrameCallback
package:flutter/…/scheduler/binding.dart:1289
#8 SchedulerBinding.handleDrawFrame
package:flutter/…/scheduler/binding.dart:1227
#9 SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:1076
#10 _invoke (dart:ui/hooks.dart:145:13)
#11 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#12 _drawFrame (dart:ui/hooks.dart:112:31)`

FilePicker usage should change

In /lib/src/multi_image_picker_controller.dart line 41 you are using FileType.custom. Is there any specific reason for that?
In my case, on iOS, it seems to be causing the file picker to open iCloud instead of the image app.
I guess that you will be able to fix by changing the FileType from custom to image or media. Of couse the you would be forced to get rid of the custom extension filters.

Additional parameter for picker

It would be great to have the possibility to pass a custom dict (kwarg) to picker-method. Then we could implement an imageSource-selection-logic in onPressed-method of an addMoreButton and pass the argument to the picker-method to decide which picker to choose based on that argument.

  Future<bool> pickImages(params) async {  // additional params
    final pickedImages = await picker(maxImages > 1 ? true : false, params);  // pass params to picker
    if (pickedImages.isNotEmpty) {
      _addImages(pickedImages);
      notifyListeners();
      return true;
    }
    return false;
  }

Avoid adding same image multiple times

I would be nice to be able to add only images that havn't been added yet. At the moment it is possible to add the same image multiple times (identical name and image path).
Screenshot_1686914866

Changing addButtonTitle and addMoreButtonTitle has no effect

Changing addButtonTitle and addMoreButtonTitle has no effect.

My configuration:

MultiImagePickerView(
                  controller: _multiImagePickerController,
                  draggable: true,
                  showAddMoreButton: true,
                  showInitialContainer: true,
                  addButtonTitle: "test",
                  addMoreButtonTitle: "test2",
                  gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                    crossAxisCount: 2,
                    childAspectRatio: 1,
                  ),
                  onChange: (images) {
                    // callback to update images
                  },
                ),

The reason is that these parameters are not used in your source code.
see file: lib/src/multi_image_picker_view.dart - Line 100
Here "ADD IMAGES" is hardcoded. Please use addButtonTitle if it is set instead.
Same situation for "Add More" in Line 73 for addMoreButtonTitle

Duplicated key null found in children fail when upload photo

The following assertion was thrown building MultiImagePickerView(state: _MultiImagePickerViewState#048c0):
Duplicated key null found in children
'package:flutter_reorderable_grid_view/widgets/reorderable_builder.dart':
Failed assertion: line 162 pos 16: 'false'

Error: Unsupported operation: Platform._operatingSystem

I'm using Chrome on MacOS. Run by flutter run -d Chrome

backtrace:

Error: Unsupported operation: Platform._operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49      throw_
dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 244:5                   _operatingSystem
dart-sdk/lib/io/platform_impl.dart 56:40                                          get operatingSystem
dart-sdk/lib/io/platform.dart 64:45                                               get _operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 872:8   get
dart-sdk/lib/io/platform.dart 149:51                                              get isAndroid
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 872:8   get
packages/file_picker/src/file_picker.dart 50:18                                   _setPlatform
packages/file_picker/src/file_picker.dart 40:44                                   get _instance
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 872:8   get
packages/file_picker/src/file_picker.dart 42:37                                   get platform
packages/multi_image_picker_view/src/multi_image_picker_controller.dart 39:58     pickImages
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/multi_image_picker_view/src/multi_image_picker_controller.dart 38:26     pickImages
packages/yurun_ui/ui/profile/profile_edit_page.dart 87:61                         <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/yurun_ui/ui/profile/profile_edit_page.dart 86:28                         <fn>
packages/flutter/src/material/ink_well.dart 1096:21                               handleTap
packages/flutter/src/gestures/recognizer.dart 253:24                              invokeCallback
packages/flutter/src/gestures/tap.dart 627:11                                     handleTapUp
packages/flutter/src/gestures/tap.dart 306:5                                      [_checkUp]
packages/flutter/src/gestures/tap.dart 239:7                                      handlePrimaryPointer
packages/flutter/src/gestures/recognizer.dart 615:9                               handleEvent
packages/flutter/src/gestures/pointer_router.dart 98:12                           [_dispatch]
packages/flutter/src/gestures/pointer_router.dart 143:9                           <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart 21:13          forEach
packages/flutter/src/gestures/pointer_router.dart 141:17
[_dispatchEventToRoutes]
packages/flutter/src/gestures/pointer_router.dart 127:7                           route
packages/flutter/src/gestures/binding.dart 460:19                                 handleEvent
packages/flutter/src/gestures/binding.dart 440:14                                 dispatchEvent
packages/flutter/src/rendering/binding.dart 336:11                                dispatchEvent
packages/flutter/src/gestures/binding.dart 395:7
[_handlePointerEventImmediately]
packages/flutter/src/gestures/binding.dart 357:5                                  handlePointerEvent
packages/flutter/src/gestures/binding.dart 314:7
[_flushPointerEventQueue]
packages/flutter/src/gestures/binding.dart 295:7
[_handlePointerDataPacket]
lib/_engine/engine/platform_dispatcher.dart 1183:13                               invoke1
lib/_engine/engine/platform_dispatcher.dart 243:5
invokeOnPointerDataPacket
lib/_engine/engine/pointer_binding.dart 156:39                                    [_onPointerData]
lib/_engine/engine/pointer_binding.dart 689:20                                    <fn>
lib/_engine/engine/pointer_binding.dart 620:14                                    <fn>
lib/_engine/engine/pointer_binding.dart 303:16                                    loggedHandler
lib/_engine/engine/pointer_binding.dart 188:80                                    <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39  dcall

Only one image of multiple is shown

I have a production app, where on some devices selecting multiple images does not work as expected.
When i select two images then only one image is shown in the view. Even though the controller contains both images. When i delete the visible image, the second image is shown immediatly. It seems like the images are on top of each other. I discovered this issues only on a Cubot P80 with Android 13. I am using image_picker in my picker logic.

Here a screenshot after TWO images where selected.
Screenshot_20240729-144110

Add property so images can be saved with data

Please add a boolean flag to the MultiImagePickerView so that pickImages() can use the withData property. Without this it is not possible to upload images to FireStore as the default for this property is false.
/// manually pick images. i.e. on click on external button. /// this method open Image picking window. /// It returns [Future] of [bool], true if user has selected images. Future<bool> pickImages() async { FilePickerResult? result = await FilePicker.platform.pickFiles( withData: true, allowMultiple: this.maxImages > 1 ? true : false, type: FileType.custom, allowedExtensions: allowedImageTypes);

Flutter 3.22 release mode issue

When I run the example with Flutter 3.22 in release mode I can take/choose multiple images but only the last is shown.
When I delete the last image the previous image is shown. It's like the grid is collapsed to a stack.
With the latest flutter 3.19 it works as expected.

In this test I took 3 images, only one image is shown:
IMG_613D51D8158E-1

build error when add dependence to pubspec.yml

build error when add dependence to pubspec.yml

Help, thanks. i am a beginner about Flutter.
image

my flutter sdk version is 3.19
multi_image_picker_view version is 1.0.2

It is the detail error msg here.

../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/image_file_view/io_preview.dart:29:43: Error: The getter 'surfaceContainerHighest' isn't defined for the class 'ColorScheme'.
 - 'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../../dev/flutter/packages/flutter/lib/src/material/color_scheme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'surfaceContainerHighest'.
            Theme.of(context).colorScheme.surfaceContainerHighest,
                                          ^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/default_draggable_item_widget.dart:61:34: Error: The getter 'surfaceContainerHighest' isn't defined for the class 'ColorScheme'.
 - 'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../../dev/flutter/packages/flutter/lib/src/material/color_scheme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'surfaceContainerHighest'.
                                .surfaceContainerHighest
                                 ^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/default_initial_widget.dart:30:25: Error: The getter 'WidgetStateProperty' isn't defined for the class 'DefaultInitialWidget'.
 - 'DefaultInitialWidget' is from 'package:multi_image_picker_view/src/widgets/default_initial_widget.dart' ('../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/default_initial_widget.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WidgetStateProperty'.
          overlayColor: WidgetStateProperty.resolveWith((states) {
                        ^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/default_initial_widget.dart:31:33: Error: The getter 'WidgetState' isn't defined for the class 'DefaultInitialWidget'.
 - 'DefaultInitialWidget' is from 'package:multi_image_picker_view/src/widgets/default_initial_widget.dart' ('../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/default_initial_widget.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WidgetState'.
            if (states.contains(WidgetState.pressed)) {
                                ^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/draggable_item_ink_well.dart:11:9: Error: Type 'WidgetStateProperty' not found.
  final WidgetStateProperty<Color?>? overlayColor;
        ^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/multi_image_picker_view-1.0.2/lib/src/widgets/draggable_item_ink_well.dart:11:9: Error: 'WidgetStateProperty' isn't a type.
  final WidgetStateProperty<Color?>? overlayColor;
        ^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/caijq/dev/flutter/bin/flutter'' finished with non-zero exit value 1

help

I was wondering how to set it to open from recents instead of photos when using our component in ios
f86cd5e4614c7b2d7f1c6bd882472db

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.