letsar / flutter_sidekick

Widgets for creating Hero-like animations between two widgets within the same screen.
MIT License
294 stars 40 forks source link

Using sidekick inside a TableView.builder #4

Open manueljpeixoto opened 5 years ago

manueljpeixoto commented 5 years ago

When I try to use sidekick inside a TableView.buider I get this error, type 'RenderSliverList' is not a subtype of type 'RenderBox' this happens for any limition of flutter or is by design?

@override
  Widget build(BuildContext context) {
    return Column(children: <Widget>[
      Expanded(
          flex: 2,
          child: Stack(children: <Widget>[
            GestureDetector(
              onTap: () => controller.moveToTarget(context),
              child: Sidekick(
                tag: 'target',
                child: Container(
                  color: Colors.blue,
                ),
              ),
            ),
          ])),
      Expanded(
          flex: 1,
          child: Container(
            child: ListView.builder(
                itemCount: 1,
                itemBuilder: (context, index) {
                  return GestureDetector(
                        onTap: () => controller.moveToTarget(context),
                        child: Sidekick(
                          tag: 'source',
                          targetTag: 'tagTarget',
                          child: Container(
                            height: 50,
                            width: 400,
                            color: Colors.red,
                        ),
                      ));
                }),
          ))
    ]);
  }
emvaized commented 4 years ago

@manueljpeixoto This error appears when you pass Sliver widget to some widget, which accepts only non-sliver children.

Maybe you're trying to pass your TableView.builder as a child to CustomScrollView?