1

I want to show the ink splash animation on drag start. I've already tried wrapping the draggable in an inkwell but the effect doesn't show.

Scaffold(
        appBar: AppBar(
          title: Text('TES'),
        ),
        body: Draggable(
          child: Tile.draw(tileSize, val, 0.0, Theme.of(context).primaryColor),
          feedback:
              Tile.draw(tileSize, val, 20.0, Theme.of(context).primaryColor),
          childWhenDragging: InkWell(
            onTap: () => print('INK!'),
            highlightColor: Colors.green,
            splashColor: Colors.green,
            customBorder: PolygonBorder(sides: 6, borderRadius: 6),
            child:
                Tile.draw(tileSize, val, 0.0, Theme.of(context).disabledColor),
          ),
        ));
key
  • 1,334
  • 1
  • 19
  • 39
  • Probably a variation of this question https://stackoverflow.com/questions/45424621/inkwell-not-showing-ripple-effect/45426828#45426828 – user1462442 Jul 02 '19 at 23:00
  • I changed the material type to transparency and there is still no ink animation. I think the problem is that the InkWell's gesture handler is being overridden by the Draggable one. I tested this by giving InkWell an onTap that prints to the console and nothing prints. Any Ideas? – Chris Irineo Jul 02 '19 at 23:38
  • Did you add a method a dummy method to onTap? Can you post a sample code? – user1462442 Jul 03 '19 at 01:46
  • Draggable( child: Tile.draw(tileSize, val, 0.0, Theme.of(context).primaryColor), feedback: Tile.draw(tileSize, val, 20.0, Theme.of(context).primaryColor), childWhenDragging: InkWell( onTap: () => print('INK!'), highlightColor: Colors.green, splashColor: Colors.green, customBorder: PolygonBorder(sides: 6, borderRadius: 6), child: Tile.draw(tileSize, val, 0.0, Theme.of(context).disabledColor), ), )); Sorry about the formatting. – Chris Irineo Jul 03 '19 at 02:16
  • Can you edit your main question and add it there? – user1462442 Jul 03 '19 at 04:50

0 Answers0