[Solved] Flutter: A value of type 'ListTileThemeData' can't be assigned to a variable of type 'ListTileTheme'
I am posting this question to help future readers. After upgrading to
Flutter 2.8 I suddenly got this error when trying to run my app:
Flutter: A value of type 'ListTileThemeData' can't be assigned to a variable of type 'ListTileTheme'.
How did I fix this?
Turns out this error was caused by a popular library I used (
settings_ui) that does not work with this version of Flutter (
For future readers: Use a later version of this package. There is currently an open issue on github that addresses this.
For people facing this issue now:
As a monkey patch you can follow the steps in the GitHub issue and edit the package files locally:
final ListTileTheme tileTheme = ListTileTheme.of(context); to
final tileTheme = ListTileTheme.of(context);
_iconColor(ThemeData theme, ListTileTheme tileTheme) to
_iconColor(ThemeData theme, ListTileThemeData tileTheme).