0

I have this AppBarWidget and I need to change the arrow back logo to my custom svg icon. I'm new in flutter and I can't find how to change it.

Here is code for AppBar

 return AppBar(
 elevation: 0,
 backgroundColor: white,
 foregroundColor: black,
 shadowColor: Colors.transparent,
 toolbarHeight: 80,
 titleTextStyle: getCustomeStyle(
 fontSize: 25, fontWeight: FontWeight.w700, color: black),
 title: FittedBox(
 fit: BoxFit.fill,
 child: SizedBox(
 width: _width,
 child: Row(
 mainAxisAlignment: MainAxisAlignment.spaceBetween,
 children: [
 Text(title), 
 SvgPicture.asset("assets/images//logo/ShopIO.svg",
 semanticsLabel: "ShopIO")
 ],
 ),
 )),
 bottom: PreferredSize(
 child: Container(
 color: lightGray,
 height: 1.0,
 width: _width - 30,
 ),
 preferredSize: const Size.fromHeight(0)),
 );
asked Apr 23, 2022 at 20:00

1 Answer 1

1

The easiest way is to override the deafult leading widget of AppBar and add your custom:

AppBar(
 leading: IconButton(
 icon: <whatever you like>,
 // this is the default behaviour, you can change it
 onPressed: () => Navigator.of(context).pop()
 ),
answered Apr 23, 2022 at 20:24
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.