0

I need ripple effect when tap image like facebook my day. Use Ink.image for grid view image not work in my code. I want to ripple when on tap action trigger on my image but my code only work for pressing. Also add the Material widget to the parent of Ink.image widget. Please solve me. This is my code.

Expanded(
                        child: GridView.builder(
                            gridDelegate:
                                SliverGridDelegateWithFixedCrossAxisCount(
                                    crossAxisCount: 2),
                            controller: _scrollController,
                            padding: EdgeInsets.all(8.0),
                            itemCount: _agentsList.length,
                            shrinkWrap: true,
                            physics: ClampingScrollPhysics(),
                            itemBuilder: (BuildContext context, int index) {
                              return Stack(
                                children: [
                                      Container(
                                        margin: EdgeInsets.all(margin),
                                        child: ClipRRect(
                                          borderRadius: BorderRadius.all(Radius.circular(19.0)),
                                          child: Material(
                                              clipBehavior:Clip.hardEdge,
                                              child: Ink.image(
                                                image: CachedNetworkImageProvider(
                                                  _agentsList[index].agentPhoto,
                                                ),
                                                fit: BoxFit.cover,
                                                child: InkWell(
                                                  splashFactory:InkSplash.splashFactory,
                                                  onTap: () {
                                                    widget.viewType =
                                                        Agent.current != null
                                                            ? "hello"
                                                            : "";
                                                    Navigator.of(context)
                                                        .pushNamed('/ProfileView',
                                                            arguments: {
                                                          "agent":
                                                              _agentsList[index]
                                                        });
                                                  },
                                                ),
                                              )
                                            ),
                                        ),
                                      ),
                                ],
                              );
                            }))
La Pyae
  • 371
  • 3
  • 19
  • ok, you are missing splash effect ? – Md. Yeasin Sheikh Nov 11 '21 at 15:37
  • Where can I add splash effect parameter? In```InkWell``` widget? I think there is no splash effect parameter in ```InkWell``` widget. – La Pyae Nov 11 '21 at 15:57
  • I'm not aware of the facebook splash effect , can you include the desire out on question. And there are some parameters on `InkWell` can be used to change the behavior of the UI. – Md. Yeasin Sheikh Nov 11 '21 at 16:30
  • That is work, I change highlightColor option in ```InkWell``` widget. In debug mode, this animation is little slow ,so I think this does not work at first. My fault. – La Pyae Nov 11 '21 at 16:51

0 Answers0