title: flutter how to screen eye-care mode
body: <p>I want user can switch screen to eye-care mode for better reading like example .</p>
  
  <p>An example : </p>
  
  <p><a href="https://i.stack.imgur.com/c8jAP.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c8jAP.gif" alt="enter image description here"></a></p>
  
  <p>for change to dark mode i used following method :</p>
  
  <pre><code>ThemeData buildLightTheme() {
    final ThemeData base = ThemeData.light();
    return base.copyWith(
      cardColor: kLightBgLight,
      ...
      );
  }
  
  ThemeData buildDarkTheme() {
    final ThemeData base = ThemeData.dark();
    return base.copyWith(
      brightness: Brightness.dark
      cardColor: kDarkBgLight,
      ...
      );
  }
  </code></pre>
  
  <p>and use in MaterialApp Theme like that :</p>
  
  <pre><code>theme: Provider.of&lt;AppModel&gt;(context, listen: false).darkTheme
                    ? buildDarkTheme()
                    : buildLightTheme(),
  </code></pre>