ravipatel0508/source-code

ListTile Sticky Color Issue

Opened this issue · 0 comments

I have used ListView.builder() and when I try to scroll the list, the tileColor is stuck to the screen(Until we click on the screen), and the content returns to its position.

I can solve this by changing the physics to BouncingScrollPhysics() but I want to use the default physics.

Here is the code:

ListView.builder(
      itemCount: 5,
      itemBuilder: (context, index) {
        return Padding(
          padding: const EdgeInsets.all(7),
          child: ListTile(
            tileColor: AppColors.lightColor[60],
            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7)),
            contentPadding:
            const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
            leading: const CircleAvatar(
              child: Icon(Icons.group),
            ),
            title: Text(
              'Group $index',
              style: const TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
        );
      },
    );

Focus on Tile 6 and 7

Issue.mp4