flutterdartthemesflutter-theme

Using dividerColor in Theme does not result in coloured Dividers


I'm expecting that widgets in the display tree would be effected by a dividerColor having been set on my Theme in Flutter.

High up in my widget tree is:

MaterialApp(
  /* ... */
  theme: ThemeData(dividerColor: Colors.green)
  /* ... */
);

And yet when using a Divider() inside my child widgets, the colour is not present. Only when I set the colour explicitly, does it appear, like so:

Divider(color: Colors.green)

My understanding was that the Theme's dividerColor would be used when no colour is specified?


Solution

  • Apologies; I had not restarted the application... 🤦‍♂️

    Posting answer here in case it helps anyone else; Theme changes need a full restart of the application as hot-reloading does not seem to have an affect when changing theme properties.