Widget build(BuildContext context) { return new Scaffold( appBar: setAppBar(), body: new Container() // add rest of the UI );}Widget setAppBar() { return new AppBar( //backgroundColor: Colors.blue, //automaticallyImplyLeading: true elevation: 0.0, // for elevation titleSpacing: 0.0, // if you want remove title spacing with back button title: UtilCommonWidget.addTextMedium('About US', Colors.white, 20.0, 1), actions: <Widget>[ addAppBarActionWidgetProfile(icon, 30.0, 30.0, 15.0) // add your custom action widget ],//Action icon search as search icon, notification icon leading: new Material( //Custom leading icon, such as back icon or other icon color: Colors.transparent, child: new InkWell( onTap: () { Navigator.of(context).pop(); }, splashColor: UniQueryColors.colorGradientEnd.withOpacity(.5), child: new Container( padding: const EdgeInsets.fromLTRB(12.0, 16.0, 16.0, 16.0), child: UtilCommonWidget.addImage(Constant.iconBack, 19.0, 10.0)) ), ) );}
↧
Answer by Rafiqul Hasan for How to create a custom AppBar widget?
↧