0

Does anyone know if there is a way to remove the PageView color that occurs when the user reaches the end of the items? this is an image that describes what I mean Click here

PageView.builder(
                    physics: NeverScrollableScrollPhysics(),
                    scrollDirection: Axis.vertical,
                    controller: _controller,
                    itemCount: 4,
                    itemBuilder: (BuildContext context, int index) {
                      _isValid = false;
                      return [
                          SizedBox.expand(...),
                          SizedBox.expand(...),
                          SizedBox.expand(...),
                          SizedBox.expand(...),
                        ][index];
                    },
                  )

I found the complete and right answer here: How to remove scroll glow?

Community
  • 1
  • 1
MElhalees
  • 75
  • 7

2 Answers2

0

This effect is provided by ScrollBehavior. You need to provide your custom ScrollBehavior and wrap it inside a ScrollConfiguration.

class CustomScrollBehavior extends ScrollBehavior {
 @override
  Widget buildViewportChrome(
     BuildContext context, Widget child, AxisDirection axisDirection) {
     return child;
  }
}

To remove the effect in your PageView

ScrollConfiguration(
  behavior: CustomScrollBehavior(),
  child: PageView.builder(
    ...
  ),
)
user3555371
  • 238
  • 1
  • 7
0

above one is not worked for me , after the new flutter v2 ( sdk 2.8.1),

NotificationListener<OverscrollIndicatorNotification>(
  onNotification: (overscroll) {
   overscroll.disallowIndicator();
    return true;
   },
child: SingleChildScrollView(

 )
)
Jinto Joseph
  • 947
  • 6
  • 23