skip to Main Content

appBar: AppBar(
leading: BackButton(
onPressed: () {
Get.off(exercisePage());
},
),

    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.only(
          bottomLeft: Radius.circular(30),
          bottomRight: Radius.circular(30)),
    ),
    automaticallyImplyLeading: false,
    title: Padding(
      padding: const EdgeInsets.only(left: 25),
      child: Text(
        'Regular exercise',
        style: TextStyle(
            fontFamily: 'FontMain', fontSize: 22, color: Colors.indigo),
      ),
    ),
    backgroundColor: Color.fromARGB(255, 231, 235, 237),
   
  ),

I have a BackButon() in my appbar , I want to change the default icon of BackButton in FLUTTER.

2

Answers


  1.    appBar: AppBar(
          automaticallyImplyLeading: false,
          leading: GestureDetector(
            onTap: () {
              Navigator.pop(context);
            },
            child: const Icon(
              Icons.arrow_back, // This is icon for change for your side
              color: Colors.black,
            ),
          ),
          centerTitle: false,
          backgroundColor: Colors.white,
          elevation: 0,
          title: const Text(
            "Testing",
            style: TextStyle(
                color: Colors.black,
                fontSize: 22,
                fontWeight: FontWeight.w400),
          ),
        ),
    
    Login or Signup to reply.
  2.     appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back, //change the icon here
     color: Colors.black),
            onPressed: () => Navigator.of(context).pop(),
          ), 
          title: Text("Sample"),
          centerTitle: true,
        ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search