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