1

I want to hide the app bar and bottom navigation bar while I am on camera screen tab

Widget build(BuildContext context) {
    return new WillPopScope(
      onWillPop: () async => false,
      child: GestureDetector(
        child: Scaffold(
          appBar: AppBar(
            title: Padding(
              padding: const EdgeInsets.only(left: 200.0),
              child: Text("techstagram",
                  style: TextStyle(color: Colors.deepPurple)),
            ),
            backgroundColor: Colors.white,
            //  backgroundColor: Colors.white,
            leading: IconButton(
              icon: Icon(
                Icons.search,
                color: Colors.deepPurple,
              ),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => SearchListExample()),
                );
              },
            ),

            actions: <Widget>[
              Padding(
                padding: const EdgeInsets.only(right: 180.0, top: 15.0),
                child: Text(
                  'Hashtag',
                  style: TextStyle(
                      color: Colors.deepPurple,
                      fontSize: 20.0,
                      fontWeight: FontWeight.bold),
                ),
              ),
              IconButton(
                icon: Icon(
                  Icons.message,
                  color: Colors.deepPurple,
                ),
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) => ConversationPage()),
                  );
                },
              ),
            ],
          ),
          body: ResponsiveLayoutBuilder(
              builder: (context, size) => new TabLayoutDemo()),
        ),
      ),
    );
  }
SSK
  • 3,444
  • 6
  • 32
  • 59
Abdul Shadaab
  • 41
  • 1
  • 5
  • This might help: https://stackoverflow.com/questions/53941362/flutter-how-can-i-dynamically-show-or-hide-app-bars-on-pages – Tobias H. Aug 23 '20 at 16:02

1 Answers1

0

You can test the condition as below.

Scaffold(
 appBar: canShow? AppBar(""):null,
 bottomNavigationBar: canShow? BottomNavigationBar(""):null
)
Thida Swe Zin
  • 289
  • 1
  • 6