Git Product home page Git Product logo

reorderable_grid_view's Introduction

ReorderableGridView

Copy from official ReorderableListView

Usage:

dependencies:
  reorderable_grid_view: ^2.2.6

Example

class _MyHomePageState extends State<MyHomePage> {
  final data = [1, 2, 3, 4, 5];

  @override
  Widget build(BuildContext context) {
    Widget buildItem(String text) {
      return Card(
        key: ValueKey(text),
        child: Text(text),
      );
    }

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),

      body: Center(
        // use ReorderableGridView.count() when version >= 2.0.0
        // else use ReorderableGridView()
        child: ReorderableGridView.count(
          crossAxisSpacing: 10,
          mainAxisSpacing: 10,
          crossAxisCount: 3,
          children: this.data.map((e) => buildItem("$e")).toList(),
          onReorder: (oldIndex, newIndex) {
            setState(() {
              final element = data.removeAt(oldIndex);
              data.insert(newIndex, element);
            });
          },
          footer: [
            Card(
              child: Center(
                child: Icon(Icons.add),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Options

option desc
dragWidgetBuilderV2 the drag widget builder
restrictDragScope restrict drag scope to ReorderableGridView, not drag over the scree, default is false
dragStartDelay the longPress time
scrollSpeedController control how speed when scroll down when drag out of viewport

dragWidgetBuilderV2

Normaly you can do like this:

dragWidgetBuilderV2: DragWidgetBuilderV2(
	isScreenshotDragWidget: false,
	builder: (index, child, screenshot) {
		return child;
	}
)
  • child is you dragging widget.

And if you dragging widget has some state, the callback's child can't access the state. So you can do a screenshot like this.

dragWidgetBuilderV2: DragWidgetBuilderV2(
	isScreenshotDragWidget: true,
	builder: (index, child, screenshot) {
		return Image(screenshot);
	}
)

Constructors

  • ReorderableGridView.builder
  • ReorderableGridView.count
  • ReorderableSliverGridView.count

custom reorderable

You can use ReorderableWrapperWidget to custom your reorderable. Use ReorderableWrapperWidget as root. and it's descendants is ReorderableItemView[] list

  • ReorderableWrapperWidget(child: SomeCollection(children: ReorderableItemView))

Important

  • the placeholderBuilder is not right when the list is very long, is not fixable for now. please see issue 47
  • can drag out of scope in ReorderableSliverGridView, please see issue 52

TODO

fix placeholderBuilder is not right when the list is very long

Other link project

If this project is not fit your meet, you can try those other projects

reorderable_grid_view's People

Stargazers

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

Watchers

 avatar  avatar

reorderable_grid_view's Issues

Request of dragging one item onto another and merge

Hi,

Thanks for the library. I have one request (if possible) is there a way to add an ability to drag one item and drop into other then it merges to into one (It's like in Android/iOS home screen where you can drag apps to folders or drag into another that it creates a folder)

Thanks in advance.

How to disable drag on some items of the grid ?

Hi,

we have a grid of 12 items, some of them have photos other are empty.

We want to allow only the items that have photos to be draggable and dropped only on other items that have photos as well!

Items that are just placeholders shouldn't move or be draggable. (example while uploading photos in dating or social apps like Tinder)

How to achieve this? (we know the indexes of the items that are empty and want to disable from the drag&drop mechanism)

Null check operator used on a null value

SDK version - sdk: ">=2.11.0 <3.0.0".
Maybe it occurs because of the version.
Like - bool isMoveLeft = _dropIndex! > _dragIndex!; for this one => !
How am I going to solve this one?

version 2.2.6 gives Warning: Operand of null-aware operation '??' has type 'Widget' which excludes null.

../../../src/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6/lib/src/drag_info.dart:150:12: Warning: Operand of null-aware operation '??' has type 'Widget' which excludes null.
 - 'Widget' is from 'package:flutter/src/widgets/framework.dart' ('../../../src/flutter/packages/flutter/lib/src/widgets/framework.dart').
    return rst ?? Container();

my Flutter Doctor gives,

[✓] Flutter (Channel stable, 2.10.4, on macOS 12.6.6 21G646 darwin-x64, locale en-PK)
  • Flutter version 2.10.4 at /Users/macbookpro/src/flutter
  • Upstream repository https://github.com/flutter/flutter.git
  • Framework revision c860cba910 (1 year, 4 months ago), 2022-03-25 00:23:12 -0500
  • Engine revision 57d3bac3dd
  • Dart version 2.16.2
  • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
  • Android SDK at /Users/macbookpro/Library/Android/sdk
  • Platform android-33, build-tools 33.0.0
  • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
  • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
  • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
  • Xcode at /Applications/Xcode.app/Contents/Developer
  • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
  • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
  • Android Studio at /Applications/Android Studio.app/Contents
  • Flutter plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/9212-flutter
  • Dart plugin can be installed from:
    🔨 https://plugins.jetbrains.com/plugin/6351-dart
  • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.78.2)
  • VS Code at /Users/macbookpro/Downloads/Visual Studio Code.app/Contents
  • Flutter extension can be installed from:
    🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
  • iPhone (mobile) • 00008020-001D0D0A2E88003A • ios            • iOS 16.5.1 20F75
  • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 115.0.5790.170

[✓] HTTP Host Availability
  • All required HTTP hosts are available

• No issues found!

physics property not found

when place this reorder widget inside SliverList, the scrolling does not work well when scrolling from this widget

Dynamic crossAxisCount

Is it possible to make a version of the constructor for ReorderableGridView where it would not be necessary to set the crossAxisCount, but this count was dynamic and dependent on the amount of free space allocated to this ReorderableGridView?

I think it should be possible.

Children do not get order update on reorder

Hi thanks for this really cool library.

I've been trying to implement this on my app, but I've encountered errors :

  • The reorder occurs in the variable (when I print after user reorder, the list is updated without issue
  • Refreshing the state of the app doesn't update the children's order.
  • So basically when I put tile 3 before tile 1 --> the list becomes [3,1,2] but the displayed tiles are still 1,2,3
  • On Flutter (Channel stable, 3.3.9), with reorderable_grid_view: ^2.2.5 or 2.2.6-alpha.3, on Android

This happens even on the pub.dev example your put out.
Am I forgetting something ? Or is it a bug because of the recent flutter version ?

Thanks !

Draggable bug for you should first drag down then up

Hi Dear,
I am developing the application that is not ready yet. In this time, I wanted to let you know the bug and maybe you could fix it.

  1. The bug is when you remove item to directly up, is not working. Firstly you should remove down then scrollable works.
  2. Another problem if there is much item like 15, draggable is not working correctly.
  3. Draggable let you out off the scope so you sometimes miss clicks.

I thank you much for such a perfect dependency. It's fixed really big problem with my application. I like to donate you guys in the future. You don't know how much I am appreciated.

Draggable_Bug.mp4

Change interaction to reorder

Hi there,

Instead of the long press to reorder elements, would it be possible to change it a simple tap. So a user doesn't have to tap and hold it for some time but taps and can drag it immediately.

I saw another package who had this: https://pub.dev/packages/flutter_draggable_gridview.

I don't want to switch to this package to achieve this, so it would be awesome if this was possible.

[Feature Request] Add itemBuilder and sliver support.

itemBuilder is very important feature, so we can build the items on demand, and not supply all the children at once.
sliver support is important as well, as if we can create custom scrolling experience. (Check SliverReorderableList).

Thanks for this amazing library! A very needed flutter capability indeed.

No header?

Can I add a header at the top of the List like the footer?

How to restrict dragging of widget inside a specific container or a prarent container & not allow dragging all over the phone screen ?

I want to restrict the dragging behaviour inside a container only but when we try to reorder here we can drag the widgets all over the screen.

Below is my widget tree

  • Column[Container(child : xyzWidget), Container( child : ReorderableGridView) ]

My requirment is if user wants to reorder the widgets of ReorderableGridView he should be able to drag only within ReorderableGridView's parent container, he should not be able to drag all over the phone screen.

Please suggest your answers

Thanks in advance

Null Safety

Please let us know what is the null safety support status for this plugin.

Thank you.

Remove trailling + button

Thank you for this wonderful package.

I was wondering what the purpose of the trailing + button was and how we could remove it?

Thanks.

Stopping multiple draggables from dragging at the same time

Please also provide a way to stop multiple draggables from dragging at the same time. For example, if I long-press a draggable to drag it, I can still long-press and drag the other draggables.

Current behavior:
multiple drags

Expected behavior:
Example of google keep notes:
no multiple drags

The offset is not right when draging grid_view

HI. I use your amazing package normally, until I add nested router in this.

And this is position incorrect when I draging the gridveiw item in our app.

1666924453595

But when I take off the nested router, it's work fine.

Add scrolling through the dragable

Great plugin but please also add a property for scrolling by dragging the draggable down in the gridview.

Current behavior:
Cannot scroll using the draggable:
draggable

Expected behavior:
Example of google keep notes:
draggable scroll

Thank you.

Can't rearrange 15 items

I have a very simple widget. Below is the code. And when I have 12 items, no errors, but if I have 15 and try to rearrange an item to the top row, I get a red screen showing error and I don't know why.
here is a video showing the error: demo

import 'package:flutter/material.dart';
import 'package: galleryin_folder_page.dart';
import 'package:gallery/resources/functions.dart';
import 'package:get/get.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:reorderable_grid_view/reorderable_grid_view.dart';

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  void initState() {
    super.initState();
    init();
  }

  List<AssetPathEntity> myList = [];
  Future<void> init() async {
    PhotoManager.clearFileCache();
    final PermissionState ps = await PhotoManager.requestPermissionExtend();
    if (ps.isAuth) {
      final List<AssetPathEntity> paths = await PhotoManager.getAssetPathList();
      setState(() {
        myList = paths.take(15).toList();
      });
    } else {
      // Limited(iOS) or Rejected, use `==` for more precise judgements.
      // You can call `PhotoManager.openSetting()` to open settings for further steps.
      PhotoManager.openSetting();
    }
  }

  @override
  Widget build(BuildContext context) {
    final t = Theme.of(context).colorScheme;
    return Scaffold(
      backgroundColor: t.background,
      appBar: AppBar(
        backgroundColor: t.primary,
        title: txts('Gallery', s: sh1, col: t.onPrimary),
      ),
      body: ReorderableGridView.count(
        crossAxisSpacing: 2,
        mainAxisSpacing: 2,
        crossAxisCount: 3,
        physics: const NeverScrollableScrollPhysics(),
        onReorder: (oldIndex, newIndex) {
          setState(() {
            final element = myList.removeAt(oldIndex);
            myList.insert(newIndex, element);
          });
        },
        children: myList.map((e) => buildItem(e)).toList(),
      ),
    );
  }

  Widget buildItem(AssetPathEntity e) {
    final t = Theme.of(context).colorScheme;
    return Card(
      key: ValueKey(e.name),
      child: InkWell(
        onTap: () => Get.to(() => InFolderPage(asset: e)),
        child: Container(
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(8),
            border: Border.all(color: t.primary),
          ),
          child: Text(e.name),
        ),
      ),
    );
  }
}

Modify the background while moving.

At the moment, the surrounding area around my grid child widget has some padding and background. I don't really want this there or at least want to make it semi transparent. Is there any way to remove this?

Expected a value of type 'RenderBox', but got one of type 'Null'

i think the issue is that am using a column and a flexible inside so whenever i start a dragging action it gives me the following Error:

Error: Expected a value of type 'RenderBox', but got one of type 'Null' at Object.throw_ [as throw] (http://localhost:59837/dart_sdk.js:5061:11) at Object.castError (http://localhost:59837/dart_sdk.js:5020:15) at Object.cast [as as] (http://localhost:59837/dart_sdk.js:5345:17) at Function.as_C [as as] (http://localhost:59837/dart_sdk.js:4966:19) at reorderable_wrapper_widget.ReorderableWrapperWidgetState.new.getPos (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:1036:34) at reorderable_wrapper_widget.ReorderableWrapperWidgetState.new.getOffsetInDrag (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:1080:25) at reorderable_item.ReorderableItemViewState.new.updateForGap (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:849:40) at reorderable_wrapper_widget.ReorderableWrapperWidgetState.new.updateDragTarget (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:1166:20) at updateDragTarget.next (<anonymous>) at runBody (http://localhost:59837/dart_sdk.js:38659:34) at Object._async [as async] (http://localhost:59837/dart_sdk.js:38690:7) at reorderable_wrapper_widget.ReorderableWrapperWidgetState.new.updateDragTarget (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:1161:22) at reorderable_wrapper_widget.ReorderableWrapperWidgetState.new.[_onDragUpdate] (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:1096:14) at drag_info.DragInfo.new.update (http://localhost:59837/packages/reorderable_grid_view/src/sliver_grid_with_reorderable_pos_delegate.dart.lib.js:563:27) at multidrag._DelayedPointerState.new.[_move] (http://localhost:59837/packages/flutter/src/gestures/multidrag.dart.lib.js:92:39) at multidrag.DelayedMultiDragGestureRecognizer.new.[_handleEvent] (http://localhost:59837/packages/flutter/src/gestures/multidrag.dart.lib.js:228:21) at pointer_router.PointerRouter.new.[_dispatch] (http://localhost:59837/packages/flutter/src/gestures/pointer_router.dart.lib.js:85:9) at http://localhost:59837/packages/flutter/src/gestures/pointer_router.dart.lib.js:115:26 at LinkedMap.new.forEach (http://localhost:59837/dart_sdk.js:26433:11) at pointer_router.PointerRouter.new.[_dispatchEventToRoutes] (http://localhost:59837/packages/flutter/src/gestures/pointer_router.dart.lib.js:113:29) at pointer_router.PointerRouter.new.route (http://localhost:59837/packages/flutter/src/gestures/pointer_router.dart.lib.js:108:37) at binding$5.WidgetsFlutterBinding.new.handleEvent (http://localhost:59837/packages/flutter/src/gestures/binding.dart.lib.js:362:26) at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:59837/packages/flutter/src/gestures/binding.dart.lib.js:347:24) at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:59837/packages/flutter/src/rendering/layer.dart.lib.js:5118:13) at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately] (http://localhost:59837/packages/flutter/src/gestures/binding.dart.lib.js:321:14) at binding$5.WidgetsFlutterBinding.new.handlePointerEvent (http://localhost:59837/packages/flutter/src/gestures/binding.dart.lib.js:295:43) at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (http://localhost:59837/packages/flutter/src/gestures/binding.dart.lib.js:285:14) at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (http://localhost:59837/packages/flutter/src/gestures/binding.dart.lib.js:276:54) at Object.invoke1 (http://localhost:59837/dart_sdk.js:179667:7) at _engine.EnginePlatformDispatcher.__.invokeOnPointerDataPacket (http://localhost:59837/dart_sdk.js:160119:15) at _engine.PointerBinding.__.[_onPointerData] (http://localhost:59837/dart_sdk.js:160965:49) at http://localhost:59837/dart_sdk.js:161373:26 at http://localhost:59837/dart_sdk.js:161340:16 at loggedHandler (http://localhost:59837/dart_sdk.js:161058:11)
Sample code with the problem

@OverRide
Widget build(BuildContext context) {
///
///Builds a single tile widget
Widget buildTile(HomePageTile tile) {
return GestureDetector(
key: ValueKey(tile.id),
onTap: () => navigateFromTiles(tile.id, context),
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(10)),
color: tile.backgroundColor,
shape: BoxShape.rectangle,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
tile.tileIcon,
size: 40,
color: Colors.grey[800],
),
],
),
),
Text(
tile.name,
style: Theme.of(context).textTheme.subtitle1!.copyWith(
color: Colors.grey[800], fontWeight: FontWeight.bold),
),
]),
),
);
}

/// when the reorder completes remove the list entry from its old position
/// and insert it at its new index
void _onReorder(int oldIndex, int newIndex) {
  setState(() {
    final item = widget.features.removeAt(oldIndex);
    widget.features.insert(newIndex, item);
  });
}
return ReorderableGridView.count(
  padding: const EdgeInsets.all(10),
  childAspectRatio: 1.7,
  crossAxisSpacing: 10,
  mainAxisSpacing: 10,
  crossAxisCount: 2,
  children: List.generate(widget.features.length,
          (index) => buildTile(widget.features[index])),
  onReorder: _onReorder,
  footer: [buildTile(addTile)],
);

}
}

Error while adding list of grid view widget('package:reorderable_grid_view/reorderable_grid_view.dart': Failed assertion: line 192 pos 12: 'toWrap.key != null': is not true.)

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building ReorderableGridView(dirty, dependencies: [_EffectiveTickerMode], state: _ReorderableGridViewState#af733(tickers: tracking 1 ticker)):
'package:reorderable_grid_view/reorderable_grid_view.dart': Failed assertion: line 192 pos 12: 'toWrap.key != null': is not true.

The relevant error-causing widget was:
ReorderableGridView file:///D:/workspace/ziya_launcher/lib/main.dart:54:21
When the exception was thrown, this was the stack:
#2 _ReorderableGridViewState._wrap (package:reorderable_grid_view/reorderable_grid_view.dart:192:12)
#3 _ReorderableGridViewState.build (package:reorderable_grid_view/reorderable_grid_view.dart:341:20)
#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4691:27)
#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)
#6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

Placeholder doesn't work during scrolling through dragging

The provided placeholder doesn't work during scrolling through dragging.

screen-20221014-202154.2.mp4

I found that the _dragging variable in ReorderableItemViewState from reorderable_item.dart only becomes true for elements that were visible at the start of drag but after continuous scrolling, through drag, it never becomes true for the newly generated elements by the builder.

I was unable to resolve that as I'm very unfamiliar with the code.

Thank you.

ReorderableGridView of fixed dimensions, no scroll

Is there a way I can create a Grid of fixed size? I don't want scroll behavior. For example, if I have N widgets and A width and B height from the parent, then the ReorderableGridView allocates exactly A/N by B/N to each child?

[Feature Request] Allow drag and drop between groups

My requirement is that I need the drag and drop capability between groups.
Requirements:

  • Drag and drop items between two grids (groups).
  • Callback to will receive SourceInfo{list, index} and DestinationInfo{list, index}

Regards
Kayes

In flutter 3.0.1 it is giving error

this is the error:

════════ Exception caught by widgets library ═══════════════════════════════════
The following _CastError was thrown building:
Null check operator used on a null value

When the exception was thrown, this was the stack
#0      new ReorderableGridView.builder.<anonymous closure> (package:reorderable_grid_view/reorderable_grid_view.dart:108:64)

Note: in gridview.build everything is working fine

How do I remove the shadow?

Hi !

Problem

I'm using your implementation in my app and realy like your work! Is there a way to solve this? When I drag & drop my custom widgets.
There is always an widget below mine that looks like a square and has it's own shadow.

Is there a way to hide this shadow and or make the widget transparent?

drag drop

Dragging rounded widget adds rectangular white container

Hey, I have a grid of items which has rounded corners. When dragging the widget the widget is wrapped in a rectangular white container. Is there a way to override the wrapped widget decoration/style?

Example (right picture is dragged)
obraz

Expected 0 type arguments.

got this error:

../../AppData/Local/Android/FlutterSDK/2.5/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-1.1.0/lib/reorderable_grid_view.dart:107:7: Error: Expected 0 type arguments.
      MultiDragGestureRecognizer<MultiDragPointerState> recognizer) {
      ^
../../AppData/Local/Android/FlutterSDK/2.5/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-1.1.0/lib/reorderable_grid_view.dart:450:3: Error: Expected 0 type arguments.
  MultiDragGestureRecognizer<MultiDragPointerState> _createDragRecognizer() {
```

enviroment:
flutter sdk: 2.5.1
dart sdk: 2.14.2

Setting childAspectRatio to lower than 1 is causing weird reorder animation

Hello, when I try to set childAspectRatio to lower than 1 then the reorder animation is not aligned and the reordered widgets are overlapping.
Also, the childAspectRatio property is very important for me because without it we will get overflow issues when trying to create bigger widgets in gridview.

Here is the sample video showcasing the issue:
Android Emulator - New_Device_API_30_5554 2021-07-26 01-23-05

ScrollableState is nullable bug

Hello Dear,

I just got upgrade and I get below build error right now.

Thank You


../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:93:29: Error: A value of type 'ScrollableState?' can't be assigned to a variable of type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
 - 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
    scrollable = Scrollable.of(item.context);
                            ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:153:19: Error: A value of type 'OverlayState?' can't be returned from a function with return type 'OverlayState' because 'OverlayState?' is nullable and 'OverlayState' isn't.
 - 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/overlay.dart').
    return overlay?? Overlay.of(context);
                  ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:93:29: Error: A value of type 'ScrollableState?' can't be assigned to a variable of type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
 - 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
    scrollable = Scrollable.of(item.context);
                            ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:153:19: Error: A value of type 'OverlayState?' can't be returned from a function with return type 'OverlayState' because 'OverlayState?' is nullable and 'OverlayState' isn't.
 - 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/overlay.dart').
    return overlay?? Overlay.of(context);
                  ^
Restarted application in 690ms.
Unhandled exception:
Null check operator used on a null value
#0      IncrementalCompiler.compileExpression.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:1944:69)
#1      CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#2      new Future.sync (dart:async/future.dart:302:31)
#3      CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#4      _rootRun (dart:async/zone.dart:1391:13)
#5      _CustomZone.run (dart:async/zone.dart:1293:19)
#6      _runZoned (dart:async/zone.dart:1829:10)
#7      runZoned (dart:async/zone.dart:1751:10)
#8      CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#9      IncrementalCompiler.compileExpression (package:front_end/src/fasta/incremental_compiler.dart:1822:26)
#10     IncrementalCompiler.compileExpression (package:vm/incremental_compiler.dart:237:23)
#11     FrontendCompiler.compileExpression (package:frontend_server/frontend_server.dart:875:44)
#12     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1307:20)
#13     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#14     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#15     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#16     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#17     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#18     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#19     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:170:13)
#20     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:145:5)
#21     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#22     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#23     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#24     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#25     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#26     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#27     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#28     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#29     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
#30     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)
#31     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#32     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#33     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#34     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#35     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#36     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#37     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#38     _StreamController._add (dart:async/stream_controller.dart:648:7)
#39     _StreamController.add (dart:async/stream_controller.dart:596:5)
#40     _Socket._onData (dart:io-patch/socket_patch.dart:2324:41)
#41     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#42     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#43     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#44     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#45     _StreamController._add (dart:async/stream_controller.dart:648:7)
#46     _StreamController.add (dart:async/stream_controller.dart:596:5)
#47     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1849:33)
#48     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14)
#49     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#50     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#51     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#52     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)
the Dart compiler exited unexpectedly.
the Dart compiler exited unexpectedly.

[Issue] Permanent overlay of the dragable on App

Hello,
I am experiencing a bug where, if I press two draggables simultaneously, it causes a permanent overlay of the draggable on the application. And this only happens in the release apk.
I'm attaching a video showcasing the issue:

issue_Trim.mp4

Thank you.

Is there a way to customise elevation?

Currently have cards that have a border radius and would like to have a bool on elevation to turn it off as currently the elevation makes the card's UI look Strange.

Can this package automatically reorder with animation when data source is changed?

In my app, I don't need the user to reorder the contents but they are done when some filters are enabled.

Use case:

Grids show cars.
When user presses red color, I want to show only the red colored cars
And I want this filtering to happen in an animated way.
So there might be several cars that are removed from different places of the cars array.
When the filter is removed, all cars should be added in place with ordering animation.

Can I use this package for this need?

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.