0

当我每天点击像 facebook 这样的图像时,我需要涟漪效应。用于Ink.image网格视图图像在我的代码中不起作用。我想在我的图像上点击动作触发时产生涟漪,但我的代码仅适用于按下。还将小部件添加到Material小部件的父级Ink.image。请解决我。这是我的代码。

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]
                                                        });
                                                  },
                                                ),
                                              )
                                            ),
                                        ),
                                      ),
                                ],
                              );
                            }))
4

0 回答 0