title: Create reusable appBar in flutter
body: <p>I am trying to create a reusable appBar in my flutter app. The right bar button of the appbar should be controlled from main UI where it is added. I am able to create appBar and use it but I am not able to change the text color of the button on the appbar. Following is my code for creating appBar:</p>
  
  <pre><code>    class SocialAppBar extends StatefulWidget implements PreferredSizeWidget {
    AppBarConfig appBarConfig;
    bool isEnabled = false;
    VoidCallback rightButtonClickCallback;
  
    SocialAppBar({@required this.appBarConfig, @required this.rightButtonClickCallback});
  
    @override
    State&lt;StatefulWidget&gt; createState() {
      return SocialAppBarState();
    }
  
    @override
    Size get preferredSize =&gt; new Size.fromHeight(kToolbarHeight);
  }
  
  class SocialAppBarState extends State&lt;SocialAppBar&gt; {
    @override
    Widget build(BuildContext context) {
      return getAppBarWithProfilePic();
    }
    Widget getAppBarWithProfilePic() {
      return AppBar(
        brightness: Brightness.light,
        backgroundColor: Colors.white,
        centerTitle: true,
        leading: IconButton(
            icon: Icon(Icons.arrow_back_ios),
            key: const Key("backButton"),
            onPressed: () {
              Navigator.pop(context);
            }),
        iconTheme: const IconThemeData(
          color: Colors.black54, //change your color here
        ),
        titleSpacing: 0.0,
        title: Row(
          children: &lt;Widget&gt;[
            buildAvatar(),
            const SizedBox(
              width: 15,
            ),
            Text(widget.appBarConfig.fullName,
                style: TextStyle(color: AppColor.appbarTitleSecondaryColor, fontWeight: FontWeight.w400))
          ],
        ),
        actions: &lt;Widget&gt;[
          Container(
              alignment: Alignment.centerRight,
              padding: const EdgeInsets.only(left: 20, right: 20),
              child: InkWell(
                child: AutoSizeText(
                  AppLocalizations.of(context).translate(GlobalString.labelNext),
                  style: TextStyle(color: widget.isEnabled ? AppColor.blue : AppColor.greyMediumDark, fontSize: 16),
                  textAlign: TextAlign.center,
                ),
                onTap: widget.rightButtonClickCallback,
              ))
        ],
      );
    }
  
    setNextButtonColor(){
      setState(() {
  
      });
    }
  }
  </code></pre>
  
  <p>I am using the above appBar like following in my screen:</p>
  
  <pre><code>void initState() {
      super.initState();
  
      appBar = SocialAppBar(appBarConfig: appBarConfig, rightButtonClickCallback: nextButtonClick);
  //Next button on app bar should be enabled when following textController has any text
      _textController.addListener((){
        if (_textController.text.length &gt; 0){
          appBar.isEnabled = true;
        }else {
          appBar.isEnabled = false;
        }
      });
    }
  @override
    Widget build(BuildContext context) {
      return BlocBuilder(
        bloc: _createPostBloc,
        builder: (context, state) {
          if (state is CreatePostNextState) {}
          return Scaffold(
            appBar: this.appBar,
            key: _scaffoldKey,
            backgroundColor: Colors.white,
            body: buildPageView(),
          );
        },
      );
    }
  </code></pre>
  
  <p>I am able to set the Next button enable/disable with the above code but unable to change the color from Gray to Blue.</p>
  
  <p>Regards</p>