Home > OS >  Change back icon for whole app at one not by doing manually on individual on each screens
Change back icon for whole app at one not by doing manually on individual on each screens

Time:11-27

i want to change the back button icon for whole app not by changing it individually on screens i am unable to find out any placeholder to change the icon in app bar theme

there is no option for icon in appBarTheme

 appBarTheme: AppBarTheme(
              elevation: 0,
              systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light),
              titleTextStyle: Theme.of(context).textTheme.headline6,
              color: Colors.transparent,
              iconTheme: IconThemeData(color: dark3)),

CodePudding user response:

Do like this. If you are using Scaffold then under Scaffold in the appBar params there is one param called leading Icon. Change that and you'll get your desired icon as a Back Icon.

Scaffold(
 appbar:AppBar(
  leading:
    //<put that type of icons/widget you want to use >
  ),
 body: 
  //...
)

CodePudding user response:

make a custom appbar like this and use this wherever you need.

AppBar customAppBar()=>AppBar( 
 leading: //<put that type of icons/widget you want to use > 
//other params as per your requirement
); 
  • Related