Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How change highlightShape size in the InkResponse widget

Tags:

flutter

dart

I'm trying to create a bottom navigation bar like the Twitter app has, but I can't find how to customize the highlightShape size.

I can customize corners, colors but not size, I would like to make same size which exceed the bounds of the widget like splash in my builder.

My BottomNavigationBar

Here is how look my bottom navigation button. Thank you! for help in advance.

Center(
  child: Ink(
    height: height,
    width: width,
    child: InkResponse(
      splashFactory: InkRipple.splashFactory,
      radius: radiusSize,
      onTap: () {
        const int itemIndex = 1;
        _onTapped(itemIndex);
      },
      child: _pageIndex == 1
        ? Icon(OMIcons.favoriteBorder, color: Colors.black, size: 28.0)
        : Icon(OMIcons.favoriteBorder, color: Colors.grey[600]),
   ),
 ),
),
like image 734
Arnas Avatar asked Sep 18 '18 11:09

Arnas


1 Answers

This may be an old question but, the "max" radius should match the normal radius if no radius property is specified.

To change the normal radius you should create a custom splashfactory , https://stackoverflow.com/a/51116178/10205629 .

Or as a little hack you could copy the source code and create your own inkresponse modifying the values

like image 60
ValdaXD Avatar answered Sep 17 '22 20:09

ValdaXD