title: Flutter AppBar Icontheme change automatically?
body: <p>I'm developing an application. Somehow the <code>IconTheme.of(context).color</code> is changed inside an <code>AppBar</code> widget. It makes the icon becomes white on a white background.</p>
  <p>I have a global theme with a defined IconTheme. I'm using <code>Color(0xFFC6426E)</code> as my <code>primaryColor</code>. If I change the primary color to some light color like <code>Color(0xFFD8EDED)</code>, the icon color becomes black instead. Is there any insight about it?</p>
  <p>The <code>Scaffold</code> is routed from <code>Navigator.push()</code>, so there shouldn't be a problem from a parent widget</p>
  <p>Here is the code</p>
  <pre><code>Widget build(BuildContext context) {
      TimeLineCubit timeLineCubit = BlocProvider.of&lt;TimeLineCubit&gt;(context);
      AppTheme theme = BlocProvider.of&lt;AppSettingsCubit&gt;(context).getAppTheme();
      print(&quot;marker 0&quot;);
      print(theme.basicTheme.iconTheme.color);
      print(IconTheme.of(context).color);
      return Scaffold(
        appBar: AppBar(
          title: Row(
            children:
              [
              Builder(
                builder: (context) {
                  print(&quot;marker 1&quot;);
                  print(theme.basicTheme.iconTheme.color);
                  print(IconTheme.of(context).color);
                  return Container();
                },
              ),
              Expanded(
                child: Text(
                AppLocalizations.of(context)
                    .translate(&quot;timeline.title.&quot; + (isTimelineView == true ? &quot;timeline&quot; : &quot;calendar&quot;)),
                style: Theme.of(context).textTheme.headline1),
              ),
              GestureDetector(
                onTap: () {
                  setState(() {
                    isTimelineView = !isTimelineView;
                  });
                },
                child: Container(
                    padding: EdgeInsets.symmetric(horizontal: 5),
                    child: Builder(
                      builder: (BuildContext context) {
                        print(&quot;marker 2&quot;);
                        print(theme.basicTheme.iconTheme.color);
                        print(IconTheme.of(context).color);
                        return Icon(
                            isTimelineView == true ? AppCustomIcon.calendar_layout_24 : AppCustomIcon.timeline_layout_24);
                      },
                    ),
                  ),
                ),
              GestureDetector(
                onTap: () {
                  DateTime chosenDate = isTimelineView == true ? timeLineCubit.today : timeLineCubit.state.chosenDate;
                  timeLineCubit.changeChosenDate(chosenDate);
                  Navigator.of(context).push(NewDateForm.route());
                },
                child: Container(padding: EdgeInsets.symmetric(horizontal: 10), child: Icon(Icons.add))),
            ],
          ),
        ),
        body: Builder(
          builder: (context) {
            print(&quot;marker 3&quot;);
            print(theme.basicTheme.iconTheme.color);
            print(IconTheme.of(context).color);
            return isTimelineView ? TimeLineList() : CalendarPage();
          }
        ));
    }
  </code></pre>
  <p>Here is the output</p>
  <pre><code>I/flutter (14349): marker 0
  I/flutter (14349): Color(0xff717171)
  I/flutter (14349): Color(0xff717171)
  I/flutter (14349): marker 3
  I/flutter (14349): Color(0xff717171)
  I/flutter (14349): Color(0xff717171)
  I/flutter (14349): marker 1
  I/flutter (14349): Color(0xff717171)
  I/flutter (14349): Color(0xffffffff)
  I/flutter (14349): marker 2
  I/flutter (14349): Color(0xff717171)
  I/flutter (14349): Color(0xffffffff)
  </code></pre>