Flutter Appbar title grey background displaying

Viewed 330

Flutter AppBar custom view, title widget overlay with grey background in Signed build, debug build its working fine.

title widget custom view source code is shared below, please check.

_getAppbar(AppTheme themeData) {

return AppBar(
  titleSpacing: 0,
  centerTitle: false,
  leading: Container(
    //color: Colors.blue,
    margin: EdgeInsets.only(left: 15),
    child: CircleAvatar(
      radius: 30.0,
      child: SvgPicture.asset(
        "assets/svg/man.svg",
        width: 30,
        height: 30,
      ),
      //backgroundColor: Colors.red,
    ),
  ),
  title: Container(
    margin: EdgeInsets.only(left: 10),
    alignment: Alignment.centerLeft,
    color: Colors.transparent,
    child: Expanded(
        child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
          Text(
            "Hi, Vikky",
            style: TextStyle(
                fontSize: 9,
                fontWeight: fontRegular,
                color: Color(themeData.headerNameColor)),
          ),
          Wrap(crossAxisAlignment: WrapCrossAlignment.center, children: [
            Icon(
              Icons.location_on,
              size: 12,
              color: Color(themeData.brandColor),
            ),
            Text(
              "Kuzhikkattu Moola",
              style: TextStyle(
                  fontSize: 12,
                  fontWeight: fontMedium,
                  color: Color(themeData.textColor)),
            )
          ]),
        ])),
  ),
  backgroundColor:Colors.transparent,
  elevation: 0,
);

}enter image description here

enter image description here

Debug build its working fine, issue only in signed build.

1 Answers

This issue is related to Incorrect use of ParentDataWidget not about color. This issue seems only in release mode not in build mode

Container(
    margin: EdgeInsets.only(left: 10),
    alignment: Alignment.centerLeft,
    color: Colors.transparent,
    child: Expanded( //Issue is here Incorrect use of Expanded Widget
        child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
          Text(
            "Hi, Vikky",
            style: TextStyle(
                fontSize: 9,
                fontWeight: fontRegular,
                color: Color(themeData.headerNameColor)),
          ),
          Wrap(crossAxisAlignment: WrapCrossAlignment.center, children: [
            Icon(
              Icons.location_on,
              size: 12,
              color: Color(themeData.brandColor),
            ),
            Text(
              "Kuzhikkattu Moola",
              style: TextStyle(
                  fontSize: 12,
                  fontWeight: fontMedium,
                  color: Color(themeData.textColor)),
            )
          ]),
        ])),
  ),

Try to manage your UI by replacing widget - Expanded . Go through with this link : Incorrect use of Parent Data Widget

Related