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

Adding the capability to override the == operator #80

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/drag_and_drop_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ class DragAndDropItem implements DragAndDropInterface {
this.feedbackWidget,
this.canDrag = true,
});
@override
bool operator ==(other) {
return other is DragAndDropItem && other.child == child;
}
}
1 change: 1 addition & 0 deletions lib/drag_and_drop_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class DragAndDropList implements DragAndDropListInterface {
onReorderOrAdd: parameters.onItemDropOnLastTarget!,
child: lastTarget ??
Container(
//color: Colors.green,
height: parameters.lastItemTargetHeight,
),
));
Expand Down
3 changes: 2 additions & 1 deletion lib/drag_and_drop_lists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class DragAndDropLists extends StatefulWidget {
/// the vertical axis. By default this is set to true. This may be useful to
/// disable when setting customDragTargets
final bool constrainDraggingAxis;

/// If you put a widget before DragAndDropLists there's an unexpected padding
/// before the list renders. This is the default behaviour for ListView which
/// is used internally. To remove the padding, set this field to true
Expand Down Expand Up @@ -494,6 +494,7 @@ class DragAndDropListsState extends State<DragAndDropLists> {
Widget _buildListView(DragAndDropBuilderParameters parameters,
DragAndDropListTarget dragAndDropListTarget) {
Widget _listView = ListView(
shrinkWrap: true,
scrollDirection: widget.axis,
controller: _scrollController,
children: _buildOuterList(dragAndDropListTarget, parameters),
Expand Down
2 changes: 1 addition & 1 deletion lib/programmatic_expansion_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class ProgrammaticExpansionTileState extends State<ProgrammaticExpansionTile>
final ThemeData theme = Theme.of(context);
_borderColorTween.end = theme.dividerColor;
_headerColorTween
..begin = theme.textTheme.subtitle1!.color
..begin = theme.textTheme.titleMedium!.color
..end = theme.colorScheme.secondary;
_iconColorTween
..begin = theme.unselectedWidgetColor
Expand Down