Change color locally according to brightness mode


Is it possible to change the color from a specific icon locally, without using theme? something like

color: Brightness.light == "something" ? :


You can get current theme mode from Theme.of(context).brightness.

color: Theme.of(context).brightness == Brightness.dark
    ? Colors.white

Answered By – Yeasin Sheikh

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *