knopp / flutter_reorderable_list

ReorderableList for Flutter
BSD 3-Clause "New" or "Revised" License
335 stars 98 forks source link

Is it possible to make left and right shadow on draggable item when all items are wrapped with padding? Because by default only top and bottom BorderSide are applied #38

Closed gidrokolbaska closed 3 years ago

gidrokolbaska commented 3 years ago

simulator_screenshot_39DDFFC2-D6AF-4481-8200-36829EFF6819

gidrokolbaska commented 3 years ago

For anyone who is interested, I've achieved the desired result with the following widget (but we lose the transparency on drag):

DecoratedPlaceholder _defaultDecoratePlaceholder(
    Widget widget, double decorationOpacity) {
  final double decorationHeight = 10.0;

  final decoratedWidget = Builder(builder: (BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: Colors.red,
        boxShadow: [
          BoxShadow(
              color: Colors.grey,
              offset: Offset(0.0, 0.0), //(x,y)
              blurRadius: 6.0,
              spreadRadius: 6.0),
        ],
      ),
      child: widget,
    );
  });
  return DecoratedPlaceholder(offset: 0, widget: decoratedWidget);
}

simulator_screenshot_5F93CC8A-C9A0-4715-B802-91E13C327C06