norbert515 / flutter_list_drag_and_drop Goto Github PK
View Code? Open in Web Editor NEWAn implementation of drag and drop for lists
License: MIT License
An implementation of drag and drop for lists
License: MIT License
If you could please show an example that uses a List of Firebase document snapshots that come in a stream, that would be really helpful.
With a regular itemBuilder for a ListView.builder, I can specify the index for the List of snapshots. the itemBuilder property for your draggable list only takes an item.
When a listview only contain one item, it will error when drag it .
for example in rn :https://rationalappdev.com/drag-and-drop-tags-in-react-native-part-2-of-2/
Hi Norbert ,
Your Widget works very well.
Any news for the horizontal Scrolling ?
According to my investigations, a new version of "drag_target.dart" will soon be made available and will include the notion of axis constraints (see last merge)
Hope to see your next version soon ...
import 'package:flutter/material.dart';
import 'package:flutter_list_drag_and_drop/drag_and_drop_list.dart';
void main() {
runApp(new TestApp());
}
class TestApp extends StatelessWidget {
TestApp({Key key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue, primaryColor: new Color(0xffd05c6b)),
home: new MyHomePage(
title: 'Flutter Demo Home Page',
key: key,
),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
MyHomePageState createState() => new MyHomePageState();
}
class MyHomePageState extends State<MyHomePage> {
List<String> items = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
];
void add (){
setState(() {
items.add('value');
});
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new DragAndDropList<String>(
items,
itemBuilder: (BuildContext context, item) {
return new SizedBox(
child: new Card(
child: new ListTile(
title: new Text(item),
),
),
);
},
onDragFinish: (before, after) {
String data = items[before];
items.removeAt(before);
items.insert(after, data);
},
canAccept: (one, two) => true,
dragElevation: 18.0,
),
floatingActionButton: new FloatingActionButton(
onPressed: add,
child: new Icon(Icons.add),
)
);
}
}
Hi @Norbert515
Thanks for creating this great and easy to use widget!
One thing I've run into is that putting a DragAndDropList inside another scrolling container gives an unbounded height error.
Maybe you could expose the Shrinkwrap property in ListView.builder?
Btw: Futter's ReorderableListView has a similar limitation:
Github/Flutter/ReorderableListView is too limited to be (always) useful #25789
Thanks!
return new DragAndDropList.withCustomDraggableBehavior(stations, onDragFinish: (before, after) { setState(() { StationModel data = stations[before]; stations.removeAt(before); stations.insert(after, data); this._favoritesService.updateFavoriteList(stations); }); }, itemBuilderCustom: ((BuildContext context, dynamic) { StationModel station = dynamic; DraggableDelegate draggableDelegate = new DraggableDelegate(); return new WidgetAndDelegate( new ListTile( title: new Text(station.name), trailing: MyDraggable( child: Icon(Icons.drag_handle), onDragStarted: draggableDelegate.onDragStartedListener, onDragCompleted: draggableDelegate.onDragCompleted, onMove: draggableDelegate.onMoveListener, feedback: new SizedBox( width: 150, height: 50, child: Text("Just for testing.."), ), childWhenDragging: null, maxSimultaneousDrags: 1, feedbackOffset: Offset(0, 0), data: stations, ), onTap: null, ), draggableDelegate); }), canBeDraggedTo: ((one, two) => true));
I am unable to use this with a custom button to drag the ListItem. Can you please explain what i done wrong?
Hey, I am currently using your plugin and it works really well on an ios simulator. I tried it on an actual device and each time you drag and drop an item, the phone vibrates. Is this part of the feature and if so, where can I disable it?
Crash when use the example code and just wrap with a Column widget.
body: Column(
children: <Widget>[
new DragAndDropList<String>(
Please create a parameter in the DragAndDropList Widget constructor to allow users of your library to specify the delay before the dragging is initiated.
on line 242 of my_draggable.dart
this.delay = const Duration(milliseconds: 500),
To clarify:
It would be awesome if you would make it possible to specify the desired delay before the dragging starts. Preferably, this would be specified in the constructor of DragAndDropList.
If there is already a way to do this, please show how it can be done with code examples.
In old fashion way ( before using this plugin ) I was doing
_scrollController.animateTo(160 * _scrollController.offset, duration: Duration(seconds: 5), curve: Curves.bounceInOut);
I cannot attach a scroll controller now...
Thanks
I hope this plugin support GridView!
thanks!
hi guys,
the ideal would be insert a parameter to manage the speed.
thanks
If the order of the list of items passed to DragAndDropList is changed by some other means than dragging and dropping, e.g. by doing removeAt or insert somewhere other than in onDragFinish the changes are not reflected. I.e the list is not re-ordered.
I'm pretty new to flutter so I changed DragAnDropList to a ListView for comparison and the changes were reflected.
What I am trying to do is allow the user to do a quick initial sort by tapping items. Tapping an item moves it to the top of the list with an indicator 1, 2, 3, 4, ... for each item tapped. So have an onTap() which does an insert and removeAt. As mentioned it works with a ListView but not with DragAndDropList. (ListView takes an itemBuilder that accepts an index rather than the item, that was the only change I made to the itemBuilder to get it to work with ListView)
I appreciate the work you have done, thanks again! I also understand that it may already meet your requirements so no offence taken if you decide not to spend more time on addressing something that you yourself don't need.
Nice one @Norbert515!!! Just got it working in my project, Easy to use.
A few minor issues:
When an item is picked up (but not yet dragged) near the bottom of the screen the list starts scrolling down automatically - strange if your intention is to move the item up. Similarly at top of screen the list automatically starts to scroll up.
When an item selected by long pressing below its vertical midpoint, the blank placeholder item is inserted below the item and the item below is moved underneath the elevated item.
If the items use an inkwell, (in my case I was a ListTile with onTap()), pressing an item starts the inkwell animation but holding the press (to select the item for drag) causes the animation to complete on the item below it in the list. Not really a big deal for me. I just wrapped the ListTile in a GestureDetector and moved nTap from the ListTile to the GD, now no inkwell animations though :-(.
When I open a dialog from a button on a list item and focus on the Text Input within the dialog. DragAndDropList crashes with this:
This has happened in flutter's own UI code before and they have fixed this.
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building Builder(dirty):
flutter: Looking up a deactivated widget's ancestor is unsafe.
flutter: At this point the state of the widget's element tree is no longer stable. To safely refer to a
flutter: widget's ancestor in its dispose() method, save a reference to the ancestor by calling
flutter: inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 Element._debugCheckStateIsActiveForAncestorLookup. (package:flutter/src/widgets/framework.dart:3233:9)
flutter: #1 Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:3242:6)
flutter: #2 Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3257:12)
flutter: #3 Theme.of (package:flutter/src/material/theme.dart:127:52)
flutter: #4 showDialog. (package:flutter/src/material/dialog.dart:610:37)
flutter: #5 _DialogRoute.buildPage (package:flutter/src/widgets/routes.dart:1446:14)
flutter: #6 _ModalScopeState.build. (package:flutter/src/widgets/routes.dart:618:43)
flutter: #7 Builder.build (package:flutter/src/widgets/basic.dart:5682:41)
flutter: #8 StatelessElement.build (package:flutter/src/widgets/framework.dart:3731:28)
flutter: #9 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3678:15)
flutter: #10 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #11 StatelessElement.update (package:flutter/src/widgets/framework.dart:3738:5)
flutter: #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #13 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
flutter: #14 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #15 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
flutter: #16 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #17 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
flutter: #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
flutter: #20 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #21 StatefulElement.update (package:flutter/src/widgets/framework.dart:3835:5)
flutter: #22 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #23 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
flutter: #24 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #25 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
flutter: #26 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #27 ProxyElement.update (package:flutter/src/widgets/framework.dart:3947:5)
flutter: #28 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #29 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
flutter: #30 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #31 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
flutter: #32 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #33 StatefulElement.update (package:flutter/src/widgets/framework.dart:3835:5)
flutter: #34 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #35 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
flutter: #36 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #37 StatelessElement.update (package:flutter/src/widgets/framework.dart:3738:5)
flutter: #38 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #39 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
flutter: #40 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
flutter: #42 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #43 ProxyElement.update (package:flutter/src/widgets/framework.dart:3947:5)
flutter: #44 Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
flutter: #45 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
flutter: #46 Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
flutter: #47 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2273:33)
flutter: #48 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:662:20)
flutter: #49 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:223:5)
flutter: #50 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:994:15)
flutter: #51 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:934:9)
flutter: #52 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:846:5)
flutter: #53 _invoke (dart:ui/hooks.dart:139:13)
flutter: #54 _drawFrame (dart:ui/hooks.dart:128:3)
I'm trying Flutter's sample swipe-to-dismiss code with DragAndDropList
, and though I am able to swipe items away, the program promptly complains about a Dismissible not being removed from the widget tree.
This is my build
function (inside a State
):
List<String> _items = ['Item 1', 'Item 2', 'Item 3'];
@override
Widget build(BuildContext context) {
print('Hey! $_items');
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new DragAndDropList<String>(
_items,
itemBuilder: (BuildContext context, item) {
print('Trying to build a widget for item $item');
return new Dismissible(
// Each Dismissible must contain a unique Key.
key: new Key(item),
onDismissed: (direction) {
setState(() {
_items.remove(item);
print('Hmmm... $_items');
});
},
// Show a red background as the item is swiped away
background: new Container(color: Colors.red),
child: new ListTile(
leading: new Text((_items.indexOf(item) + 1).toString()),
title: new Text(item),
),
);
},
onDragFinish: (before, after) {
String data = _items[before];
_items.removeAt(before);
_items.insert(after, data);
},
canBeDraggedTo: (one, two) => true,
dragElevation: 8.0,
),
);
}
which, after swiping Item 2
away, gives the output
Hey! [Item 1, Item 2, Item 3]
Trying to build a widget for item Item 1
Trying to build a widget for item Item 2
Trying to build a widget for item Item 3
Hmmm... [Item 1, Item 3]
Hey! [Item 1, Item 3]
Trying to build a widget for item Item 1
Trying to build a widget for item Item 2
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building Dismissible-[<'Item 2'>](dirty, state:
_DismissibleState#07bef(tickers: tracking 2 tickers)):
A dismissed Dismissible widget is still part of the tree.
Make sure to implement the onDismissed handler and to immediately remove the Dismissible
widget from the application once that handler has fired.
When the exception was thrown, this was the stack:
#0 _DismissibleState.build.<anonymous closure> (package:flutter/src/widgets/dismissible.dart:471:11)
#1 _DismissibleState.build (package:flutter/src/widgets/dismissible.dart:478:8)
#2 StatefulElement.build (package:flutter/src/widgets/framework.dart:3713:27)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3625:15)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#5 StatefulElement.update (package:flutter/src/widgets/framework.dart:3760:5)
#6 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#7 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4340:32)
#8 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4726:17)
#9 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#10 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#11 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#13 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#14 StatefulElement.update (package:flutter/src/widgets/framework.dart:3760:5)
#15 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#16 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#17 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#19 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#20 StatefulElement.update (package:flutter/src/widgets/framework.dart:3760:5)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#23 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#24 StatelessElement.update (package:flutter/src/widgets/framework.dart:3685:5)
#25 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#26 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#30 StatelessElement.update (package:flutter/src/widgets/framework.dart:3685:5)
#31 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#32 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#33 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#34 ProxyElement.update (package:flutter/src/widgets/framework.dart:3870:5)
#35 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#36 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#37 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#38 StatefulElement.update (package:flutter/src/widgets/framework.dart:3760:5)
#39 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#40 SliverMultiBoxAdaptorElement.performRebuild (package:flutter/src/widgets/sliver.dart:702:34)
#41 SliverMultiBoxAdaptorElement.update (package:flutter/src/widgets/sliver.dart:671:7)
#42 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#43 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#44 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#45 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4340:32)
#46 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4726:17)
#47 _ViewportElement.update (package:flutter/src/widgets/viewport.dart:187:17)
#48 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#49 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#50 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#51 ProxyElement.update (package:flutter/src/widgets/framework.dart:3870:5)
#52 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#53 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#54 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#55 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#56 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#57 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#58 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#59 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#60 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#61 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#62 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#63 StatefulElement.update (package:flutter/src/widgets/framework.dart:3760:5)
#64 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#65 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4618:14)
#66 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#67 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#68 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#69 StatefulElement.update (package:flutter/src/widgets/framework.dart:3760:5)
#70 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#71 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
#72 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
#73 StatelessElement.update (package:flutter/src/widgets/framework.dart:3685:5)
#74 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
#75 _LayoutBuilderElement._layout.<anonymous closure> (package:flutter/src/widgets/layout_builder.dart:118:18)
#76 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2205:19)
#77 _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:107:11)
#78 RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1666:58)
#79 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:740:15)
#80 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1666:13)
#81 _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:205:5)
#82 RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
#83 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:124:11)
#84 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:256:7)
#85 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:194:7)
#86 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:338:14)
#87 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1445:7)
#88 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:709:18)
#89 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
#90 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:622:22)
#91 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
#92 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
#93 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
#94 BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
#95 _invoke (file:///b/build/slave/Mac_Engine/build/src/flutter/lib/ui/hooks.dart:120)
#96 _drawFrame (file:///b/build/slave/Mac_Engine/build/src/flutter/lib/ui/hooks.dart:109)
════════════════════════════════════════════════════════════════════════════════════════════════════
Trying to build a widget for item Item 3
Seems like itemBuilder
is ignoring changes to _items
. Any thoughts on how to fix this?
Running "flutter packages get" in list_sort_playground...
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.
Because list_sort_playground depends on flutter_list_drag_and_drop >=0.1.1 which requires SDK version >=1.8.0 <2.0.0, version solving failed.
pub get failed (1)
Process finished with exit code 1
is it possible to change the long press gesture to a button?
If so, how can I go about implementing this?
I'm using this package for a list of numbered items and am trying to figure out a way to dynamically renumber the items as they're reordered - that is, do something like this:
itemBuilder: (BuildContext context, item) {
return new SizedBox(
child: new Card(
child: new ListTile(
leading: new Text(index+1),
title: new Text(item),
),
),
);
},
and then refresh the UI whenever a drag is finished so that the number in front is updated. However, I'm not sure how to get the current index from inside itemBuilder. Any suggestions?
I hope this plugin support Introduce a ScrollController parameter To DragAndDropList. so, I can realizatio list is pull up loading more
or add pull up loading more function to this plugin.
Thanks!
can this package be built for supporting null safety
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.