There is a space between my ListView and the Tiles

Viewed 25

I am making and app using flutter and I was using a ListView togenerate the items but there is a gap between the List and the first Tile.

Already tried

  • Changing the size of the container that wraps around the listview
  • Removing the "header" with the title "Exercícios"
  • Removing the ClipRRect

List

 
class ExerciseList extends StatelessWidget {
 
 final List<String> exercises;
 
 const ExerciseList({Key? key, required this.exercises}) : super(key: key);
 
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding:
          const EdgeInsets.only(top: 30, bottom: 20, right: 30, left: 30),
      child: ClipRRect(
        borderRadius: BorderRadius.circular(30),
        child: Column(
          children: [
            Container(
              width: MediaQuery.of(context).size.width,
              decoration:
                const BoxDecoration(
                  color: Color.fromARGB(255, 60, 60, 60)
                ),
              child: const Padding(
                padding: EdgeInsets.only(top: 8, bottom: 8),
                child: Text(
                  "Exercícios",
                  textAlign: TextAlign.center,
                  style: TextStyle(
                    fontSize: 32,
                    color: Colors.white
                  ),
                ),
              ),
            ),
            Container(
              height: 300,
              decoration:
                const BoxDecoration(
                  color: Color.fromARGB(255, 65, 65, 65)
                ),
              child: ListView.builder(
                itemBuilder: (BuildContext context, int index) {
                  return Container(
                    decoration: const BoxDecoration(
                      border: Border(
                        top: BorderSide(
                          color: Colors.black,
                          width: 0.6
                        )
                      )
                    ),
                    child: ListTile(
                      title: Text(
                        exercises[index],
                        style: const TextStyle(
                          fontSize: 22,
                          color: Colors.white,
                        ),
                      ),
                    ),
                  );
                },
                itemCount: exercises.length,
              ),
            ),
          ],
        ),
      )
    );
  }
}```
1 Answers

Based on the code you provided, not able to re-create the issue on my end. enter image description here

Check your data List for any empty entries.

Related