I have a listTile builder that returns this listTile. The color of the listTile, white, is overwritten by its parent. How do I stop this?
return ListTile(
key: Key(index.toString()),
tileColor: Colors.white,
title: Text(widget.userExercises[index].name),
subtitle: Text("${widget.userExercises[index].reps} Reps"),
trailing: Text("${widget.userExercises[index].sets} Sets"),
onTap: () => widget.editFunction(widget.userExercises[index]),
);
However, when I run my app, the tileColor is overwritten by the parent Container's color.
return Container(
alignment: Alignment.center,
color: Colors.lightBlue,
child: ExerciseTable(
userExercises: todaysExercises,
editFunction: _showEditDialog,
),
);
Resulting in the following:
Thank you! (and sorry for the image size I don't know how to change it)

ListTilepaints itstileColoron aMaterialwidget ancestor. When a coloredContaineris in between theListTileand that ancestor you won't see thetileColor. To quote from here https://github.com/flutter/flutter/pull/86355/commits/9341a6b1d0d2852ee3c7eb413bbbdc9327f425c8 :See also this discussion: https://github.com/flutter/flutter/issues/83108