How to create toolbar searchview in Flutter

0 votes

Hi Guys,

I have created a Flutter App. I want to create a toolbar search view in Flutter App. How can I do that?

Sep 14, 2020 in Others by akhtar
• 38,230 points
862 views

1 answer to this question.

0 votes

Hi@akhtar,

You can create an Icon in your App bar. This Icon is used for searching as shown below. You just need to add these codes to your app bar.

actions: <Widget>[
          new IconButton(icon: actionIcon,onPressed:(){
          setState(() {
                     if ( this.actionIcon.icon == Icons.search){
                      this.actionIcon = new Icon(Icons.close);
                      this.appBarTitle = new TextField(
                        style: new TextStyle(
                          color: Colors.white,
                        ),
                        decoration: new InputDecoration(
                          prefixIcon: new Icon(Icons.search,color: Colors.white),
                          hintText: "Search...",
                          hintStyle: new TextStyle(color: Colors.white)
                        ),
                      );}
                      else {
                        this.actionIcon = new Icon(Icons.search);
                        this.appBarTitle = new Text("AppBar Title");
                      }
                    });
        } ,),]
answered Sep 14, 2020 by MD
• 95,440 points

Related Questions In Others

0 votes
1 answer

How to create a Volume Icon in Flutter App?

Hi@akhtar, You can use Icon Widget to create ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,440 points
1,728 views
0 votes
1 answer

How to create Toast in Flutter?

Hi@akhtar, You can use the toast plugin to ...READ MORE

answered Jul 27, 2020 in Others by MD
• 95,440 points
1,215 views
0 votes
1 answer

How to create a container widget in Flutter?

Hi@akhtar, Container means a parent widget that contains ...READ MORE

answered Jul 28, 2020 in Others by MD
• 95,440 points
1,695 views
0 votes
1 answer

How to create an input field in Flutter?

Hi@akhtar, There are different ways to create an ...READ MORE

answered Aug 9, 2020 in Others by MD
• 95,440 points
1,115 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,230 points
891 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,440 points
1,058 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,440 points
1,506 views
0 votes
1 answer

How to create a Project in Flutter?

Hi@akhtar, Flutter has an inbuilt command to create ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,440 points
698 views
0 votes
1 answer

How to create an Icon Button in Flutter?

Hi@akhtar, To create an Icon Button in Flutter, ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,440 points
738 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP