0

I have a Gridview inside a Rawscrollbar, and both of the scrollbar are showing when scrolling. what i want is just the rawscrollbarto be showing, what do i do?

@override
 Widget build(BuildContext context) {
   return Expanded(
     child: RawScrollbar(
       thumbColor: customAppColors.secondaryColor,
       isAlwaysShown: true,
       child: GridView.builder(
         padding: EdgeInsets.all(10),
         shrinkWrap: true,
         gridDelegate: SliverGridDelegateWithFixedCrossAxisCountAndFixedHeight(
           crossAxisCount: 3,
           crossAxisSpacing: 3,
           mainAxisSpacing: 3,
           height: 170,
         ),
         itemBuilder: (_, index) {
           return Card();
         },
         itemCount: list.length,
       ),
     ),
   );
 }

1 Answers1

2

I solved it by using the ScrollConfiguration Widget, and setting the Grid view scrollbar widget to false

See Code Below

@override
  Widget build(BuildContext context) {
    return Expanded(
      child: RawScrollbar(
        controller: _scrollController,
        isAlwaysShown: true,
        thickness: 5,
        radius: Radius.circular(20),
        thumbColor: Colors.yellow,
        child: ScrollConfiguration(
          behavior: ScrollConfiguration.of(context).copyWith(
            scrollbars: false,
          ),
          child: GridView.builder(
            padding: EdgeInsets.all(10),
            shrinkWrap: true,
            controller: _scrollController,
            gridDelegate:
                SliverGridDelegateWithFixedCrossAxisCount(),
            itemBuilder: (_, index) {
              return Card(

              );
            },
            itemCount: list.length,
          ),
        ),
      ),
    );
  }